# Newbie - modbus tcp server socket error

**URL:** https://discourse.nodered.org/t/newbie-modbus-tcp-server-socket-error/19484
**Category:** General
**Created:** [22 December 2019 22:48 UTC](https://discourse.nodered.org/t/newbie-modbus-tcp-server-socket-error/19484 "2019-12-22T22:48:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![PPz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ppz/32/15429_2.png) [@PPz](https://discourse.nodered.org/u/PPz)
#### Post date: [22 December 2019 22:48 UTC](https://discourse.nodered.org/t/newbie-modbus-tcp-server-socket-error/19484/1 "2019-12-22T22:48:03Z")

</div>

I'm really new into node-red.  
I installed the program and the add-ons for modbus tcp.  
I config my server master (Tbox/servelec) with its IP address: OK  
I defined some readings: int16 block of 10 consecutive addresses, some single float registers with their conversion function, etc : OK

OK in fact when I poll every 15 seconds, my polls are working and the results are displayed as expected. But this it too fast, I don't need those fast readings (temperature mostly).

When I lower the polls to 1 per 15 minutes, I obtain a socket error / econnrefused. If I change the poll for 1 per 15 seconds and restart the flows, all is OK again.

Question 2: When my polls are OK (1 per 15 sec), when I try to add a node with another modbus unit (also TCP, different IP address), same problem.  
Maybe a network problem or some unknown (to me) collisions ?

Thank you for your help

 ![15 secs polls ok](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7ed19d8c4d25e85bedd41ed0c333a8a403058a5c.jpeg)

![socket error](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2f67616779321fb004d69f35b8c89a2d88d8d8d2.jpeg)

---

<div class="post-metadata">

### Author: ![diptiprakashpalai](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diptiprakashpalai/32/33277_2.png) [@diptiprakashpalai](https://discourse.nodered.org/u/diptiprakashpalai)
#### Post date: [8 December 2020 09:43 UTC](https://discourse.nodered.org/t/newbie-modbus-tcp-server-socket-error/19484/2 "2020-12-08T09:43:07Z")

</div>

Same error I am also having with Modbus TCP communication. Did you solve it? Please let me know. Thanks in advance.

---

<div class="post-metadata">

### Author: ![PPz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ppz/32/15429_2.png) [@PPz](https://discourse.nodered.org/u/PPz)
#### Post date: [9 December 2020 04:59 UTC](https://discourse.nodered.org/t/newbie-modbus-tcp-server-socket-error/19484/3 "2020-12-09T04:59:37Z")

</div>

Yes (mostly) and No (sometimes)

Yes, because I noticed that my networking was not the best. I physically moved my PLC and nodered computer and hooked them to the same switch. That decreased the errors by 95%. So a good network is obviously a must to decrease communication errors.

Yes because I noticed that keeping the same polling rate and adding some delays on the treatment was better than delaying the poll. I don't need data every 10 seconds... Sometimes once an hour is enough. So the delay functions (and keep a steady poll rate)

Yes because I also optimized the poll by regrouping (in the PLC) addresses to poll a range of contiguous addresses (INT16) instead of various, non contiguous addresses.

No because I also noticed that if I add too many flows with various polls (2 PLC's and 2 serial devices on the same node-red), the global treatment could add some communication errors.

Hope it helps.
