# Modbus RTU node red UART issue

**URL:** <https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866>\
**Category:** General\
**Created:** [28 February 2023 08:47 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866 "2023-02-28T08:47:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![DSongra11\_forum.com](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@DSongra11\_forum.com](https://discourse.nodered.org/u/DSongra11_forum.com)\
**Post date:** [28 February 2023 08:47 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/1 "2023-02-28T08:47:02Z")

</div>

Hello,

I am working on Modbus RTU Serial UART node-red flow application. I am facing an issue after deploying the flow, the node-red application gets crashes and does not start back again.

I have checked my IIOT device serial physical connection and verified it using serial port node  
"npm install node-red-node-serialport@0.15.0" with an older version and it is working, but the issue is with the Modbus UART interface.

Please guide me.

Br,  
Devendra

---

<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:** [28 February 2023 08:59 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/2 "2023-02-28T08:59:36Z")

</div>

Show us what error you get when you try to restart it. Also tell us what hardware an OS you are running on, what version of node-red and what version of nodejs.

---

<div class="post-metadata">

**Author:** ![DSongra11\_forum.com](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@DSongra11\_forum.com](https://discourse.nodered.org/u/DSongra11_forum.com)\
**Post date:** [28 February 2023 09:50 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/3 "2023-02-28T09:50:09Z")

</div>

Hello,

**Log** for node-red after restarting.

 ![Log](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/4698f74088dda6e5a7b9b62054921252102c5748.png)

**Hardware OS -** Linux.

**Node red version** - V3.0.2

**Node.js Version** - V16.16.0

Br,  
Devendra

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [28 February 2023 10:26 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/4 "2023-02-28T10:26:51Z")

</div>

The segmentation fault is likely due to binary incompatibilities between your compiled binaries and the libraries they are linked against.

My guess is you updated node-js?

You likely need to `npm rebuild` everything (or just remove and re-install the modbus and serial nodes - which will cause them to be recompiled)

---

<div class="post-metadata">

**Author:** ![DSongra11\_forum.com](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@DSongra11\_forum.com](https://discourse.nodered.org/u/DSongra11_forum.com)\
**Post date:** [1 March 2023 04:56 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/5 "2023-03-01T04:56:54Z")

</div>

Hello Steve,

I have not updated node-js, whatever version is available on node-red I just installed it.

I have removed the Modbus node and after node-red gets started but after adding the Modbus node node-red & deploying settings node-red gets stopped again the same issue repeats.

Br,  
Devendra

---

<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:** [1 March 2023 10:06 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/6 "2023-03-01T10:06:03Z")

</div>

What hardware and OS are you running on, and how did you install node red and nodejs? I notice nodejs is in /usr/local/bin which is unusual.

---

<div class="post-metadata">

**Author:** ![DSongra11\_forum.com](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@DSongra11\_forum.com](https://discourse.nodered.org/u/DSongra11_forum.com)\
**Post date:** [1 March 2023 10:25 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/7 "2023-03-01T10:25:54Z")

</div>

Hello Colin,

Please find below details.

Hardware - Hilscher make NFX8M-D2-N32-010 IIOT Gateway - [Hilscher: NFX8M-D2-N32-010–netFIELD Compact X8M - Edge Gateway with remote management option](https://www.hilscher.com/products/edge-gateways/nfx8m-d2-n32-010)

OS - Linux (netFIELD OS V2.3.0.4) - Kernel 5.4.117-yocto-standard+

I have installed a node-red application using the docker container into this Hilscher IIOT Gateway.

Br,  
Devendra

---

<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:** [1 March 2023 10:51 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/8 "2023-03-01T10:51:59Z")

</div>

I don't understand, if node-red is a Docker install, how is it being started using /usr/local/bin/node? However, my knowledge of Docker is limited, so I will have to leave this to someone else to help.

---

<div class="post-metadata">

**Author:** ![DSongra11\_forum.com](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@DSongra11\_forum.com](https://discourse.nodered.org/u/DSongra11_forum.com)\
**Post date:** [1 March 2023 11:02 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/9 "2023-03-01T11:02:22Z")

</div>

Hello Colin,

Basically, Node-red is perfectly running my Modbus TCP node is also working perfectly, but the only issue is with the Serial UART interface. I have seen this kind of issue many developers are facing, with this same error/problem.

you can refer this kind of issue - [Segment fault error occurs when deploy node-red-node-serial in openWRT](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842)

> <https://github.com/serialport/node-serialport/issues/2438>
>
> \### SerialPort Version
> 
> 10.3.0
> 
> \### Node Version
> 
> v14.19.0
> 
> \### Electron Version…
> 
> \_No response\_
> 
> \### Platform
> 
> Linux raspberrypi 5.10.92-v7+ #1514 SMP Mon Jan 17 17:36:39 GMT 2022 armv7l GNU/Linux
> 
> \### Architecture
> 
> ARM
> 
> \### Hardware or chipset of serialport
> 
> QinHeng Electronics CH340
> 
> \### What steps will reproduce the bug?
> 
> I've created a repository at https://github.com/avakarev/serialport-docker-rpi to reproduce the issue.
> 
> Clone it and then:
> 
> \`make run-v9 # v9.2.8 on rpi\`
> 
> Using serialport ^9.2.8
> serialport/stream opening path: /dev/ttyUSB0 +0ms
> serialport/binding-abstract open +0ms
> serialport/bindings/poller Creating poller +0ms
> serialport/stream opened path: /dev/ttyUSB0 +10ms
> port successfully opened
> 
> \`make docker-run-v9 # v9.2.8 on rpi in docker container\`
> 
> Using serialport ^9.2.8
> 2022-02-23T17:19:07.255Z serialport/stream opening path: /dev/ttyUSB0
> 2022-02-23T17:19:07.256Z serialport/binding-abstract open
> 2022-02-23T17:19:07.266Z serialport/bindings/poller Creating poller
> 2022-02-23T17:19:07.267Z serialport/stream opened path: /dev/ttyUSB0
> port successfully opened
> 
> \`make run-v10 # v10.3.0 on rpi\`
> 
> Using serialport ^10.3.0
> serialport/stream opening path: /dev/ttyUSB0 +0ms
> serialport/bindings-cpp open +0ms
> serialport/bindings-cpp/poller Creating poller +0ms
> serialport/stream opened path: /dev/ttyUSB0 +11ms
> port successfully opened
> 
> \`make docker-run-v10 # v10.3.0 on rpi in docker container\`
> 
> Using serialport ^10.3.0
> 2022-02-23T17:20:48.142Z serialport/stream opening path: /dev/ttyUSB0
> 2022-02-23T17:20:48.144Z serialport/bindings-cpp open
> make\[1\]: \*\*\* \[Makefile:8: \_docker\_run\] Error 139
> 
> \### What happens?
> 
> \`serialport\` exits with 139 and have no stacktrace despite \`DEBUG=serialport\*\`
> 
> \### What should have happened?
> 
> \`serialport\` should successfully open given port
> 
> \### Additional information
> 
> The alpine base image v12 used in demo repo is kinda outdated, but same behavior is met with alpine v14 and v15
> 
> Original discussion started at https://github.com/Koenkk/zigbee2mqtt/issues/11545

for this, I am able to use a Simple Serial interface node node-red-node-serialport@0.15.0 version, without any issue. But my problem is with Modbus RTU serial UART node i am facing this issue.

In case you need any further information from my side please let me know.

Br,  
Devendra

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [1 March 2023 11:46 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/10 "2023-03-01T11:46:14Z")

</div>

Can you identify exactly which modbus contrib node you are using: [Library - Node-RED](https://flows.nodered.org/search?term=Modbus&type=node)

---

<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:** [1 March 2023 11:48 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/11 "2023-03-01T11:48:23Z")

</div>

I don't think that 'many' developers have seen the problem, but it does appear that you are not alone.

Well if @dceejay was not able to help diagnose the problem then I am sorry to say that I will be of little help, as Dave is the Docker expert. Possibly he will be able to help further since we are a year further on than the issue you linked to.

---

<div class="post-metadata">

**Author:** ![DSongra11\_forum.com](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@DSongra11\_forum.com](https://discourse.nodered.org/u/DSongra11_forum.com)\
**Post date:** [2 March 2023 04:59 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/12 "2023-03-02T04:59:57Z")

</div>

Hello Steve,

I am using "node-red-contrib-modbus" node in that Modbus Read node.

Br,  
Devendra

---

<div class="post-metadata">

**Author:** ![DSongra11\_forum.com](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@DSongra11\_forum.com](https://discourse.nodered.org/u/DSongra11_forum.com)\
**Post date:** [6 March 2023 06:38 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/13 "2023-03-06T06:38:32Z")

</div>

Hello,

I am waiting for solution, please help me on this issue.

Br,  
Devendra

---

<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:** [5 May 2023 06:38 UTC](https://discourse.nodered.org/t/modbus-rtu-node-red-uart-issue/75866/14 "2023-05-05T06:38:41Z")

</div>

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