From 6b377ad1f82d97ea1b94515a4d67f06a33ccb980 Mon Sep 17 00:00:00 2001 From: oarcher Date: Wed, 17 Jul 2024 13:15:37 +0200 Subject: [PATCH] reduced delay --- esphome/components/modem/modem_component.cpp | 6 ------ esphome/components/modem/modem_component.h | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/esphome/components/modem/modem_component.cpp b/esphome/components/modem/modem_component.cpp index 4ec34329bb..c86698669c 100644 --- a/esphome/components/modem/modem_component.cpp +++ b/esphome/components/modem/modem_component.cpp @@ -171,8 +171,6 @@ void ModemComponent::start_connect_() { global_modem_component->got_ipv4_address_ = false; - delay(this->command_delay); // NOLINT - if (this->dte_config_.uart_config.flow_control == ESP_MODEM_FLOW_CONTROL_HW) { if (command_result::OK != this->dce->set_flow_control(2, 2)) { ESP_LOGE(TAG, "Failed to set the set_flow_control mode"); @@ -209,7 +207,6 @@ void ModemComponent::start_connect_() { } else { ESP_LOGE(TAG, "Failed to configure multiplexed command mode. Trying to continue..."); } - delay(this->command_delay); // NOLINT // send initial AT commands from yaml for (const auto &cmd : this->init_at_commands_) { @@ -244,13 +241,10 @@ void ModemComponent::loop() { // Errors are not checked, because some commands return FAIL, but make the modem to answer again... ESP_LOGV(TAG, "Forcing cmux manual mode mode"); this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_MODE); - delay(this->command_delay); // NOLINT ESP_LOGV(TAG, "Forcing cmux manual command mode"); this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_COMMAND); - delay(this->command_delay); // NOLINT ESP_LOGW(TAG, "Forcing cmux manual exit mode"); this->dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_EXIT); - delay(this->command_delay); // NOLINT if (!this->modem_ready()) { this->on_not_responding_callback_.call(); } diff --git a/esphome/components/modem/modem_component.h b/esphome/components/modem/modem_component.h index c4f14a4637..0bc2c06e73 100644 --- a/esphome/components/modem/modem_component.h +++ b/esphome/components/modem/modem_component.h @@ -89,7 +89,7 @@ class ModemComponent : public Component { static void got_ip_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data); void dump_connect_params_(); std::string use_address_; - uint32_t command_delay = 2000; + uint32_t command_delay = 500; CallbackManager on_not_responding_callback_; };