Waiting for a confirmation... ERROR Connection timed out: select

2,764 views
Skip to first unread message

franco bustaffa

unread,
Jun 5, 2014, 10:57:38 AM6/5/14
to libm...@googlegroups.com
I am trying to interface a TCP ModBus device  with unit-test-client.c simplified. The program now contains only a modbus_write_register. I would like to set a register value only. I can connect successfully the device but the modbus_write_register function fails with 
[00][01][00][00][00][06][FF][06][00][69][00][01]
Waiting for a confirmation...
ERROR Connection timed out: select
Of course my test  program works locally (127.0.0.1) with the libmodbus server test program.

Of course I have increased the timeout to 3 sec. 

I think that my error is in some environment setting.

May you help me?

Ciao Franco

Stéphane Raimbault

unread,
Jun 5, 2014, 11:26:36 AM6/5/14
to libm...@googlegroups.com
It's frequent that some devices aren't Modbus compliant and it's required in this case to use modbus_set_slave() to set the slave ID of the remote device before sending the request (I should add this information to the documentation).




--
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.

franco bustaffa

unread,
Jun 6, 2014, 5:04:30 AM6/6/14
to libm...@googlegroups.com
Thank you for the reply.

I have inserted the modbus_set_slave() function  with the special value MODBUS_TCP_SLAVE (0xFF) successfully. But the result was the same.

But I remember that this device accepts slave with ID equal to 1 and not 0xFF: I have changed 0xFF with 1 and it works! 

May be it is an implementation error and I will inform the producer about it (I think the producer already know it).

Anyway with your help I solved the problem!

For the libmodbus community the device interfaced is ECOMM EC1. The EC1 is an 802.15.4 PAN Coordinator of a wireless sensor network.

Thank you again.

Ciao Franco

Stéphane Raimbault

unread,
Jun 6, 2014, 9:38:47 AM6/6/14
to libm...@googlegroups.com
So I really should document this common issue!


--

萌喵喵

unread,
Jun 1, 2015, 2:39:43 AM6/1/15
to libm...@googlegroups.com
I also found this problem. I connect a recorder via ethernet. If I use "modbus_set_debug", the program would dump this error message. If I don't turn off "modbus_set_debug", everything will be fine. And the recorder can give me the correct register value.

regards

franco bustaffa於 2014年6月5日星期四 UTC+8下午10時57分38秒寫道:
Reply all
Reply to author
Forward
0 new messages