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.
| Command | Usage | Description | Config |
|---|---|---|---|
| add-user | add-user <user_id> <secret_key> | Initiate user-node mapping from the node | Always |
| get-node-id | get-node-id | Print the Node ID for this board | Always |
| wifi-prov | wifi-prov <ssid> [<passphrase>] | Provision or reconfigure Wi-Fi credentials | CONFIG_ESP_RMAKER_NETWORK_OVER_WIFI |
| sign-data | sign-data <data> | Sign data with RSA and return hex signature | Always |
| clear-claim-data | clear-claim-data | Erase the fctry NVS partition (clears claim data) and reboot | Always |
| cmd | cmd <req_id> <user_role> <cmd> <data> | Send command to command-response module | CONFIG_ESP_RMAKER_CMD_RESP_ENABLE |
| set-param | set-param <device_name> <param_name> <value> | Set device parameter with callback (invokes write handler) | CONFIG_ESP_RMAKER_CONSOLE_PARAM_CMDS_ENABLE |
| update-param | update-param <device_name> <param_name> <value> | Update parameter value without invoking callback | CONFIG_ESP_RMAKER_CONSOLE_PARAM_CMDS_ENABLE |
| get-param | get-param <device_name> <param_name> | Read device parameter value | CONFIG_ESP_RMAKER_CONSOLE_PARAM_CMDS_ENABLE |
| chal-resp-enable | chal-resp-enable [instance_name] | Enable challenge-response service | CONFIG_ESP_RMAKER_CONSOLE_CHAL_RESP_CMDS_ENABLE |
| chal-resp-disable | chal-resp-disable | Disable challenge-response service | CONFIG_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
| Command | Usage | Description | Config |
|---|---|---|---|
| reboot | reboot | Restart the device | Always |
| reset-to-factory | reset-to-factory | Reset the board to factory defaults and reboot | Always |
| up-time | up-time | Show device uptime in milliseconds | Always |
| mem-dump | mem-dump | Show free memory, largest block, and min ever free (internal + SPIRAM) | Always |
| task-dump | task-dump | List all running FreeRTOS tasks | CONFIG_FREERTOS_USE_TRACE_FACILITY |
| cpu-dump | cpu-dump | Show CPU utilisation by all running tasks | CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS |
| sock-dump | sock-dump | List all active sockets | LWIP IPv4 |
| heap-trace | heap-trace <start|stop> [buffer_size] | Start or stop heap tracing (default buffer: 200 records) | CONFIG_HEAP_TRACING |
Time
| Command | Usage | Description |
|---|---|---|
| local-time | local-time | Show current local time on the device |
| tz-set | tz-set <tz_string> or tz-set posix <posix_tz_string> | Set timezone |
Enabling the Console
-
Enable the console in
menuconfig:- Component config → ESP RainMaker → Enable serial console
-
Call the init function before
esp_rmaker_start():esp_rmaker_console_init(); -
Connect via serial (e.g.,
idf.py monitor) and typehelpto list available commands.
Optional Command Groups
Some command groups require additional Kconfig options:
- Parameter commands (
set-param,update-param,get-param): EnableCONFIG_ESP_RMAKER_CONSOLE_PARAM_CMDS_ENABLEfor local parameter testing. - Command-response (
cmd): EnableCONFIG_ESP_RMAKER_CMD_RESP_ENABLEfor command-response module testing. - Challenge-response (
chal-resp-enable,chal-resp-disable): EnableCONFIG_ESP_RMAKER_CONSOLE_CHAL_RESP_CMDS_ENABLEfor 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?.