blynk-library-python icon indicating copy to clipboard operation
blynk-library-python copied to clipboard

Does not recover after disconnect

Open pjlfrost opened this issue 3 years ago • 0 comments

I'm using a Raspberry PI with the latest Python (3.9 i believe)

It works fine most of the time but as soon as I loose internet connection (for example the breaker for my router tripped) the library does not automatically re-connect to the Blynk server. The Raspberry pi will re-connect to WiFi, and logs show my python script is still running and attempting to write to the Blynk server every 10s.

I logged "blynk.state" and it changes from 2 (CONNECTED) to 0 (DISCONNECTED), and stays at 0 until I stop and re-start the python script.

I call blynk = BlynkLib.Blynk('xxx')#insert your Auth Token here up at the top. And blynk.run() in a while loop that runs constanly. In the while loop, every 10s my script gathers data then does a blynk.virtual_write(...)

pjlfrost avatar Dec 08 '22 01:12 pjlfrost