ERROR: Connection timed out: select

43 views
Skip to first unread message

Joe M.

unread,
Apr 26, 2018, 10:35:22 AM4/26/18
to libmodbus
Hello all,

Observing a very sporadic ERROR: Connection timed out: select error using tcp.

I'm polling the slave device a rate of 1 second, with a resp timeout of 250ms. For the majority of the time, everything works flawlessly until this very occasional error occurs:

Waiting for a confirmation...
<0C><AC><00><00><00><0B><05><03><08><00><00><00><00><47><F8><41><06>
[0C][AD][00][00][00][06][05][04][00][01][00][06]
Waiting for a confirmation...
<0C><AD><00><00><00><0F><05><04><0C><4C><00><3F><99><14><00><42><4C><5F><64><41><1F>
[0C][AE][00][00][00][06][05][03][00][07][00][04]
Waiting for a confirmation...
<0C><AE><00><00><00><0B><05><03><08><00><00><00><00><47><F8><41><06>
[0C][AF][00][00][00][06][05][04][00][01][00][06]
Waiting for a confirmation...
<0C><AF><00><00><00><0F><05><04><0C><36><00><3F><9A><14><00><42><4C><5F><64><41><1F>
[0C][B0][00][00][00][06][05][03][00][07][00][04]
Waiting for a confirmation...
<0C><B0><00><00><00><0B><05><03><08><00><00><00><00><47><F8><41><06>
[0C][B1][00][00][00][06][05][04][00][01][00][06]
Waiting for a confirmation...
ERROR Connection timed out: select
0 bytes flushed


The same application runs on a Ubuntu Desktop with no issues; the above is from a VAR-SOM-MX6 target board.I've tried increasing the timeout but the same results occur. Noticed in another mail thread that using the modbus_set_slave() API resolved a similar issue, but that's already being done in the application code.

Any ideas on what to try/query/etc.?

Thanks

Chuck Watson

unread,
Apr 26, 2018, 11:22:43 AM4/26/18
to libm...@googlegroups.com

If you are NOT using a dedicated Ethernet network, you are attempting very fast polling with a short timeout. Other traffic on the network will cause issues with short timeouts.

 

Also, what is between your master and slave on the network? Any routers? Cheap switches?

 

What is the maximum timeout you have tried and still see the issue?

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Joe Markel

unread,
Apr 26, 2018, 7:53:40 PM4/26/18
to libm...@googlegroups.com
Thanks for responding.

5 seconds is the longest response time I tried (on the SoM), with similar results. The same application running on Ubuntu and the SoM were both on the same subnet, whereas the application ran for four days without error. I'm thinking of attaching Wireshark next to see just how quickly the slave is sending back a response.
 


Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+unsubscribe@googlegroups.com.


Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+unsubscribe@googlegroups.com.

Joe Markel

unread,
Apr 27, 2018, 9:29:03 AM4/27/18
to libm...@googlegroups.com
Ok, the "connmand" process was chewing up too much CPU every 20 minutes or so. I killed the process and everything is working as-expected. Time to start tweaking.



On Thu, Apr 26, 2018 at 10:22 AM, Chuck Watson <wat...@gmail.com> wrote:

Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+unsubscribe@googlegroups.com.


Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages