I am using Ubuntu core and installed node-red, when i used the top command it shows that the node-red is running as a root user. The gpio files are also as root user only. But I’m not able access gpio files(/sys/class/gpio). So I tried to create gpio group with gpio path and add node-red user to that gpio group, but not able to add while creating group I am getting
groupadd fails with “cannot lock /etc/group; try again later”
Is there any solution that node-red can access gpio files(I’m creating those gpio file once the ubuntu boots)
can you give me one example to connect all interface slots and plugins to node-red.
root@admin:~# snap interface gpio
name: gpio
summary: allows access to specifc GPIO pin
plugs:
and so on… on the left hand side you have the plug (snap name, colon, plug name on that side), on the right hand side you have the slot (again snap name, this time that holding the slot, colon, slot name on that side).
I hope this is a better place to ask this. Thanks @ogra for your guidance on forum etiquette. I am new here and honestly haven’t spent a lot of time on forums let me know if i can better form posts i’m all ears!
So…I installed core on my raspberrypi 3 and am attempting to run the nod-red dashboard on on the wpe-webkit with mir-kiosk. I have 2 specific problems that arise which I assume are a result of the confinement of the node-red snap:
in node red raspberry pi gpio nodes just say “Not available”
when I try to install new node-red modules from the pallet manager that require access to the i2c bus on the i get the following error:
I wanted to show some relevant system information but for some reason the lsb_release -a command doesn’t exist but cat /etc/issue/ gives me ```Ubuntu Core 18 on \4 (\1) `` not sure if that info is useful…
I should also mention that I already connected each gpio interface slot to the gpio plugs in node-red but still no dice. and I couldn’t find a plug for the i2c interface in node-red.
I should also mention that I did get node-red working with my gpio and i2c devices on previous builds on arch linux by creating a user group and adding my standard user to that group and using chown to give the group access to the hardware devices. Is there an equivalent process in core?
snap servcies (like node-red) always run as root, so there is no need to change permissions …
if you did all connections too, the app should have full access to the gpio devices, there must be something missing in the node-red snap … do you see any DENIED messages in your systemd journal ?
So maybe I screwed something up but I could not get it working so in an attempt to get this project buttoned up I installed an old version of server 18.04 using the instructions on this page:
…but it ran slower for some reason and my dashboard application crashed after running for several hours. which unfortunately is a common occurrence for me when I try building IOT devices running on a pi. Any ideas??
I’m not giving up on core yet, but maybe I’m barking up the wrong tree. for now I just need a speedy kiosk running the node-red dashboard I don’t really care what platform at this point. I have so much more to tackle on this project and a customer crawling up my @ss so I should prob lean towards a less experimental approach…
Well, i think there is something seriously wrong in the node-red snap packaging, there are plenty of projects out there using GPIOs on raspberry pi’s under Ubuntu Core so the GPIO implementation and interfacing is well tested and working widely.
my assumpotion is that either some Pi specific integration library is not shipped in the snap or it does not have all information it needs due to i.e. a missing interface.
Taking a quick look at the node-red snap it is actually missing all architecture specific modules (including the raspberrypi gpio ones), i2c support, the dashboard module and a bunch of other things.
I have forked the snap and added the missing bits and pieces to:
… and renamed it to node-red-rpi. You can try it out with:
snap install node-red-rpi --edge
then connect gpio and i2c interfaces, go to port 1880 and try if it works for you (if it does i’ll happily do a stable release).
these modules both throw the same error when installing doesn’t look like a permission error can this node be installed on the command line? Although it defeats the purpose of the confinement for security if that was possible guess.
hmm, i thought they are (at least the i2c one) … are you on armhf or arm64 ? (i havent cared a lot for arm64 since thats insane to use on a < 4GB device)
the list of the added modules is:
more importantly though … can you access the gpios via the “rpi gpio in” and “rpi gpio out” nodes from the menu ?