This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GPIO Nodes
#1
What GPIO nodes are people using in Node Red???

Since some updates the nodes I was using no longer work!!
Pi5 8GB, NVME SSD 512GB, MacArthur hat, OP4,
Reply
#2
I ran into the same thing on a Pi 5. As far as I understand it, the cause is the Pi 5 itself rather than OpenPlotter: the GPIO pins now go through the new RP1 chip, and the old RPi.GPIO library (which the classic rpi-gpio nodes rely on) does not support it. pigpiod does not support the Pi 5 either, so the "remote GPIO" nodes are no help there.

What worked for me without waiting for a fixed node:

1. Check that the pins respond at OS level first:
Code:
pinctrl get 17
pinctrl set 17 op dh   # output, drive high
pinctrl set 17 op dl   # output, drive low
gpioinfo | head -40     # from the gpiod package

2. In Node-RED, use an exec node with the command "pinctrl set 17 op" and append msg.payload ("dh" or "dl"). For inputs, an exec node running "pinctrl lev 17" triggered by an inject node every second is crude, but reliable.

3. If you have Python scripts that import RPi.GPIO, the "rpi-lgpio" package is a drop-in replacement that runs on top of lgpio (uninstall RPi.GPIO first, they clash).

Also check that the node-red user is in the "gpio" group (groups node-red or groups pi), otherwise everything fails silently.

If someone has a native Node-RED GPIO node that works on Pi 5 + Bookworm, I would also like to know, it would be cleaner than exec nodes.
Consultor de TI em Portugal (PME). Guia de licenciamento: Office 2024 Professional Plus
Reply
#3
The RP1 explanation makes sense, and the pinctrl commands are useful to know. One thing worth checking before swapping nodes: confirm the node-red user actually has access to /dev/gpiochip* under Bookworm, since the group situation changed there too. For inputs, instead of polling with pinctrl lev every second, gpiomon can watch a line and print an event — you could exec it and parse the output, which avoids constant sampling. Curious whether anyone has tried the exec approach with gpiomon for edge detection rather than level polling.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)