mirror of
https://github.com/esphome/esphome.git
synced 2024-12-28 00:11:43 +01:00
log message while the modem is not ready.
This commit is contained in:
parent
064af5aecd
commit
32f2c9f88e
1 changed files with 5 additions and 0 deletions
|
@ -218,11 +218,16 @@ void ModemComponent::got_ip_event_handler(void *arg, esp_event_base_t event_base
|
||||||
|
|
||||||
void ModemComponent::loop() {
|
void ModemComponent::loop() {
|
||||||
const uint32_t now = millis();
|
const uint32_t now = millis();
|
||||||
|
static uint32_t last_log_time = now;
|
||||||
|
|
||||||
switch (this->state_) {
|
switch (this->state_) {
|
||||||
case ModemComponentState::STOPPED:
|
case ModemComponentState::STOPPED:
|
||||||
if (this->started_) {
|
if (this->started_) {
|
||||||
if (!this->modem_ready()) {
|
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;
|
break;
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGI(TAG, "Starting modem connection");
|
ESP_LOGI(TAG, "Starting modem connection");
|
||||||
|
|
Loading…
Reference in a new issue