Debug Console API

Debug console related APIs for ESP-NOW.

API Reference

Header File

Functions

esp_err_t espnow_console_init(const espnow_console_config_t *config)

Initialize console module.

  • Initialize the console

  • Register help commands

  • Initialize filesystem

  • Create console handle task

Note

With monitor_command.espnow set, the DEBUG_COMMAND handler is registered and ESP_OK returned even when the frames are not protected; only an error is logged. The application must keep monitor_command.espnow false in production builds.

Parameters:

config – [in] pointer to the console configuration structure

Returns:

  • ESP_OK

  • ESP_FAIL

esp_err_t espnow_console_deinit(void)

De-initialize console module Call this once when done using console module functions.

Returns:

  • ESP_OK

  • ESP_FAIL

void espnow_console_commands_register()

Register Common commands.

_cplusplus

Structures

struct espnow_console_config_s

Console configuration.

< _cplusplus

Public Members

bool uart

Receiving command from uart

bool espnow

Receiving command from espnow. Debug facility without access control of its own: every received DEBUG_COMMAND frame is executed (restart, reset, wifi_config, ota, …). Unless the frames are encrypted (CONFIG_ESPNOW_DEBUG_SECURITY and sec_enable) and plaintext ones are rejected (CONFIG_ESPNOW_SEC_REJECT_PLAINTEXT), any device in range can run them; espnow_console_init() then logs a warning. Debug use only: even encrypted, a recorded command frame (e.g. reset, which erases NVS) can be replayed without the key. The recommended configuration keeps it false.

struct espnow_console_config_s::[anonymous] monitor_command

Command monitor configuration

const char *base_path

Path where partition should be registered (e.g. “/spiflash”)

const char *partition_label

Label of the partition which should be used

struct espnow_console_config_s::[anonymous] store_history

Command story history configuration

Type Definitions

typedef struct espnow_console_config_s espnow_console_config_t

Console configuration.

< _cplusplus