Replies: 2 comments 1 reply
-
Where did you see auto_open it is not in our documentation. But yes your problem is that wallbox (like many other devices) close the connection after 30 seconds. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi Jan,
many thanks for the quick response.
Am Sonntag, 26. März 2023, 18:13:08 CEST schrieb jan iversen:
Where did you see auto_open it is not in our documentation.
It seems I used the wrong documentation without noticing it:
https://pymodbustcp.readthedocs.io/en/latest/quickstart/index.html
I am surprised that python does not complain about the undefined arguments.
But yes your problem is that wallbox (like many other devices) close the
connection after 30 seconds.
Would you open for each operation a connect() and close() if there is a risk,
that the timeout becomes bigger than 30 seconds?
client.connect()
rr = client.read_holding_registers(344,count=2,slave=1)
client.close()
Thanks
Rainer
…--
Rainer Dorsch
http://bokomoko.de/
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a strange observation here:
I do a periodic read_holding_registers() operation. If I read every 10 secs, everything works super reliable, if I read every 60 secs, I get a connection error. The server is an Alfen Eve NG910 wallbox:
Example code:
With the 60 seconds sleep interval, I get as output:
with a 10 seconds sleep interval everything works as expected.
The issue goes away, if I add a client.connect() before the client.read_holding_registers() and a client.close() thereafter.
I assume that the wallbox closes the connection after a certain time of inactivity.
Isn't the auto_open=True supposed to automatically open the connection again?
Thanks
Rainer
Beta Was this translation helpful? Give feedback.
All reactions