There is a bug in #41.
The response from the ESP should be read one byte each time as this code is expecting an 'OK\r\n' as last 4 characters or 'ERROR\r\n' as the last 7 characters.
if response[-4:] == b"OK\r\n":
break
if response[-7:] == b"ERROR\r\n":
break
If we read a big chunk of data, this will be missed if there is other data flowing in after the 'OK\r\n'.
We should also stop reading from the UART buffer right after we received the 'OK\r\n' so that the data after remains in the UART buffer and can be processed by other function.
There is a bug in #41. The response from the ESP should be read one byte each time as this code is expecting an 'OK\r\n' as last 4 characters or 'ERROR\r\n' as the last 7 characters.
If we read a big chunk of data, this will be missed if there is other data flowing in after the 'OK\r\n'. We should also stop reading from the UART buffer right after we received the 'OK\r\n' so that the data after remains in the UART buffer and can be processed by other function.
Thanks.