vshymanskyy / blynk-library-python

Blynk library for Python. Works with Python 2, Python 3, MicroPython.
https://blynk.io/
MIT License
281 stars 97 forks source link

Fixed socket disconnecting about every 2 minutes #63

Closed jfperusse closed 2 years ago

jfperusse commented 2 years ago

When calling blynk.run(), if no data is received from the server for a while, we would never process the ping messages (heartbeat) which would cause the socket to drop after about 2 minutes.

Calling process() on socket.timeout exceptions will send the heartbeat at the configured frequency and keep the socket connected.

npahucki commented 2 years ago

@vshymanskyy please merge this, it's needed, otherwise the current library is pretty useless. Also, please publish a new version so it can be installed via pip.