node-red/node-red-nodes

[node-red-node-pi-gpio] on Venus OS and other non raspian OS

lodi12 opened this issue · 0 comments

The workaround proposed here (https://flows.nodered.org/node/node-red-node-pi-gpio) for non raspian OS works good for input and output setup and set/read function but it does not work with edge detection.

A possible workaround can be found here https://forums.raspberrypi.com/viewtopic.php?t=302177.

Basically, the following lines must be added to the rule file too:

SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:dialout /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'"
SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:dialout /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"
SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"

Please, add to the help for this node.