跳到主要内容

Serial Console Commands

ESP RainMaker and rmaker_common provide a UART-based serial console for development and debugging. When enabled, you can connect to the device via a serial terminal (e.g., idf.py monitor or a serial port tool) and run commands to inspect device state, trigger actions, and debug firmware.

信息

The console must be enabled via CONFIG_ESP_RMAKER_CONSOLE_ENABLED in your project's sdkconfig. Call esp_rmaker_console_init() before esp_rmaker_start() to start the console.


ESP RainMaker Commands

These commands are provided by the esp_rainmaker component.

CommandUsageDescriptionConfig
add-useradd-user <user_id> <secret_key>Initiate user-node mapping from the nodeAlways
get-node-idget-node-idPrint the Node ID for this boardAlways
wifi-provwifi-prov <ssid> [<passphrase>]Provision or reconfigure Wi-Fi credentialsCONFIG_ESP_RMAKER_NETWORK_OVER_WIFI
sign-datasign-data <data>Sign data with RSA and return hex signatureAlways
clear-claim-dataclear-claim-dataErase the fctry NVS partition (clears claim data) and rebootAlways
cmdcmd <req_id> <user_role> <cmd> <data>Send command to command-response moduleCONFIG_ESP_RMAKER_CMD_RESP_ENABLE
set-paramset-param <device_name> <param_name> <value>Set device parameter with callback (invokes write handler)CONFIG_ESP_RMAKER_CONSOLE_PARAM_CMDS_ENABLE
update-paramupdate-param <device_name> <param_name> <value>Update parameter value without invoking callbackCONFIG_ESP_RMAKER_CONSOLE_PARAM_CMDS_ENABLE
get-paramget-param <device_name> <param_name>Read device parameter valueCONFIG_ESP_RMAKER_CONSOLE_PARAM_CMDS_ENABLE
chal-resp-enablechal-resp-enable [instance_name]Enable challenge-response serviceCONFIG_ESP_RMAKER_CONSOLE_CHAL_RESP_CMDS_ENABLE
chal-resp-disablechal-resp-disableDisable challenge-response serviceCONFIG_ESP_RMAKER_CONSOLE_CHAL_RESP_CMDS_ENABLE

rmaker_common Commands

These commands are provided by the rmaker_common component and cover debugging, system control, and time management.

Debug & System

CommandUsageDescriptionConfig
rebootrebootRestart the deviceAlways
reset-to-factoryreset-to-factoryReset the board to factory defaults and rebootAlways
up-timeup-timeShow device uptime in millisecondsAlways
mem-dumpmem-dumpShow free memory, largest block, and min ever free (internal + SPIRAM)Always
task-dumptask-dumpList all running FreeRTOS tasksCONFIG_FREERTOS_USE_TRACE_FACILITY
cpu-dumpcpu-dumpShow CPU utilisation by all running tasksCONFIG_FREERTOS_GENERATE_RUN_TIME_STATS
sock-dumpsock-dumpList all active socketsLWIP IPv4
heap-traceheap-trace <start|stop> [buffer_size]Start or stop heap tracing (default buffer: 200 records)CONFIG_HEAP_TRACING

Time

CommandUsageDescription
local-timelocal-timeShow current local time on the device
tz-settz-set <tz_string> or tz-set posix <posix_tz_string>Set timezone

Enabling the Console

  1. Enable the console in menuconfig:

    • Component config → ESP RainMaker → Enable serial console
  2. Call the init function before esp_rmaker_start():

    esp_rmaker_console_init();
  3. Connect via serial (e.g., idf.py monitor) and type help to list available commands.


Optional Command Groups

Some command groups require additional Kconfig options:

  • Parameter commands (set-param, update-param, get-param): Enable CONFIG_ESP_RMAKER_CONSOLE_PARAM_CMDS_ENABLE for local parameter testing.
  • Command-response (cmd): Enable CONFIG_ESP_RMAKER_CMD_RESP_ENABLE for command-response module testing.
  • Challenge-response (chal-resp-enable, chal-resp-disable): Enable CONFIG_ESP_RMAKER_CONSOLE_CHAL_RESP_CMDS_ENABLE for challenge-response service control.

Factory Reset via Serial Console

The reset-to-factory command provides a serial console option for factory reset. Connect to the device via UART, run:

reset-to-factory

The device will reset to factory defaults and reboot. This is useful when the device has no physical button or when you need to reset remotely via a serial connection.

For other factory reset methods, see I have done Wi-Fi provisioning of my board, but now I want to reset it to factory defaults. How do I do it?.

On this page