node-red-nodes icon indicating copy to clipboard operation
node-red-nodes copied to clipboard

Multiple "rpi-gpio in" doesn't work on Raspberry Pi 5

Open waiweng83 opened this issue 1 year ago • 3 comments

Which node are you reporting an issue on?

rpi-gpio in

What are the steps to reproduce?

[ { "id": "78b4d995a81ab599", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "a2c9b52862aa4d95", "type": "rpi-gpio in", "z": "78b4d995a81ab599", "name": "", "pin": "4", "intype": "tri", "debounce": "25", "read": false, "bcm": true, "x": 590, "y": 280, "wires": [ [ "cfbc42146f0c4c55" ] ] }, { "id": "cfbc42146f0c4c55", "type": "debug", "z": "78b4d995a81ab599", "name": "debug 1", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 780, "y": 280, "wires": [] }, { "id": "58d56a69c882d5f3", "type": "debug", "z": "78b4d995a81ab599", "name": "debug 2", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 780, "y": 340, "wires": [] }, { "id": "8409d6f2d0c9f9bf", "type": "rpi-gpio in", "z": "78b4d995a81ab599", "name": "", "pin": "4", "intype": "tri", "debounce": "25", "read": false, "bcm": true, "x": 590, "y": 340, "wires": [ [ "58d56a69c882d5f3" ] ] } ]

What happens?

When there are multiple "rpi-gpio in" node acessing the same GPIO, only the first node works as expected. The remaining nodes are not working.

What do you expect to happen?

The same flow work on Raspberry Pi 4, so it should work on Pi 5 too.

Please tell us about your environment:

  • [x] Node-RED version: v4.0.5
  • [x] node.js version: v20.18.0
  • [x] npm version: v10.8.2
  • [x] Platform/OS: Raspberry Pi OS Bookworm Desktop 64-bit
  • [x] Browser: Edge

waiweng83 avatar Nov 04 '24 09:11 waiweng83

In general only one node should be configured to one physical pin - so connecting multiple may indeed give an undetermined output. Use multiple wires out from the node - or link nodes to help fan out any inputs you need.

dceejay avatar Nov 05 '24 08:11 dceejay

In general only one node should be configured to one physical pin - so connecting multiple may indeed give an undetermined output. Use multiple wires out from the node - or link nodes to help fan out any inputs you need.

That's weird as we used that a lot on Raspberry Pi 4 without any problem. If that's the case, is it possible to show some warning if multiple node are accessing the same pin?

waiweng83 avatar Nov 05 '24 08:11 waiweng83

The whole GPIO hardware subsystem changed between the Pi 4 and the Pi 5 (it's now all handled by a RP2040 sub processor iirc).

I would suggest looking at using the gpiod based node if possible.

hardillb avatar Nov 05 '24 10:11 hardillb