# Node Red on openwrt and serial port

**URL:** <https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837>\
**Category:** General\
**Created:** [14 March 2022 12:09 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837 "2022-03-14T12:09:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![plouc](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@plouc](https://discourse.nodered.org/u/plouc)\
**Post date:** [14 March 2022 12:09 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837/1 "2022-03-14T12:09:20Z")

</div>

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 🙂

Thanks a lot for your help!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 March 2022 13:35 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837/2 "2022-03-14T13:35:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![plouc](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@plouc](https://discourse.nodered.org/u/plouc)\
**Post date:** [14 March 2022 13:48 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837/3 "2022-03-14T13:48:29Z")

</div>

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

thanks for your help!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 March 2022 14:00 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837/4 "2022-03-14T14:00:05Z")

</div>

> [@plouc](#):
>
> how will the arduino connect to the pi

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

---

<div class="post-metadata">

**Author:** ![plouc](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@plouc](https://discourse.nodered.org/u/plouc)\
**Post date:** [14 March 2022 14:10 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837/5 "2022-03-14T14:10:56Z")

</div>

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 😅

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 March 2022 14:15 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837/6 "2022-03-14T14:15:35Z")

</div>

> [@plouc](#):
>
> Openmtcprouter is running on a pi4.

OK, that was the missing information.

> [@plouc](#):
>
> how will the arduino connect to the pi? Via ethernet?

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.

---

<div class="post-metadata">

**Author:** ![plouc](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@plouc](https://discourse.nodered.org/u/plouc)\
**Post date:** [14 March 2022 15:11 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837/7 "2022-03-14T15:11:53Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 May 2022 15:11 UTC](https://discourse.nodered.org/t/node-red-on-openwrt-and-serial-port/59837/8 "2022-05-13T15:11:54Z")

</div>

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