# Serial on Raspberry PI3B+ don't work

**URL:** https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647
**Category:** General
**Tags:** docker
**Created:** [18 February 2024 16:24 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647 "2024-02-18T16:24:34Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![golfy44](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/golfy44/32/88406_2.png) [@golfy44](https://discourse.nodered.org/u/golfy44)
#### Post date: [18 February 2024 16:24 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/1 "2024-02-18T16:24:34Z")

</div>

Hello everyone,

after some hours to try everything I found on forum I'm finished to create this topic.  
I try to send a string through the serial port of my Raspberry PI3B+ with node-red.

Even I don't hace the correct sentence on the receiver (just a configuration), it works with the simple bash command : echo "Hello" \> /dev/ttyAMA0. It works too with /dev/serial0 then the configuiration is OK.

I added a inject node with "hello" and a serial out node to serrial port.  
I tried with /dev/serial0 without error but not the slightest character on the receiver.  
And with /dev/ttyAMA0 it crashes node-red. Need to delete the node in flows.json file and reboot.

I tried with serial control node and it seems to work: no error and node "connected" with the right parameters.  
All other development works fine.

Is someone can help me please?

Thanks a lot.

PS : installation in docker with following version  
debian 10 (buster)  
node-red 3.1.5  
node-red-node-serialport 2.0.2  
rebuild --build-from-source done too.

---

<div class="post-metadata">

### Author: ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)
#### Post date: [18 February 2024 20:50 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/2 "2024-02-18T20:50:10Z")

</div>

Hi, Welcome to the forum.

Have a look at this topic,

> [@Reading from serial. Works in sample-js file, but when running in node-red serial port gets closed](https://discourse.nodered.org/t/reading-from-serial-works-in-sample-js-file-but-when-running-in-node-red-serial-port-gets-closed/36347/10):
>
> Not clear what pi you are using, however have a look at this.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [18 February 2024 20:59 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/3 "2024-02-18T20:59:57Z")

</div>

As you are using Docker, have you enabled the serial port in your Docker environment?

> **[docker serial port at DuckDuckGo](https://duckduckgo.com/?q=docker%2Bserial%2Bport&t=vivaldi&ia=web)**
>
> DuckDuckGo. Privacy, Simplified.

---

<div class="post-metadata">

### Author: ![golfy44](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/golfy44/32/88406_2.png) [@golfy44](https://discourse.nodered.org/u/golfy44)
#### Post date: [23 February 2024 09:42 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/4 "2024-02-23T09:42:11Z")

</div>

Hello,  
thanks a lot for your response, i try this this weekend and will give you a feedback.

Regards

---

<div class="post-metadata">

### Author: ![golfy44](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/golfy44/32/88406_2.png) [@golfy44](https://discourse.nodered.org/u/golfy44)
#### Post date: [23 February 2024 11:01 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/5 "2024-02-23T11:01:23Z")

</div>

Finally, I found some minutes to test your proposition.

I enable the serial port in docker.  
The result is no crash of node-red when i inject a string in "serial out". Good evolution.

But,

- the command echo "hello" \> /dev/serial0 is already OK : data received
- the injection of "hello" in "serial out" node in node-red is NOK : no data received

Other ideas?

Thanks.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [23 February 2024 12:21 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/6 "2024-02-23T12:21:17Z")

</div>

You might need to check the node settings to make sure they match the actual settings of the serial port.

Also, I'm surprised that worked because I'd expect Node-RED to have locked access to the port. Though I'm not 100% sure to be honest.

Have you checked in the `dmesg` log to see if there is an error? Also, have you checked the Node-RED startup log for an error?

---

<div class="post-metadata">

### Author: ![golfy44](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/golfy44/32/88406_2.png) [@golfy44](https://discourse.nodered.org/u/golfy44)
#### Post date: [23 February 2024 15:01 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/7 "2024-02-23T15:01:44Z")

</div>

all settings checked.  
No message in dmesg.  
No message in node red console (just inject successfully on top)  
How can I access to node-red log please?

---

<div class="post-metadata">

### Author: ![golfy44](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/golfy44/32/88406_2.png) [@golfy44](https://discourse.nodered.org/u/golfy44)
#### Post date: [23 February 2024 15:37 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/8 "2024-02-23T15:37:10Z")

</div>

I don't have the "Connected" at the bottom of the node "serial out" but it appears on the "config" node.

---

<div class="post-metadata">

### Author: ![golfy44](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/golfy44/32/88406_2.png) [@golfy44](https://discourse.nodered.org/u/golfy44)
#### Post date: [23 February 2024 16:16 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/9 "2024-02-23T16:16:14Z")

</div>

Sorry, the ttyAMA0 doesn't work... even after @TotallyInformation proposal to enable serial port in docker.  
I don't know how verify the serial port is really enable.

---

<div class="post-metadata">

### Author: ![golfy44](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/golfy44/32/88406_2.png) [@golfy44](https://discourse.nodered.org/u/golfy44)
#### Post date: [23 February 2024 16:38 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/10 "2024-02-23T16:38:00Z")

</div>

Hello,

I found the solution there: [https://community.gladysassistant.com/t/node-red-mise-a-jour-de-la-palette-node-red-node-serialport-1-0-1-fait-planter-le-docker-node-red/7154/18](https://community.gladysassistant.com/t/node-red-mise-a-jour-de-la-palette-node-red-node-serialport-1-0-1-fait-planter-le-docker-node-red/7154/18)

It's in French but the solution is just to rebuild the node-red-node-serialport.  
It doesn't work with the initial build.

sorry for disturbing you  
have a nice day

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [23 February 2024 17:37 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/11 "2024-02-23T17:37:03Z")

</div>

> [@golfy44](#):
>
> It's in French but the solution is just to rebuild the node-red-node-serialport.  
> It doesn't work with the initial build.

Serial requires a compiled C/C++ component. In keeping with all Node.js apps that interface with C/C++ components, when changing major versions of Node.js, you should rebuild the dependencies with `npm rebuild` or bad-things™️ will happen.

So do remember to do that when node.js major versions change. Other nodes of similar ilk will be SQLite, bluetooth, and quite a number of others. Safest simply to build rebuilds into your process when you upgrade to a new major version of Node.JS.

---

<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: [23 May 2024 17:37 UTC](https://discourse.nodered.org/t/serial-on-raspberry-pi3b-dont-work/85647/12 "2024-05-23T17:37:40Z")

</div>

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