# Issue to read serial port

**URL:** https://discourse.nodered.org/t/issue-to-read-serial-port/32590
**Category:** General
**Created:** [8 September 2020 12:55 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590 "2020-09-08T12:55:21Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![lowlow](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@lowlow](https://discourse.nodered.org/u/lowlow)
#### Post date: [8 September 2020 12:55 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590/1 "2020-09-08T12:55:21Z")

</div>

I'm interfacing a Kern weight scale through serial port with Node-RED. The communication works perfectly in a terminal in both direction.  
However, I'm only able to write to the serial port with NR with the "serial out" and "serial request" node but I wasn't successful to get any answer form it with either "serial in" or "serial request" nodes.

For example, when I monitor my serial device with "cat /dev/ttyUSB0" in a terminal while sending a message from NR, I get an answer in the terminal but nothing from within NR, "serial request" node goes in timeout and "serial in" remains mute ...

What am I missing ?

nodejs: 12.18.3  
node red: v1.1.3  
node-red-node-serialport: 0.11

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e09a31d88deb12607166889a9f3dd5fa69f614ac.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b91ab735aca18c96970b637eaeee080037daa036.png)

---

<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: [8 September 2020 13:14 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590/2 "2020-09-08T13:14:46Z")

</div>

I am not sure whether it would give that symptom, but perhaps the sequence \r\n does not appear in the stream. Have you tried other options there, specify a timeout for example, or fixed lengths with a short count.

---

<div class="post-metadata">

### Author: ![lowlow](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@lowlow](https://discourse.nodered.org/u/lowlow)
#### Post date: [8 September 2020 13:27 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590/3 "2020-09-08T13:27:55Z")

</div>

I've tried these 2 additional options to configure the "input":

- split the input into fixed length
- and set a timeout  
but I neither get any answer from the serial port in NR.

---

<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: [8 September 2020 18:13 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590/4 "2020-09-08T18:13:34Z")

</div>

What did typed in in the terminal that worked?  
Also IO as string?

Do you have a link to the manual from that scale with protocol description.

---

<div class="post-metadata">

### Author: ![lowlow](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@lowlow](https://discourse.nodered.org/u/lowlow)
#### Post date: [8 September 2020 18:47 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590/5 "2020-09-08T18:47:37Z")

</div>

There is a list of command as indicated here: [https://dok.kern-sohn.com/manuals/files/English/KCP-ZB-e-v1.3.7.pdf](https://dok.kern-sohn.com/manuals/files/English/KCP-ZB-e-v1.3.7.pdf)

I0 is one of these commands that lists the available commands on the device. Commands and answers are ASCII string and end with CRLF.

In a terminal with "picocom --flow n -c --omap crcrlf /dev/ttyUSB0", communication is working fine.

The "serial out" works fine, if I trigger a command with it, I can "cat" the answer from /dev/ttyUSB0 but get nothing from the "out" node.

---

<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: [8 September 2020 20:17 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590/6 "2020-09-08T20:17:02Z")

</div>

Can you ensure that only one thing is trying to access the port at one time. You probably can’t share serialport with node-red and picocom st the same time. And indeed maybe even out and request nodes

---

<div class="post-metadata">

### Author: ![lowlow](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@lowlow](https://discourse.nodered.org/u/lowlow)
#### Post date: [9 September 2020 07:00 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590/7 "2020-09-09T07:00:26Z")

</div>

Thanks for the hint ! That was it !  
I've clean up my flow and kept only a single "request" node and killed any other process accessing the port.  
After deploying and restarting the flows, it finally captures inbound data from the serial port within NR.

THANKS !

---

<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 September 2020 07:00 UTC](https://discourse.nodered.org/t/issue-to-read-serial-port/32590/8 "2020-09-23T07:00:26Z")

</div>

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