This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus TCP - Dropped connection
#1
Hello,

I have recently noticed that my LM/HomeLynk is dropping the TCP connection to a slave and does not reconnect to it.
I have to manually reboot the slave to get the connection back.

I can't say for 100% it's LM fault, but I have noticed a pattern during this weekend.
When I'm at the LM config page and especially looking at the RS485 Mapping, the TCP connection dropped after a while when working.
However when I quit working the TCP connection stays up all night long, hence thinking the problem is not with the slave, but with LM.
That somehow looking at a mapping will disrupt the the TCP connection?

The slave have been connected since mid August and I haven't noticed any dropped connections earlier.

Attached Files Thumbnail(s)
   
Reply
#2
Try enabling Persistent connection.
------------------------------
Ctrl+F5
Reply
#3
Persistent connection have been enabled but since the connection started to drop I tried eloborating with it disabled.
Haven't noticed any difference.
Reply
#4
How many registers do you read and what is the poll interval and the timeout?
------------------------------
Ctrl+F5
Reply
#5
Changing mapping causes a reload so connections are closed and open again. Unfortunately many Modbus TCP devices have problems with multiple TCP connections.
If you're not doing any changes to the mapping then it cannot affect TCP connections.
Reply
#6
I'll have to get back later tonight with # registers, interval and timeout.
But a good guess is 50 registers, 5 second interval and default timeout for both of the Modbus slaves.

I don't really change mapping I think, I have the mapper popup displayed, and click some of the registers to check "write to bus" maybe 4-5 registers in one sweep so maybe 10-30 seconds of editing in that sweep.
Mostly this happened when I had the RS485 mapping up, then the TCP lost connection.
Reply
#7
First RS485 port and TCP are handled by the same daemon so changing RS485 mapping settings will cause new TCP connections to be established. Some TCP devices cannot detect a closed connection quickly enough and since they can only handle several open connections at once such problems arise.
Reply
#8
Alright, so when this occours I have to reboot the slave? No way of re-establish the connection through LM?
Can the LM close the connection in a manner that a slave understands it's closed, before LM reloading the connection?

Or is this what it is? Smile
Reply
#9
The persistent mode should be the solution to this. It then keeps the connection permanently open without closing it.
------------------------------
Ctrl+F5
Reply
#10
Late reply, but I have persistant mode on and it do drop the connection anyway.
But Daniel and Admin doesn't seem to agree if connection should be dropped or not. Big Grin

Perhaps it should keep connection, but somehow doesn't?
Reply
#11
When persistent mode is enabled the connection is kept open unless you change something in the mapping (including RTU 1). After any mapping changes all persistent TCP connections are closed and new connections are created.
Reply


Forum Jump: