EnergieID / smappy

Python client for Smappee
MIT License
21 stars 8 forks source link

LocalSmappee client cannot logon again after a temporary connection loss #29

Closed BugRaptor closed 6 years ago

BugRaptor commented 6 years ago

I'm using the smappy.LocalSmappee client to continuously get instantaneous data in a loop from my local Smappee device via my WiFi LAN. If the WiFi connection is lost (ie. if I switch off the WiFi) I get first a ReadTimeout exception from ls.load_instantaneous(). I then call the connection initialisation code again...

ls = LocalSmappee(ip)
ls.Logon(admin_password) 

...in order to try to restore the connection and on next ls.load_instantaneous() I get a ConnectionError exception. On each loop I then try to restore the connection the same way (creating a new client and calling logon()) and I always get the ConnectionError exception. This appears correct as the WiFi is always down. But if I switch on the WiFi, the behavior remains the same. I always get a ConnectionError exception... I need to restart the python script to restore the correct functionning.

JrtPec commented 6 years ago

Could you post some more details about the ConnectionError you're getting?

BugRaptor commented 6 years ago

Ok, sorry, I was wrong. I simply didn't wait enough time to let the WiFi LAN be up again !

Actually the connection was finally correctly restored... :-)

All is fine !