I've the pyboard + simcom.
I initialize the GSM module and wanted get some data by HTTP (ex: 50kB).
my code:
Code: Select all
self.device = UART(2)
self.device.init(115200, read_buf_len=64, timeout=2000, timeout_char=5000)
....
self._write("AT+HTTPREAD")
http_data = "http.data"
retries = 0
with open(http_data, "wb") as temp:
while retries < 10000000:
try:
retries += 1
if self.device.any():
buff = self.device.read(64)
temp.write(buff)
except Exception as e:
Log().write(e)
continue
....
How can I configure UART without lost some data during receive that data?
Thanks.