Open 275RR opened 2 years ago
I think SSL is failing to handshake. It just doesn't error until a write? non-blocking
I think ssl_context is not supported by Pycom and upstream by MicroPython?
Is there anyway to still use SSL?
I am running into this on RPI4 as well. Disconnect and reconnect fix sometimes, but very random.
File "/usr/src/xxx/src/lib/blynk.py", line 349, in change_color blynk.set_property(pin, "color", color) File "/usr/local/lib/python3.7/site-packages/BlynkLib.py", line 90, in set_property self._send(MSG_PROPERTY, pin, prop, *val) File "/usr/local/lib/python3.7/site-packages/BlynkLib.py", line 117, in _send self._write(msg) File "/usr/local/lib/python3.7/site-packages/BlynkLib.py", line 249, in _write self.conn.write(data) File "/usr/local/lib/python3.7/ssl.py", line 948, in write return self._sslobj.write(data) BrokenPipeError: [Errno 32] Broken pipe
Also having a very similar issue. ESP32-S2 (featherS2 board)
(Actually using circuitpython rather than micropython. Which has a different socket implementation using socketpool, so have made changes to the library to try to get this working.)
If I don't use SSL (insecure=True) then I get OSError: [Errno 104] ECONNRESET
If I use SSL, it completely crashes and ressets the board at the _write() function.
I also had trouble with micropython, but will switch back to that now and try from there.
I found the original issue causing my ssl failures, I had legacy code from blynk v1 that was setting table values. I removed that line of code and the broken pipe above is no longer happening.
I am however seeing random connection refused error messages in my logs. They appear to be pure TCP connectivity issues - either my side or the service side causing the socket connection issues.
I have also tweaked the startup parameters for Blynk, I think this has also improved stability of the socket connection.
blynk = BlynkLib.Blynk(AUTHKEY, buffin=2048, heartbeat=100)
Similar to RPI disconnects #58
I'm able to successfully connect to the Blynk Cloud but quickly crash with OSError: [Errno 104] ECONNRESET. I believe this might be a SSL socket issue when writing in blynk-library-python. I do not get the error when running insecure=True.
Current firmware and blynk-library as of 10-28-2021: I'm using a Pycom LoPy 4 (1.20.2.r6) which has MicroPython (v1.11-c5a0a97).
Any ideas how to fix this?