From fce010403516df3e87d5c7ca16b6f23a6baa4763 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 5 Jan 2022 12:43:26 +0100 Subject: [PATCH] Add SPM Relay scan timeout message --- tasmota/xdrv_86_esp32_sonoff_spm.ino | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasmota/xdrv_86_esp32_sonoff_spm.ino b/tasmota/xdrv_86_esp32_sonoff_spm.ino index f22a98992..3a151dd01 100644 --- a/tasmota/xdrv_86_esp32_sonoff_spm.ino +++ b/tasmota/xdrv_86_esp32_sonoff_spm.ino @@ -1025,9 +1025,15 @@ void SSPMEvery100ms(void) { Sspm->module_max = 0; SSPMSendInitScan(); Sspm->mstate = SPM_WAIT_FOR_SCAN; + Sspm->last_totals = 0; break; case SPM_WAIT_FOR_SCAN: - // Wait for scan sequence to complete + // Wait for scan sequence to complete within 60 seconds + if (Sspm->last_totals > 600) { + AddLog(LOG_LEVEL_DEBUG, PSTR("SPM: Relay scan timeout")); + Sspm->mstate = SPM_NONE; + Sspm->error_led_blinks = 255; + } break; case SPM_SCAN_COMPLETE: // Scan sequence finished