# Segment fault error occurs when deploy node-red-node-serial in openWRT

**URL:** https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842
**Category:** General
**Created:** [13 June 2022 07:16 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842 "2022-06-13T07:16:52Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![vincentlin\_artt](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vincentlin\_artt](https://discourse.nodered.org/u/vincentlin_artt)
#### Post date: [13 June 2022 07:16 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/1 "2022-06-13T07:16:52Z")

</div>

Hi, experts:  
First, I'm new for this forum but loved node-RED very much and used it for education years.  
Here is my environment:

1. raspberry pi cm4(8G/8G) with a motherboard.
2. opwnWRT kernel version:5.10.113
3. version of node.js:16.15.1, npm: 8.11.0
4. install node-RED and node-red-node-serial via:  
4.1 opkg update  
4.2 opkg install node && node-npm  
4.3 npm i -g node-red  
4.4 manage palette \> install \> node-red-node-serial

Everything runs well except I define a serial-port node then deploy it, then segment fault occurs,  
I tried everything as far as I know, still unable to solve it, hope anyone of you can help me.

ps. character device /dev/ttyAMA1 is working fine with minicom connection test, so I thing H/W allocations should be O.K. I also add the permission to it by chmod 777, but it still occur segment fault error.

appreciate in advance!

Vincent

 ![messageImage_1654761844581](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/566c31a73cbb69be4764451ce5a3d1a7824f32bb.jpeg)  
 ![2022-06-13_145550](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/5/05267a0e0ac7d80939b9b50cd2eac28b5ce122fe.jpeg)  
 ![2022-06-13_150400](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/f/1fc162b82e062a40c6889a12ae913101609ef5cc.jpeg)

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [13 June 2022 08:14 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/2 "2022-06-13T08:14:00Z")

</div>

I guess the serialport binaries are not correct... can you go into the /root/.node-red directory and run `npm rebuild` and see if that is successful

---

<div class="post-metadata">

### Author: ![vincentlin\_artt](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vincentlin\_artt](https://discourse.nodered.org/u/vincentlin_artt)
#### Post date: [13 June 2022 08:22 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/3 "2022-06-13T08:22:36Z")

</div>

Thanks, dceejay:  
I did, same error occurs.

 ![2022-06-13_162002](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d6cf5f944717e3f6345002284392fde97dca2dce.jpeg)

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [13 June 2022 09:23 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/4 "2022-06-13T09:23:42Z")

</div>

I would have expected some output from the rebuild... can you try `npm rebuild node-red-node-serialport --verbose` ?

or maybe

```auto
cd .node-red
npm uninstall node-red-node-serialport
npm install node-red-node-serialport --build-from-source

```

---

<div class="post-metadata">

### Author: ![vincentlin\_artt](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vincentlin\_artt](https://discourse.nodered.org/u/vincentlin_artt)
#### Post date: [14 June 2022 00:59 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/5 "2022-06-14T00:59:37Z")

</div>

hi, dceejay:  
Here is my result:

1. npm rebuild node-red-node-serialport --verbose  
--\> build result: OK and Situation is same, segmentation fault.

2. npm uninstall node-red-node-serialport  
npm install node-red-node-serialport --build-from-source  
--\> lots of error came out, attached files are the rebuild logs for those 2 commands.

Please have a look, appreciate again.

 ![2022-06-14_084110](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/9/a9a81a47acce2783d8d28509055538e1cc237691.jpeg)

 ![2022-06-14_083637](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/7/b77ea373b2be7f211896bf8e00d037e8c0fea1d4.jpeg)

[build-from-source-erros.log](https://discourse.nodered.org/uploads/short-url/4uY5WgyShZAIWk07aItNznvuAuS.log) (17.5 KB)  
[rebuild-OK.log](https://discourse.nodered.org/uploads/short-url/2sUvNRM73UkBelAZs6HLtoRLa4d.log) (9.1 KB)

---

<div class="post-metadata">

### Author: ![vincentlin\_artt](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vincentlin\_artt](https://discourse.nodered.org/u/vincentlin_artt)
#### Post date: [14 June 2022 02:08 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/6 "2022-06-14T02:08:05Z")

</div>

> [@vincentlin\_artt](#):
>
> npm install node-red-node-serialport --build-from-source

Hi, Sir:  
I updated python tp 3.10.4 and do npm install node-red-node-serialport --build-from-source again,  
still not success and came out errors, log is as attached.  
Please have a look.  
thanks again.

 ![2022-06-14_100142](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cf1eadfe24af61041306acf45978ebcf2bb2ea29.jpeg)  
[updated-python-build-from-source-error.log](https://discourse.nodered.org/uploads/short-url/2kkAaEvOjW0rSvnZfL5uGq6LhzP.log) (17.4 KB)

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [14 June 2022 06:50 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/7 "2022-06-14T06:50:57Z")

</div>

Right so you also need the rest of the build tools. Usually gcc and make. There is probably a package that includes them all for openwrt , you can remove them once we get this to work if you need the space back.

---

<div class="post-metadata">

### Author: ![vincentlin\_artt](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vincentlin\_artt](https://discourse.nodered.org/u/vincentlin_artt)
#### Post date: [14 June 2022 09:39 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/8 "2022-06-14T09:39:17Z")

</div>

dear dceejay sir:  
I'v tried my best to install the required package for openwrt, there was some progresses, however, there is still errors (  
npm ERR! code 1  
npm ERR! path /root/.node-red/node\_modules/@serialport/bindings-cpp  
.......  
)  
so I can't finish the rebuild process, may you take a look and help...  
regards,  
Vincent

 ![2022-06-14_173226](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/8/c8f3bcdfdabf225468f50f40624664d2d22390c5.jpeg)  
 ![2022-06-14_173237](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c746bb5e9fab55ad0e9a226df8b1f0504a1f904c.jpeg)  
 ![2022-06-14_173250](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/1/01bd25aae4ca5e401ca66d05449788fbb2e12220.jpeg)  
[2022-06-14T09\_26\_46\_327Z-debug-0.log|attachment]  
 ![2022-06-14_173307](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/8/c897d79192773ed1b27b2bba6f8b532b39ebbddd.jpeg)  
(upload://vWLA3FHw3ydxHUUly4446updNLR.log) (32.0 KB)

---

<div class="post-metadata">

### Author: ![vincentlin\_artt](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vincentlin\_artt](https://discourse.nodered.org/u/vincentlin_artt)
#### Post date: [14 June 2022 10:03 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/9 "2022-06-14T10:03:11Z")

</div>

> [@vincentlin\_artt](#):
>
> npm install node-red-node-serialport --build-from-source

Hi, Sir:  
I finally finish npm install node-red-node-serialport --build-from-source process and complete from the message.  
But ....  
How come segmentation fault still happens....  
Any idea or hint is much helpful  
Vincent

 ![2022-06-14_175857](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e70d8042078a08a3bd96d2d4317117c8d58a474b.jpeg)  
 ![2022-06-14_180413](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c7e10d6f85a54a960e7dc911db68895c3e168186.jpeg)

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [14 June 2022 11:03 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/10 "2022-06-14T11:03:36Z")

</div>

the make command seemed to say it couldn't find libpthread - is that installed ?  
but yes - you are into territory I have not explored so not sure how I can help much more.

---

<div class="post-metadata">

### Author: ![vincentlin\_artt](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vincentlin\_artt](https://discourse.nodered.org/u/vincentlin_artt)
#### Post date: [15 June 2022 00:49 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/11 "2022-06-15T00:49:47Z")

</div>

Dear Dceeja:  
Many many thanks anyway.  
Vincent

---

<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: [14 August 2022 00:49 UTC](https://discourse.nodered.org/t/segment-fault-error-occurs-when-deploy-node-red-node-serial-in-openwrt/63842/12 "2022-08-14T00:49:57Z")

</div>

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