debug option

This commit is contained in:
oarcher 2024-08-13 16:41:27 +02:00
parent 67fb79a6e7
commit 3a289c8284
4 changed files with 10 additions and 5 deletions

View file

@ -82,7 +82,7 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_INIT_AT): cv.All(cv.ensure_list(cv.string)), cv.Optional(CONF_INIT_AT): cv.All(cv.ensure_list(cv.string)),
cv.Optional(CONF_ENABLE_ON_BOOT, default=True): cv.boolean, cv.Optional(CONF_ENABLE_ON_BOOT, default=True): cv.boolean,
cv.Optional(CONF_ENABLE_CMUX, default=False): cv.boolean, cv.Optional(CONF_ENABLE_CMUX, default=False): cv.boolean,
cv.Optional(CONF_DEBUG, default=False): cv.boolean, # needs also cv.Optional(CONF_DEBUG, default=False): cv.boolean,
cv.Optional(CONF_ON_NOT_RESPONDING): automation.validate_automation( cv.Optional(CONF_ON_NOT_RESPONDING): automation.validate_automation(
{ {
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id( cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(
@ -176,6 +176,7 @@ async def to_code(config):
cg.add(var.enable_cmux()) cg.add(var.enable_cmux())
if config[CONF_DEBUG]: if config[CONF_DEBUG]:
add_idf_sdkconfig_option("CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE", True)
cg.add(var.enable_debug()) cg.add(var.enable_debug())
if init_at := config.get(CONF_INIT_AT, None): if init_at := config.get(CONF_INIT_AT, None):

View file

@ -48,7 +48,11 @@ ModemComponent::ModemComponent() {
global_modem_component = this; global_modem_component = this;
} }
void ModemComponent::enable_debug() { esp_log_level_set("command_lib", ESP_LOG_VERBOSE); } void ModemComponent::enable_debug() {
esp_log_level_set("command_lib", ESP_LOG_VERBOSE);
// esp_log_level_set("CMUX", ESP_LOG_VERBOSE);
// esp_log_level_set("CMUX Received", ESP_LOG_VERBOSE);
}
AtCommandResult ModemComponent::send_at(const std::string &cmd, uint32_t timeout) { AtCommandResult ModemComponent::send_at(const std::string &cmd, uint32_t timeout) {
AtCommandResult at_command_result; AtCommandResult at_command_result;
@ -643,7 +647,6 @@ bool ModemComponent::start_ppp_() {
if (!status) { if (!status) {
ESP_LOGE(TAG, "Unable to change modem mode to PPP"); ESP_LOGE(TAG, "Unable to change modem mode to PPP");
this->poweroff_();
} }
return status; return status;

View file

@ -139,9 +139,9 @@ class ModemComponent : public Component {
size_t uart_rx_buffer_size_ = 2048; // 256-2048 size_t uart_rx_buffer_size_ = 2048; // 256-2048
size_t uart_tx_buffer_size_ = 1024; // 256-2048 size_t uart_tx_buffer_size_ = 1024; // 256-2048
uint8_t uart_event_queue_size_ = 30; // 10-40 uint8_t uart_event_queue_size_ = 30; // 10-40
size_t uart_event_task_stack_size_ = 2048; // 2000-6000 size_t uart_event_task_stack_size_ = 4096; // 2000-6000
uint8_t uart_event_task_priority_ = 5; // 3-22 uint8_t uart_event_task_priority_ = 5; // 3-22
uint32_t command_delay_ = 10000; // timeout for AT commands uint32_t command_delay_ = 1000; // timeout for AT commands
uint32_t update_interval_ = 60 * 1000; uint32_t update_interval_ = 60 * 1000;
// Changes will trigger user callback // Changes will trigger user callback

View file

@ -20,6 +20,7 @@ class GnssSwitch : public switch_::Switch, public Component {
// ========== INTERNAL METHODS ========== // ========== INTERNAL METHODS ==========
// (In most use cases you won't need these) // (In most use cases you won't need these)
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
void dump_config() override; void dump_config() override;
void setup() override; void setup() override;
void loop() override; void loop() override;