Ubuntu Core / Raspberrypi 3 / GPIO and i2C

Greetings!

I installed core 18 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:

  1. in node red raspberry pi gpio nodes just say "Not available"

  2. 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:

2020-06-11T22:51:49.782Z [out] > node-gyp rebuild
2020-06-11T22:51:49.782Z [out] 
2020-06-11T22:51:54.220Z [err] gyp
2020-06-11T22:51:54.221Z [err]  
2020-06-11T22:51:54.221Z [err] ERR! build error 
2020-06-11T22:51:54.223Z [err] gyp
2020-06-11T22:51:54.223Z [err]  ERR! stack
2020-06-11T22:51:54.224Z [err]  Error: not found: make

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.

Am I missing something here.. perhaps @knolleary knows a thing or two about this.. :grin:

Thanks!

Indeed the snap is fairly restricted in it's container...
At the time it was created there were not a lot of plugs available (not even serial worked well) - so I dare say things have moved on. The main project is here - https://github.com/dceejay/nodered.snap
so yes - we would welcome anyone who has necessary skill to update and Pull request to it.

(Though indeed it won't have access to all the gcc and build tools necessary to compile native modules... and I'm not sure that it should really - in that case you may as well install natively and not use a secure container)

Hi @dceejay. I did end up just installing node-red through npm on a classic install of unbuntu server18.04 everything works as expected now. I'm not going to give up on core just yet, i really like the remote deploying and security but I need to wrap this project up before I do more digging. Thanks again.

Thanks for letting us know. Yes it’s by far the most flexible way for now. I’m sure snaps can be made more flexible but then if you open up all the ports it seems kind of not the point of a secure container. But as I said were willing to be educated if anyone can spare the time.

The node red dashboard seems to be more responsive on the core install. And this version on classic ubuntu server crashed after running for a few hours. Maybe a memory leak of some kind? Seems to be a common issue I have running IOT devices on the pi. Any ideas?

The plot thickens...Sleep is overrated anyway...I will keep you posted if I can get a stable install working

Some pics of what I'm up to...


The responsiveness of the dashboard is mostly (in my experience) down to the machine you are running the browser on. For most systems the system requirements for the browser are vastly greater than for node-red. Are you running the browser on Core?

What do you mean by 'crashing` on Ubuntu server? I haven't got experience of running Ubuntu server on a Pi but Raspbian Lite (which is the server version of Raspbian) running node-red, mosquitto and influxdb is as solid as a rock for me. Looking at my main Pi server I see it has been up for 111 days. Is it node-red that is crashing (in which case what error messages do you see in the node red log)? Is something actually crashing or is it hanging or what?

I'm not sure I think I was probably more of a

i-didnt-sleep-for-24hours-and-made-a-claim-without-proof 

but running node-red with optional parameters:

node-red-pi --max-old-space-size=256

seems to keep the crashes at bay...