|
|
scott <sco### [at] scottcom> wrote:
> On my pi I'm running raspbian, and have a process running as root to
> read a pin on the GPIO (connected to a PIR). Only root can read the GPIO
> pins, but obviously I don't want large, complex programs running as root
> just because they need to read a pin on the GPIO.
>
> What's the best way for this root process to "broadcast" to other
> (non-root) processes when that pin goes high? It will only happen at
> maximum frequency of about every 2 seconds, but any delay between the
> pin going high and the other processes seeing it should be minimal.
>
> I did think about using a file, that was write permission only for root,
> but readable by everyone, that seems like a lot of overhead though (and
> what if root tries to write to it as someone else is reading it?). In
> Windows I might consider using a broadcast message with the PostMessage
> API function, is there something similar for Linux?
PIGPIO and GPIOZERO don't need root anymore, the user just needs to be in the
gpio group
Regards
Aydan
Post a reply to this message
|
|