Fix: PMS Read Failed

This commit is contained in:
Phat Nguyen
2024-03-14 21:17:43 +07:00
parent d92d312b0c
commit be1a9778e6
13 changed files with 409 additions and 336 deletions

View File

@ -457,6 +457,9 @@ void loop() {
}
updateWiFiConnect();
/** Read PMS on loop */
ag.pms5003.handle();
}
static void sendPing() {
@ -629,7 +632,7 @@ static void co2Update() {
}
void pmUpdate() {
if (ag.pms5003.readData()) {
if (ag.pms5003.isFailed() == false) {
pm25 = ag.pms5003.getPm25Ae();
Serial.printf("PMS2.5: %d\r\n", pm25);
pmFailCount = 0;