From 2e7fd534e04c47277499e536ec14e8c1d67753e0 Mon Sep 17 00:00:00 2001 From: VergLsm Date: Fri, 16 Oct 2020 00:50:55 +0800 Subject: [PATCH] Fixed issue of cannot read data when restart and using Sensor18 --- tasmota/xsns_18_pms5003.ino | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasmota/xsns_18_pms5003.ino b/tasmota/xsns_18_pms5003.ino index d54527ddc..054441b55 100644 --- a/tasmota/xsns_18_pms5003.ino +++ b/tasmota/xsns_18_pms5003.ino @@ -247,6 +247,14 @@ void PmsInit(void) if (!PinUsed(GPIO_PMS5003_TX)) { // setting interval not supported if TX pin not connected Settings.pms_wake_interval = 0; Pms.ready = 1; + } else { + if (Settings.pms_wake_interval >= MIN_INTERVAL_PERIOD) { + // Passive Mode + PmsSendCmd(CMD_MODE_PASSIVE); + Pms.wake_mode = 0; + Pms.ready = 0; + Pms.time = Settings.pms_wake_interval - WARMUP_PERIOD; // Let it wake up in the next second + } } Pms.type = 1;