Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP8266 and passive mode fixes #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DanEmord
Copy link

@DanEmord DanEmord commented Nov 6, 2021

  • My ESP8266 running MicroPython 1.17 appears to always return 1 from UART.any(), which is documented as a possibility. I added a check to determine if we're running on an ESP8266 and set the expected frame length to 1 when waiting for a response in _sendCommand.
  • When in passive mode, the sensor will only send with a data frame if a 0xe2 command is sent per the docs. If the sensor is already in passive mode and the controller restarts, wakeUp would not send this command to request data and therefore never mark the device as alive.
  • I also included the fix from Update pms5003.py #6

ESP8266 appears to always return `1` from `UART.any()`

When in passive mode, the sensor will only reply with a frame if a `0xe2` command is sent. If the sensor is already in passive mode and the controller restarts, `wakeUp` would not  request data and therefore never mark the device as alive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant