Skip to content

Library deadlocks when using PM25AQI sensor with uart  #14

@mraleson

Description

@mraleson
  • Arduino board: ESP32 Feather
  • Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.13

When connecting to the particle sensor using the uart, the sensor will after about a minute fail continuously and not give any output. Removing this check allows the sensor to eventually resolve and continue functioning:

// Are there enough bytes to read from?
if (serial_dev->available() < bufLen) {
return false;
}

It looks like the sensor won't send any more data until the bogus bytes are read. After they are consumed the sensor will continue forward, fail the checksum and re-stabilize.

This PR would help prevent the issue: #10

Although, there may be other situations that could cause this deadlock to arise, like a noisy serial connection. I think both of these changes might be worth making, the consequence being some reads might fail the checksum, but as it is the reads fail continuously anyway.

Also in the forums it looks like these issues have been what these two people refer to, and sounds like it caused them to return their sensors:
https://forums.adafruit.com/viewtopic.php?t=200668&sid=ddf03cb5dfe45415ac3b76f599fcfa4e&start=15

Metadata

Metadata

Assignees

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