For a while I have been using a Raspberry Pi 4 with Node Red and pigpiod to control some relays using GPIO output pins, and it works very well now. However now I try to use some GPIO pins as inputs and I am having a lot of trouble. The application is running in Docker containers - the pigpio daemon running in one container, and Node Red in another. The full sources and Docker containers are available in Github. I have configured pin 40 (GPIO21) as an output with pullup resistor.
[{"id":"19dcc58d.7bd56a","type":"debug","z":"9d7b7f7f.f540f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":1160,"wires":[]},{"id":"2ef83a07.16ae56","type":"pi-gpiod in","z":"9d7b7f7f.f540f","name":"","host":"172.17.0.1","port":8888,"pin":"21","intype":"PUD_UP","debounce":"25","read":false,"x":270,"y":1160,"wires":[["19dcc58d.7bd56a"]]}]
On debugging I can see that inside the container the /usr/local/bin/pigs r 21
command is able to read the GPIO pins successfully - 1 normally, but 0 when the pin is pulled to ground but Node Red does not receive any trigger that the level changed.
Further testing showed that the Pi 3B seems to work better - I can fairly reliably get Node Red to trigger. Before I take the low road and just switch to a 3B can anyone give me some hints what may be going wrong on the Pi 4 or if I am missing something else?
Thanks in advance.