fu-hsi / PMS

Arduino library for Plantower PMS x003 family sensors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non blocking read not working

albfan opened this issue · comments

I just found on this tutorial:

http://kstobbe.dk/2019/02/16/esp32-pms5003-bme280-mics6814-sensor-build/

using blocking read:

  if (pms.readUntil(data, 2*PMS::SINGLE_RESPONSE_TIME))

and this effectively allow me to read data from PMS5003.

Just to confirm it output data each 800ms:

Captura de pantalla de 2022-08-12 12-41-42

but I see all around people using non blocking read:

  if (pms.read(data))

This give me reads randomly (some reads after reset, no reads at all...)

Any background about what could be the reason? Just trying to figure out how to use the sensor properly