Recent

Author Topic: Tutorial: Install Lazarus to Raspberry Pi  (Read 45588 times)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #105 on: July 17, 2020, 12:36:59 pm »
Anyway, cross compiling and testing via USB to CAN dongle can be done on both systems and in fact I'm doing that on the PC.  Just so much faster.  But once I start using the Pi HAT with MCP2515 for CAN or the internal CAN on the BBB I'm screwed.  Pretty well have to debug on site.
Well, most of the time you don't have to debug on site if you change your architecture a bit. Here is one example: having a fleet of Balena enabled ARM boards connected to CAN 2.0B via CAN shield and using SocketCAN, with WiFi or 4G shields for communication. CAN messages go through custom J1939 filter and then they are forwarded to a custom TCP/IP server. That TCP/IP server can be on ARM board it self, or on your PC - having the same or different logic just for debugging. On such setup GDB remote debugging also works, and WireShark SocketCAN and J1939 disectors can also be used when needed. Either on board, or on development pc after tunneling and forwarding SocketCAN messages. Alternative for CAN<>ETH interfacing can be usage of socketcand daemon.
« Last Edit: July 17, 2020, 01:14:17 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

jcdammeyer

  • Full Member
  • ***
  • Posts: 205
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #106 on: July 17, 2020, 09:49:08 pm »
Thanks for your comments.  Definitely something to consider.  Maybe this weekend I can find the time to install one of the cross platforms on the new WIN-10 laptop.

Meanwhile I'll get back to the application that started all this.
Thanks again everyone.  Very enlightening and helpful.
John

Mi-Ki

  • Jr. Member
  • **
  • Posts: 74
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #107 on: February 19, 2021, 11:23:48 am »
Hi.
How to install Lazarus on Raspberry - Raspbian Buster?

sudo apt-get install fpc
sudo apt-get install lazarus
That's not good.
Do not install packaging


« Last Edit: February 19, 2021, 11:13:20 pm by Mi-Ki »

jcdammeyer

  • Full Member
  • ***
  • Posts: 205
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #108 on: April 28, 2021, 07:33:08 am »
Hi.
How to install Lazarus on Raspberry - Raspbian Buster?

sudo apt-get install fpc
sudo apt-get install lazarus
That's not good.
Do not install packaging

I'm pretty sure that I use the sudo apt install lazarus and it did everything installing whatever version it found.

Going back through my old postings I realize that it's not a very complete description of how to install the version of your choice. In the next little while I'll be installing it onto a PC X86 based LinuxCNC system.   I'll use the https://github.com/LongDirtyAnimAlf/fpcupdeluxe

process and document the details.

« Last Edit: April 28, 2021, 07:37:28 am by jcdammeyer »

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #109 on: May 01, 2021, 10:34:20 am »
sudo apt-get install fpc
sudo apt-get install lazarus
Do not install packaging

I am not sure what you mean by "packaging" but please remember that the software you get with those commands is determined by Debian, not by the FPC/Lazarus developers.  The Debian package managers like to break things in smaller lumps, IDE, LCL, GTK2, Qt5 etc.  It could be that what you are missing is in another package.

I get my FPC from SourceForge and build a Lazarus from source, again from SourceForge. That way, I get the system the developers intended.

Davo

Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1090
  • Professional amateur ;-P
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #110 on: May 01, 2021, 05:50:20 pm »
Hey all,

Has anyone come around and suggested using fpcupdeluxe?

I know I've been beating this dead horse quite a lot lately, but MAN does it solve ALL the issues in AT LEAST 2 button clicks :)

And YES, button clicks, since it's a GUI app and not a command line app :P

Cheers,
Gus

EDIT: Jezzz I'm blind as a friggin bat: fpcupdeluxe mentioned not two answers above mine!!!
ARGHHHHH, SORRY peeps !!!
« Last Edit: May 01, 2021, 05:52:19 pm by Gustavo 'Gus' Carreno »
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

jcdammeyer

  • Full Member
  • ***
  • Posts: 205
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #111 on: May 01, 2021, 06:36:17 pm »
Hey all,

Has anyone come around and suggested using fpcupdeluxe?

