# Can connect to Modbus RTU slave with Modbus-serial but not the Modbus Package

**URL:** <https://discourse.nodered.org/t/can-connect-to-modbus-rtu-slave-with-modbus-serial-but-not-the-modbus-package/42458>\
**Category:** General\
**Created:** [11 March 2021 09:38 UTC](https://discourse.nodered.org/t/can-connect-to-modbus-rtu-slave-with-modbus-serial-but-not-the-modbus-package/42458 "2021-03-11T09:38:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tproulund](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tproulund/32/38643_2.png) [@tproulund](https://discourse.nodered.org/u/tproulund)\
**Post date:** [11 March 2021 09:38 UTC](https://discourse.nodered.org/t/can-connect-to-modbus-rtu-slave-with-modbus-serial-but-not-the-modbus-package/42458/1 "2021-03-11T09:38:51Z")

</div>

Hi Everyone

I am using node red to connect to a Pump that uses Modbus RTU with Node-Red hosted on a RPI 3, using this dongle [1PCS USB to RS485 Converter Adapter Support Win7 XP Vista Linux Mac OS WinCE5.0 RS 485 RS 485|Integrated Circuits| - AliExpress](https://www.aliexpress.com/item/33050881882.html?spm=a2g0s.9042311.0.0.331b4c4dEgFFgq)

Now i am having a weird issue. Previously I was using Modbus TCP and built everything with the node-red-contrib-modbus package and that was working perfect, but because some other components doesnt support TCP, I wanted to switch to RTU

Now the weird thing is, that I cant get the mobus-read to work with serial, but I tried the package node-red-contrib-serial-modbus and with the modbusserial-in node, I can connect and read the data from my pump RTU slave

The settings between the two different readers are exactly the same and I made sure i only have 1 of them enabled at the time, so they shouldnt be conflicting.  
I dont understand where the issue lies. I was hoping to be able to use the nodes from node-red-contrib-modbus as they are quite a lot easier to work with

Does anyone have any suggestions to what might be the issue ? ive attached the configuration of the two different modbus read nodes

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/f/afdc8a463bd556818c081790b8716b3eb92cdc8b.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d0c06ac66d4069397df9922767e2d38abbb16546.png)

```auto
[{"id":"428a274d.88c1c8","type":"modbus-read","z":"dff53b0e.d3f2c8","d":true,"name":"tset","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"17","dataType":"HoldingRegister","adr":"201","quantity":"1","rate":"2","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"8d98f278.e2031","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":850,"y":260,"wires":[["52a5fa72.b2bd14"],[]]},{"id":"3a692e41.abbab2","type":"modbusSerial in","z":"dff53b0e.d3f2c8","d":true,"port":"dc91bdb8.4b38e","slaves":"17","start":"201","count":"1","dtype":"holding","period":"2","topic":"","name":"","x":1340,"y":280,"wires":[["f0c8c03e.514e3","f4d6a2c3.a26e8"]]},{"id":"8d98f278.e2031","type":"modbus-client","z":"","name":"test","clienttype":"serial","bufferCommands":false,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU","serialBaudrate":"19200","serialDatabits":"8","serialStopbits":"1","serialParity":"even","serialConnectionDelay":"500","unit_id":"17","commandDelay":"1","clientTimeout":"5000","reconnectOnTimeout":true,"reconnectTimeout":"1000","parallelUnitIdsAllowed":true},{"id":"dc91bdb8.4b38e","type":"modbusSerialConfig","z":"","port":"/dev/ttyUSB0","baud":"19200","data":"8","parity":"even","stop":"1","name":"test magna"}]

```

---

<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:** [11 March 2021 10:01 UTC](https://discourse.nodered.org/t/can-connect-to-modbus-rtu-slave-with-modbus-serial-but-not-the-modbus-package/42458/2 "2021-03-11T10:01:42Z")

</div>

have you tried deleting the serial node (AND the serial config node) then deploy, then re-starting node-red to be sure nothing is holding onto the connection?

---

<div class="post-metadata">

**Author:** ![tproulund](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tproulund/32/38643_2.png) [@tproulund](https://discourse.nodered.org/u/tproulund)\
**Post date:** [12 March 2021 05:58 UTC](https://discourse.nodered.org/t/can-connect-to-modbus-rtu-slave-with-modbus-serial-but-not-the-modbus-package/42458/3 "2021-03-12T05:58:15Z")

</div>

Thank you so much for the tip ! i just tried deleting all serial profiles, restart node red and then it worked ! no idea that could be an issue but easy fix !

---

<div class="post-metadata">

**Author:** ![tproulund](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tproulund/32/38643_2.png) [@tproulund](https://discourse.nodered.org/u/tproulund)\
**Post date:** [12 March 2021 08:09 UTC](https://discourse.nodered.org/t/can-connect-to-modbus-rtu-slave-with-modbus-serial-but-not-the-modbus-package/42458/4 "2021-03-12T08:09:20Z")

</div>

Hmm now i am seeing something weird though. when i use FC3 to read 1 - 12 addresses everything works fine, but when I go above that, i stop receiving the answer back from the modbus slave

i can see that the msg is recieved fine on the slave device, i just dont get any data back

I tried reading the 62 addresses in one go with the modbusread-serial node, and that one works fine

would it be better to use the flex read and then read the needed 62 addresses piece by piece ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a3b62cf469e22f885687a649033898290346afcf.png)

---

<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:** [12 March 2021 09:06 UTC](https://discourse.nodered.org/t/can-connect-to-modbus-rtu-slave-with-modbus-serial-but-not-the-modbus-package/42458/5 "2021-03-12T09:06:56Z")

</div>

> [@tproulund](#):
>
> would it be better to use the flex read and then read the needed 62 addresses piece by piece

That is always the worst way (as you end up with inconsistent data)

I would raise an issue on the repository (might be a bug / or the author might be able to explain it)

---

<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:** [26 March 2021 09:07 UTC](https://discourse.nodered.org/t/can-connect-to-modbus-rtu-slave-with-modbus-serial-but-not-the-modbus-package/42458/6 "2021-03-26T09:07:04Z")

</div>

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