# Cant read or write with modbus nodes to two diffrent devices

**URL:** <https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719>\
**Category:** General\
**Tags:** modbus\
**Created:** [17 May 2022 04:59 UTC](https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719 "2022-05-17T04:59:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SP-Mushrooms](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sp-mushrooms/32/61710_2.png) [@SP-Mushrooms](https://discourse.nodered.org/u/SP-Mushrooms)\
**Post date:** [17 May 2022 04:59 UTC](https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719/1 "2022-05-17T04:59:05Z")

</div>

I am using 2 jetson nano connected via wire using modebus serial trying to write and read data  
I am using node red 11.1.1 and the module is node-red-contrib-modbus  
I am new to node red only starting this week

this is my modbus Write flow

```auto
[{"id":"89369c2bcbeb76ca","type":"debug","z":"57325149c5ebdbcc","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":690,"y":1100,"wires":[]},{"id":"acefe3edeaaea469","type":"inject","z":"57325149c5ebdbcc","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[0,0,0,1,1,1]","payloadType":"json","x":90,"y":1080,"wires":[["5d070261787e3b4f"]]},{"id":"5d070261787e3b4f","type":"function","z":"57325149c5ebdbcc","name":"","func":"\n\n\nmsg.payload ={ value: msg.payload,\n 'fc': 5,\n 'unitid': 1,\n 'address': 0 ,\n 'quantity': 6 }\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":1120,"wires":[["c77cda57d306495e"]]},{"id":"c77cda57d306495e","type":"modbus-flex-write","z":"57325149c5ebdbcc","name":"","showStatusActivities":true,"showErrors":true,"server":"64e234ec8ad4b896","emptyMsgOnFail":false,"keepMsgProperties":false,"x":490,"y":1120,"wires":[["89369c2bcbeb76ca"],["0792493db10c2906"]]},{"id":"0792493db10c2906","type":"modbus-response","z":"57325149c5ebdbcc","name":"","registerShowMax":20,"x":710,"y":1180,"wires":[]},{"id":"64e234ec8ad4b896","type":"modbus-client","name":"RS485-1","clienttype":"simpleser","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU","serialBaudrate":"4800","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":"1","commandDelay":"200","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

```

And my modbus Read flow

```auto
[{"id":"040f3f841721c8e4","type":"inject","z":"f9741d2194372498","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":440,"wires":[["bc141855739a4d1a"]]},{"id":"bc141855739a4d1a","type":"function","z":"f9741d2194372498","name":"","func":"msg.payload = { \n'fc': 3, 'unitid': 1, 'address': 0 , \n'quantity': 6 } ;\nreturn msg\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":560,"wires":[["ca1fd0284d866462"]]},{"id":"ca1fd0284d866462","type":"modbus-flex-getter","z":"f9741d2194372498","name":"","showStatusActivities":true,"showErrors":true,"logIOActivities":false,"server":"64e234ec8ad4b896","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"keepMsgProperties":false,"x":410,"y":440,"wires":[["e64761381089d6d6"],["8f251f22d86c7791"]]},{"id":"8f251f22d86c7791","type":"modbus-response","z":"f9741d2194372498","name":"","registerShowMax":20,"x":530,"y":560,"wires":[]},{"id":"e64761381089d6d6","type":"debug","z":"f9741d2194372498","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":360,"wires":[]},{"id":"64e234ec8ad4b896","type":"modbus-client","name":"RS485-1","clienttype":"simpleser","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU","serialBaudrate":"4800","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":"1","commandDelay":"200","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

```

the errors I get for write is

msg : error  
"Error: Client Not Ready To Write At State init"

msg : string[60]  
"Modbus Failure On State sending Get More About It By Logging"

msg : TransactionTimedOutError  
"TransactionTimedOutError: Timed out"

And for read the errors are

msg : string[60]  
"Modbus Failure On State sending Get More About It By Logging"

msg : error  
"Error: Timed out"

msg : error  
"Error: Client Not Ready To Read At State init"

---

<div class="post-metadata">

**Author:** ![Brummer](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Brummer](https://discourse.nodered.org/u/Brummer)\
**Post date:** [24 May 2022 18:37 UTC](https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719/2 "2022-05-24T18:37:15Z")

</div>

Have you found a solution to your problem ?  
I have exactly the same.  
Unfortunately I do not know how to debug this

---

<div class="post-metadata">

**Author:** ![SP-Mushrooms](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sp-mushrooms/32/61710_2.png) [@SP-Mushrooms](https://discourse.nodered.org/u/SP-Mushrooms)\
**Post date:** [25 May 2022 00:33 UTC](https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719/3 "2022-05-25T00:33:04Z")

</div>

Nope I haven't found a solution

---

<div class="post-metadata">

**Author:** ![Brummer](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Brummer](https://discourse.nodered.org/u/Brummer)\
**Post date:** [28 May 2022 19:27 UTC](https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719/4 "2022-05-28T19:27:04Z")

</div>

Sorry I missed someting

---

<div class="post-metadata">

**Author:** ![SP-Mushrooms](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sp-mushrooms/32/61710_2.png) [@SP-Mushrooms](https://discourse.nodered.org/u/SP-Mushrooms)\
**Post date:** [1 June 2022 02:13 UTC](https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719/5 "2022-06-01T02:13:22Z")

</div>

? what do you mean by you miss something

---

<div class="post-metadata">

**Author:** ![Brummer](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Brummer](https://discourse.nodered.org/u/Brummer)\
**Post date:** [1 June 2022 06:56 UTC](https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719/6 "2022-06-01T06:56:12Z")

</div>

Sorry if I have confused you.  
I thought I had found a solution but that was a mistake and I deleted my post.  
I have now chosen another solution for me and use two independent Modbus interfaces.  
This is certainly completely contrary to the property of a Modbus system but after over 3 weeks of trial and error I have given up because this solution solves my case.  
I wish you good luck with your project and please let me know if you succeed.

---

<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:** [31 July 2022 06:56 UTC](https://discourse.nodered.org/t/cant-read-or-write-with-modbus-nodes-to-two-diffrent-devices/62719/7 "2022-07-31T06:56:28Z")

</div>

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