Node Red on openwrt and serial port

Hello,

I installed node-red alongside openmtcprouter which is openwrt based.

PACKAGE: openmptcprouter
VERSION: v0.58.5
TARGET: rpi4
ARCH: aarch64_cortex-a72

The goal is to add automation on a systeme which shares a couple of 4G modems for video transmitting.

It works fine, and for thoses interessed on doing so there is the way on such distro:
1: update packages
opkg update
2: install node
opkg install node-npm
3: install node-red:
npm install -g --unsafe-perm node-red

However, i could't find precompiled packages for GPIO for openwrt.

As i would like to access hardware, i wanted to use an arduino with it's usb/serial, but it doesn't work easeliy. I can not list the port in node-red and if i write it that way /dev/ttyACM0/ it throws a segmentation fault and crash node-red.

however, I'm able to acces the same port with cat /dev/ttyACM0 which seems to me sort of a problem about permissions.

The obvious turnaround is to use a second pi just for nod-red, but then, i couln't access openmtcprouter's system simply.

Does anyone has an idea on how to deal with such problem on a not so known distro?

ho. yes, and for thoses who didn't catch it yet, i'm a linux newbie :slight_smile:

Thanks a lot for your help!

If you add an mqtt broker inside node-red using node-red-contrib-aedes does it work? If so you can use that to communicate with the Arduino.

Sounds like a good idea, but how will the arduino connect to the pi? Via ethernet?

thanks for your help!

I thought you were trying to run in your openwrt device.

Sorry i might not have express it clearely.

Openmtcprouter is running on a pi4. Where node-red is also up and running.
Now, i would like access to hardware via GPIO from Node-Red. I was able to install the pi GPIO in node-red but could'not access it. I think this is because the python gpio is not there. And i couldn't find pre-compiled packages for openwrt.
So, as a workaround, i tried to connect an Arduino via it's serial (USB) port. Which would make easy to access hardware.

However, i'm also not able to connect to the serial port. When i try, node red crashes due to a segmentation fault.

So it could be a permission access, but at this point i'm only speculating....

Hope it is more clear :sweat_smile:

OK, that was the missing information.

Yes, or wifi. Presumably the pi is acting as a router that the arduino can connect to. If the arduino does not have wifi or ethernet then you could use an ESP device that does.
Before doing that, though, check that you can install the aedes node and can publish and subscribe to it from node-red.

Thanks for your help. Actually the workaround I'll probably use is another pi (zero) instead of an arduino, but it'll serve the same purpose.

Have a nice day!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.