Skip to content

In serial, recover poorly from glitch/error/... #4

Closed
@dglaude

Description

@dglaude

I tested this library with a serial sensor like this: https://www.adafruit.com/product/3686

Within one or two minutes, the code fail (mostly on if b != 0x42:) and does not seems to recover. Some tricks to empty the buffer, re-read or reset should be implemented for more reliability.

The code from the learn guide ( https://learn.adafruit.com/pm25-air-quality-sensor/python-and-circuitpython ) of the product behave much better, even when temporary removing the cable.

Here is the way it fail (and never seems to recover):

Concentration Units (standard)

PM 1.0: 10 PM2.5: 13 PM10: 13
Concentration Units (environmental)

PM 1.0: 10 PM2.5: 13 PM10: 13

Particles > 0.3um / 0.1L air: 1938
Particles > 0.5um / 0.1L air: 518
Particles > 1.0um / 0.1L air: 62
Particles > 2.5um / 0.1L air: 4
Particles > 5.0um / 0.1L air: 0
Particles > 10 um / 0.1L air: 0

Unable to read from sensor, retrying...
Unable to read from sensor, retrying...
Unable to read from sensor, retrying...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions