System Management Actions
System Management Actions
Action Types
| Action | actionType | Description |
|---|---|---|
| ACTION_SYS_RESTART | 6 | System restart |
| ACTION_SYS_FACTORY_RESET | 7 | Factory reset |
| ACTION_SYS_NTP_SYNC | 8 | NTP time synchronization |
| ACTION_SYS_OTA | 9 | OTA upgrade |
Configuration Examples
Method 1: Web Interface Configuration (Recommended)
The peripheral execution page is shown below. System actions affect device state; verify trigger conditions carefully before saving to avoid accidental restart, factory reset, or OTA trigger.
Example 1: System Restart
Scenario: Restart the device 500ms after platform sends restart command
Configuration Steps:
Edit the rule in the Peripheral Execution Management page
Click the Add Action button
Fill in the action configuration:
Field Value Description Action Type Select System Restart Restart device Execution Delay 500Delay 500ms to let preceding actions complete Click the Save button
💡 Tip: System restart is forced synchronous execution; it is recommended to set a 500ms delay to allow MQTT messages to be sent
Example 2: Factory Reset
Scenario: Factory reset after button long-press for 10 seconds
Configuration Steps:
Edit the rule, add an action
Fill in:
- Action Type: Select Factory Reset
- Execution Delay:
0
Click Save
⚠️ Warning: Factory reset will reset all configuration files to default values (device.json, network.json, protocol.json, users.json, peripherals.json, periph_exec.json, rule_scripts.json). WiFi credentials will be erased. After restart, the device enters AP mode. This operation is irreversible!
Example 3: NTP Time Synchronization
Scenario: Timer-triggered NTP time sync
Configuration Steps:
Edit the rule, add an action
Fill in:
- Action Type: Select NTP Time Sync
Click Save
💡 Tip: Daily time point trigger mode requires successful NTP sync to take effect
Example 4: OTA Upgrade
Scenario: Trigger OTA after platform sends upgrade command
Configuration Steps:
Edit the rule, add an action
Fill in:
- Action Type: Select OTA Upgrade
Click Save
💡 Tip: OTA upgrade requires network connection and pre-configured OTA server address
Method 2: JSON Configuration File Import
Complete Rule Example
Button Long-press 10 Seconds Factory Reset
{
"id": "exec_factory_reset",
"name": "Long Press Factory Reset",
"enabled": false,
"execMode": 0,
"triggers": [
{
"triggerType": 4,
"triggerPeriphId": "btn1",
"operatorType": 0,
"compareValue": "",
"timerMode": 0,
"intervalSec": 60,
"timePoint": "",
"eventId": "button_long_press_10s",
"pollResponseTimeout": 1000,
"pollMaxRetries": 2,
"pollInterPollDelay": 100
}
],
"actions": [
{
"targetPeriphId": "",
"actionType": 7,
"actionValue": "",
"useReceivedValue": false,
"syncDelayMs": 0,
"execMode": 0
}
],
"protocolType": 0,
"scriptContent": "",
"reportAfterExec": false
}Precautions
- Synchronous Enforcement: System restart and factory reset actions are forced synchronous execution, not entering the async queue
- Irreversible: Factory reset will reset all user configurations to default values; use with caution
- Reset Content:
device.json- Restore default device name and NTP configurationnetwork.json- Clear WiFi credentials, restore AP mode (SSID:fastbee-ap, password:admin123)users.json- Restore default admin accountprotocol.json- All protocols disabledperipherals.json- Clear peripheral configurationperiph_exec.json- Clear execution rules
- Pre-restart Delay: Recommended to set syncDelayMs to allow MQTT messages to be sent before restart
- OTA Prerequisites: OTA requires network connection and a valid upgrade server
