From 32f2c9f88e79ada3f439c62e441adc4b49e5aa1e Mon Sep 17 00:00:00 2001 From: oarcher Date: Sun, 19 May 2024 00:49:13 +0200 Subject: [PATCH] log message while the modem is not ready. --- esphome/components/modem/modem_component.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/esphome/components/modem/modem_component.cpp b/esphome/components/modem/modem_component.cpp index 51d14ccc4d..bd2a7c6a2b 100644 --- a/esphome/components/modem/modem_component.cpp +++ b/esphome/components/modem/modem_component.cpp @@ -218,11 +218,16 @@ void ModemComponent::got_ip_event_handler(void *arg, esp_event_base_t event_base void ModemComponent::loop() { const uint32_t now = millis(); + static uint32_t last_log_time = now; switch (this->state_) { case ModemComponentState::STOPPED: if (this->started_) { if (!this->modem_ready()) { + if (now - last_log_time > 20000) { + ESP_LOGD(TAG, "Waiting for the modem to be ready..."); + last_log_time = now; + } break; } else { ESP_LOGI(TAG, "Starting modem connection");