I know I've been beating this dead horse quite a lot lately, but MAN does it solve ALL the issues in AT LEAST 2 button clicks :)

And YES, button clicks, since it's a GUI app and not a command line app :P

Cheers,
Gus

EDIT: Jezzz I'm blind as a friggin bat: fpcupdeluxe mentioned not two answers above mine!!!
ARGHHHHH, SORRY peeps !!!

I finally got around to running this on LinuxCNC:
sudo apt install make binutils build-essential gdb subversion zip unzip libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev

I then also ran a
sudo apt install git

and then git clone https://github.com/LongDirtyAnimAlf/fpcupdeluxe.git

And now I'm stuck.  I seem to be missing from the read me file exactly what the next step is to actually run the graphical fpcupdeluze so I can choose which version I want to build. 

Suggestions?

Thanks
John


lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #112 on: May 01, 2021, 06:50:21 pm »
and then git clone https://github.com/LongDirtyAnimAlf/fpcupdeluxe.git

[...]

Suggestions?

Instead of cloning the source repository, which you would then need to compile, download the proper binary from https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/1.8.2r and then just run it.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

jcdammeyer

  • Full Member
  • ***
  • Posts: 205
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #113 on: May 01, 2021, 07:22:08 pm »
and then git clone https://github.com/LongDirtyAnimAlf/fpcupdeluxe.git

[...]

Suggestions?

Instead of cloning the source repository, which you would then need to compile, download the proper binary from https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/1.8.2r and then just run it.

And that brings me back to a question I posted on the LinuxCNC group that as yet has not been answered when I posted the above link in the question.  For LinuxCNC running Debian which version do I download.  It was easy for the Pi or the Beagle.  The LinuxCNC is running on a PC with AMD 64 and so I downloaded this one.
fpcupdeluxe-aarch64-linux

But I can't figure out how to execute.  I've done the chdmod +x but still it complains it's not the executable format.

For windows it's easy.  It's an .exe and you run it.  It installs and creates the desktop icon.  Last year I did something that I didn't document for both the Beagle and the Pi3.  But for the life of me I can't remember what else to do.  Much like learning to speak/write a language when your only source is a dictionary is impossible.

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1090
  • Professional amateur ;-P
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #114 on: May 01, 2021, 08:38:27 pm »
Hey jcdammeyer,

and then git clone https://github.com/LongDirtyAnimAlf/fpcupdeluxe.git

Errmmm, really sorry to say, but you don't get the source, you get the compiled binary for your system on the release page:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases

And then you run THAT one.

So for example on a RasPi 3, RasPi4 on Raspbian:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2r/fpcupdeluxe-arm-linux

For RasPi4 on a 64b Linux:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2r/fpcupdeluxe-aarch64-linux

Then you set the executable bit:
Code: Bash  [Select][+][-]
  1. $ chmod +x fpcupdeluxe-[CPU]-[OS]

And you run that.

Why are you struggling with the source???
You just threw me on a spin here ;)

No need for source since you have pre-compiled binaries for like 30+ platforms

Cheers,
Gus

EDIT Looks like I was answering when you posted that you already did what I'm saying here.
I'm very off my game today, really sorry !!!
« Last Edit: May 01, 2021, 08:57:06 pm by Gustavo 'Gus' Carreno »
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1090
  • Professional amateur ;-P
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #115 on: May 01, 2021, 08:54:02 pm »
Hey jcdammeyer,

And that brings me back to a question I posted on the LinuxCNC group that as yet has not been answered when I posted the above link in the question.  For LinuxCNC running Debian which version do I download.  It was easy for the Pi or the Beagle.  The LinuxCNC is running on a PC with AMD 64 and so I downloaded this one.
fpcupdeluxe-aarch64-linux

But I can't figure out how to execute.  I've done the chdmod +x but still it complains it's not the executable format.

To be absolutely sure that you have the right [CPU]-[OS] combination could you please do this:
Code: Bash  [Select][+][-]
  1. $ file /bin/bash
AND compare to this:
Code: Bash  [Select][+][-]
  1. $ file fpcupdeluxe

