Node-red-node-pi-gpiod true/false vs. 0/1

I think the the underlying pigpio code only accepts 0 or 1 as valid states
image

so that is why it gives the error

The code for the pigpio node is copied a lot from the default Pi node and its underlying library is more forgiving of the payload value.

Looking at code for pigpio node - its converting true/false into a number but then actually sends the original msg.payload instead of the converted value.

Quick fix is to alter file
/home/pi/.node-red/node-modules/node-red-node-pi-gpiod/pi-gpiod.js


to use out instead of msg.payload (ignore line number variation)

I'll do some more testing and issue pull-request

1 Like