Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2021-03

RaspberryPi GPIO access from multiple applications using /dev/gpiomem?

2 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I have a control application that uses GPIO pins to switch ON/OFF power feed to a data collection system and to start it using a trigger pulse.

Now I am trying to remotely debug this system and I have trouble knowing in which power state it is actually in...

I am using the "driver" PiGpio.pas by Gabor Szollosi from 2013 and it works well for everything I have tested it with (I have added a switch to define the 2 generations of RPi).
https://wiki.lazarus.freepascal.org/Lazarus_on_Raspberry_Pi#PiGpio_Low-level_native_pascal_unit_.28GPIO_control_instead_of_wiringPi_c_library.29

To debug my application I need to see the state of the control lines when the system is stepped through its functions but I am unable to travel to the location...
I do have access to the RPi3 using SSH via PuTTY and the desktop via VNC, though.

Question:
---------
Can two different applications access the (same) GPIO pins without permission problems?

In my case I only need read access to the active pins so I can display the state in a monitoring application I can watch via VNC. Checking a few times per second is enough, I think.

But I don't know if the GPIO pins are protected when they are in use by another process...

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund
Bo Berglund wrote 11 lines
Question: --------- Can two different applications access the (same) GPIO pins without permission problems? In my case I only need read access to the active pins so I can display the state in a monitoring application I can watch via VNC. Checking a few times per second is enough, I think. But I don't know if the GPIO pins are protected when they are in use by another process...

Now tested and it works fine to "spy" on GPIO pins in use by another application.

Bo Berglund Developer in Sweden

Reply by email