mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 06:33:51 +00:00 
			
		
		
		
	debug option
This commit is contained in:
		| @@ -82,7 +82,7 @@ CONFIG_SCHEMA = cv.All( | ||||
|             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_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.GenerateID(CONF_TRIGGER_ID): cv.declare_id( | ||||
| @@ -176,6 +176,7 @@ async def to_code(config): | ||||
|         cg.add(var.enable_cmux()) | ||||
|  | ||||
|     if config[CONF_DEBUG]: | ||||
|         add_idf_sdkconfig_option("CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE", True) | ||||
|         cg.add(var.enable_debug()) | ||||
|  | ||||
|     if init_at := config.get(CONF_INIT_AT, None): | ||||
|   | ||||
| @@ -48,7 +48,11 @@ ModemComponent::ModemComponent() { | ||||
|   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 at_command_result; | ||||
| @@ -643,7 +647,6 @@ bool ModemComponent::start_ppp_() { | ||||
|  | ||||
|   if (!status) { | ||||
|     ESP_LOGE(TAG, "Unable to change modem mode to PPP"); | ||||
|     this->poweroff_(); | ||||
|   } | ||||
|  | ||||
|   return status; | ||||
|   | ||||
| @@ -139,9 +139,9 @@ class ModemComponent : public Component { | ||||
|   size_t uart_rx_buffer_size_ = 2048;         // 256-2048 | ||||
|   size_t uart_tx_buffer_size_ = 1024;         // 256-2048 | ||||
|   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 | ||||
|   uint32_t command_delay_ = 10000;            // timeout for AT commands | ||||
|   uint32_t command_delay_ = 1000;             // timeout for AT commands | ||||
|   uint32_t update_interval_ = 60 * 1000; | ||||
|  | ||||
|   // Changes will trigger user callback | ||||
|   | ||||
| @@ -20,6 +20,7 @@ class GnssSwitch : public switch_::Switch, public Component { | ||||
|   // ========== INTERNAL METHODS ========== | ||||
|   // (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 setup() override; | ||||
|   void loop() override; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user