The results should be the same in terms of the bitness of your system.

On my RasPi3 running Raspbian:
Code: Bash  [Select][+][-]
  1. $ file /bin/bash
  2. /bin/bash: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=b1e8e19f3b7b388468f2914bfb2ae8ac6b9f0478, stripped
  3. $ file fpcupdeluxe-arm
  4. fpcupdeluxe-arm-linux: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.0.0, stripped

If they don't match, you do not have the correct binary for your system.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1090
  • Professional amateur ;-P
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #116 on: May 01, 2021, 09:06:53 pm »
Hey jcdammeyer,

I'm really SORRY, but I just noticed this after re-reding your post for the nth time:
The LinuxCNC is running on a PC with AMD 64 and so I downloaded this one.
fpcupdeluxe-aarch64-linux

That's the binary for an ARM 64b running Linux 64b, e.g. RasPi4 with 64b Linux!!! It is NOT, I repeat NOT for a x86_64(amd64 PC) running Linux.
For that you need fpcupdeluxe-x86_64-linux:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2r/fpcupdeluxe-x86_64-linux

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

jcdammeyer

  • Full Member
  • ***
  • Posts: 205
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #117 on: May 01, 2021, 10:01:47 pm »
Hey jcdammeyer,

I'm really SORRY, but I just noticed this after re-reding your post for the nth time:
The LinuxCNC is running on a PC with AMD 64 and so I downloaded this one.
fpcupdeluxe-aarch64-linux

That's the binary for an ARM 64b running Linux 64b, e.g. RasPi4 with 64b Linux!!! It is NOT, I repeat NOT for a x86_64(amd64 PC) running Linux.
For that you need fpcupdeluxe-x86_64-linux:
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/1.8.2r/fpcupdeluxe-x86_64-linux

Cheers,
Gus
Thank you.
Now I get it!  I've downloaded it.  Was able to set it as an executable this time.  And it's now busy building stable fpc and 2.0.10 which matches what I've got on the Beagle and the Pi and the PC.

Then I can get back to the component TGraphicalControl issues I'm having.  I'll post to this thread exactly what I've done, step by step and why so the thread finishes nicely.
Thanks again
John

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1090
  • Professional amateur ;-P
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #118 on: May 01, 2021, 11:47:44 pm »
Hey John,

Thank you.

[snip]

Thanks again

You're more than welcome. Glad I could help!!

And I'm really sorry I didn't caught the wrong binary earlier, that's on me!!!

Hope you can now resume your testing in peace :)

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

jcdammeyer

  • Full Member
  • ***
  • Posts: 205
  • Embedded System Developer
    • Automation Artisans Inc.
Re: Tutorial: Install Lazarus to Raspberry Pi
« Reply #119 on: May 02, 2021, 12:43:14 am »
Hey John,


You're more than welcome. Glad I could help!!
Hope you can now resume your testing in peace :)

Cheers,
Gus

Got back from shopping and it was all done and installed with an icon on the desktop.  First thing I'll do is make up a short document describing exactly what I did.  And since I have a Pi4 kicking around which I don't think has the fpcupdeluxe installed yet I'll verify the procedure in a simple step by step for that too.

This is the thread where I'm describing the issues with the component ported from Delphi.  Works great on Lazarus Windows but turns out the issue isn't Pi or Beagle specific but Linux specific.
https://forum.lazarus.freepascal.org/index.php/topic,54329.msg403858.html#msg403858

The posting from April 28th shows how dragging the component moves the rectangle behind it but doesn't drag the segments.  Under Windows Lazarus and Windows Delphi this is not an issue. 

The problem is with changing a component with Delphi is just a matter of recompiling the component.  With Lazarus the IDE has to be rebuilt.  Not a big issue on the PC, probably won't be under the Debian LinuxCNC PC.  But painfully slow on a Beagle or Pi.  Hence the reason for this thread installing fpcupdeluxe on the Debian LinuxCNC.

I have yet to figure out how to assign the parent of a component so I can create and test it separately from the IDE.  But that's for a different thread.  Just rambling here.

 

TinyPortal © 2005-2018