rpi_hal from https://github.com/rudiratlos/rpi-hal is an incredible rich and uptodate unit for Freepascal to use the I/O of the Raspberry.
From Freepascal programs all works as expected when run as root. Otherwise accessing /dev/mem is causing real problems.
The unit can be used from Lazarus also (avoid the test procedures with writeln’ 😉 ) but also require root access and setting cthreads in the program heading.
For X apps running as root is not possible with just sudo.
Seems I found a solution here: https://wiki.archlinux.org/index.php/Running_GUI_applications_as_root
I applied method 2:
sudo nano /etc/profile
and added this line as last line
Now i can do
$ sudo ./testinit (my simple test program with only the init line of rpi_hal)
and this worked without error, init succeeded.
If you want debugging the app in Lazarus, start Lazarus as root (and ignore all the warnings)
Original text from https://wiki.archlinux.org/index.php/Running_GUI_applications_as_root
Method 2: Globally in /etc/profile
Add the following line to /etc/profile:
This will permanently allow root to connect to a non-root user’s X server.
Or, merely specify a particular app:
where appname is the name of the particular app. (e.g. kwrite
The Raspberry Camera Module is a giant success. Flexible, high quality, well supported. I have shown you already tow pos...
First steps with the Raspberry Pi 400, first impressions November 2, 2020. My birthday! Early, checking twitter. Eben ...
When using a Raspberry Pi in your network it is very convenient to let it use DHCP to assign IP addresses, Setting up wi...
Simple but effective timelapse. Note that raspistill has many more interesting configuration parameters! See https://...