adafruit / Adafruit_CircuitPython_ESP_ATcontrol

Use the ESP AT command sent to communicate with the Interwebs
MIT License
20 stars 17 forks source link

Read larger chunks to avoid loosing data. #41

Closed PontusO closed 3 years ago

PontusO commented 3 years ago

When receiving large amounts of data we would sometimes loose information here and there. By reading all available data from the uart this problem has been solved.

kevinjwalters commented 3 years ago

The bug from this change manifests itself as connectivity problems, in my case with an ESP-01S. It was the first time I've used one of these so took me some time to come looking in github for bugs - I see this was reverted in #43. I downloaded lastest library (20211029) and that works well with 0.5.8 version of library.

This is the sort of thing that appears with broken libraries from last September/early October in case anyone else hits this.


Traceback (most recent call last):
  File "code.py", line 168, in <module>
  File "adafruit_io/adafruit_io.py", line 110, in connect
AdafruitIO_MQTTError: MQTT Error: Unable to connect to Adafruit IO.

Plus oddities like high "packet loss" (>50%) with pings.