-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data errors with fast refresh. #37
Comments
Does HA actually allow for holding the socket open between polling cycles? I don't really know the internals of how HA add ons work. From my experience with libmodbus in C, ideally the socket would be opened when HA starts up and then never closed unless 1) connection drops and needs to be reopened (network failure, inverter loses power and reboots, whatever) or 2) HA shuts down. |
The changes in #39 introduce pymodbustcp which I believe lets the connection remain open. I set it to auto open so that if the connection drops for some reason it will open again. https://pymodbustcp.readthedocs.io/en/latest/package/class_ModbusClient.html |
Wireshark would confirm if it's never intentionally closing the connection if someone has time to try that. |
I will have a look into monitoring with wireshark as I am already running on that fork. |
I have been facing some issues with nonsense data coming out of this integration on and off.
This wasn't an issue with https://github.com/erikarenhill/solaredge-modbus-hass and having a look their it looks like erikarenhill is using import pymodbusTCP whereas bisentsu is using pymodbus the pymodbusTCP implementation lets you keep the connection open with
ModbusClient(host, port=port, unit_id=1, auto_open=True)
whereas pymodbus appears to require a connect and close each read cycle.My suspicion is that this open/close cycle can take longer than 5-10 seconds and cause errors if it hasn't run through properly. I would like to trial using pymodbusTCP to see if it makes any difference.
Originally posted by @nerfherder in #35 (comment)
The text was updated successfully, but these errors were encountered: