Skip to content

Bug in PR #41 #43

Closed
Closed
@waiweng83

Description

@waiweng83

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.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions