blynkkk / lib-python

Blynk IoT library for Python and Micropython
MIT License
237 stars 83 forks source link

Revert socket timeout implementation #33

Closed fgervais closed 4 years ago

fgervais commented 4 years ago

On the TinyPICO board, the new implementation of the _set_socket_timeout() method makes the self._socket.recv(length) call block until the server times out and closes the socket.

This makes the device periodically reconnecting/reauthenticating with the server as it cannot do the ping as it's supposed to.

The new implementation of _set_socket_timeout() is in line with the usocket documentation recommendations but it seems that it doesn't work on some boards. Well at least the TinyPICO.

Reverting to the previous _set_socket_timeout() which should cover all cases.