I’m using Ubuntu Core and running it on a Raspberry Pi 3 B+ machine. I have installed on it the snaps Openhab-ondra and Nodered.
I would like to control the GPIOs of my Raspberry using Nodered but I can’t figured it out how to do. I installed even the snap pigpio and the classic mode with RPi.Gpio and WiringPi but still can’t manage to get work my GPIOs via Nodered.
As you can see this image below from my Nodered, both Gpio nodes in input and output are grey and not available. In this way unfortunately I can’t control them and I’m totally stuck.
then I connect the plug node-re to the GPIO using:
sudo snap connect node-red:gpio pi:bcm-gpio-21
At the end instead I had a look all the plugs and slots with the command
snap interfaces
What it show to me was a list and I see that the “pi:bcm-gpio-21” was connect to “node-red:gpio”
When I opened Node Red and gave the timestamp to turn the ralay ON nothing happened. The GPIO in Node Red is still grey and not available and my relay didn’t switch in the ON mode.
you might need to run nodered as root or change the permissions of the /dev/gpiochip* device that you try to connect to, even when all interfaces are connected, the normal unix/linux device permissions apply in snaps.
I used the command as @tokurz suggested to me and it gives
tail: cannot open ‘/var/log/syslog’ for reading: No such file or directory
tail: no files remaining
I also tried as @ogra suggest to stop the node-red service and access as root with “sudo su” and restarted again the service with “snap start node-red” and the terminal gave to me “Started.”
I also changed the permissions of the " /dev/gpiochip* " using the command
chmod 775 /dev/gpiochip*
At the end the problem still persist and nothing unfortunately has changed. The GPIO is still not available and it is still grey in Nodered.