svalouch / rctmon

Pulls data from RCT Power GmbH devices for use with monitoring systems.
https://rctmon.readthedocs.io
GNU General Public License v3.0
17 stars 9 forks source link

networking fixes #17

Closed ouned closed 2 years ago

ouned commented 2 years ago

i fixed two network-handling related bugs i had problems with:

reconnect bug: connection closed due to for example when i unplugged the LAN cable. It then tried to reconnect after 180 seconds but failed because the last_data_received timer closed it instantly. I fixed it by resetting the last_data_received timer every time the connection is established.

remaining socket exceptions: some were unimplemented, I implemented the base class of the connection errors so it catches them all.

sfudeus commented 2 years ago

Nice one - the socket_disconnect() should solve an issue I just observed as well when I had plugged the network cable from my inverter for 15 minutes during a firmware update which seemed to block rctmon.

svalouch commented 2 years ago

Thanks!