Command Execution

The Command Execution feature allows you to send commands to devices and view the results in real-time.

Sending Commands to Devices

  1. Navigate to the Device Management page

  2. Select one or more devices from the device list

  3. Click the Open Command Terminal button

  4. Enter your command in the terminal

  5. Click Send Command

Command Terminal

The Command Terminal provides a console-like interface for sending commands and viewing results:

Command Input

The command input area consists of:

  • Command: The command to execute on the device(s)

  • Parameters (optional): Additional parameters for the command in JSON format

Command History

The command history section displays:

  • Command: The command that was sent

  • Status: The current status of the command (PENDING, SENT, COMPLETED, FAILED)

  • Result: The output of the command (if available)

  • Timestamp: When the command was sent

Command Status

Commands can have the following statuses:

  • PENDING: The command has been created but not yet sent to the device

  • SENT: The command has been sent to the device but not yet executed

  • COMPLETED: The device has successfully executed the command

  • FAILED: The device failed to execute the command

Command Results

Command results are displayed in the command history section. The result format depends on the command type:

  • Shell Commands: The standard output and error of the command

  • System Commands: Structured data in JSON format

  • Package Commands: Success/failure status and details

Command Execution Flow

  1. Command Creation: The command is created in the dashboard

  2. Command Delivery: The command is sent to the device via MQTT or HTTP

  3. Command Execution: The device executes the command

  4. Result Reporting: The device sends the result back to the dashboard

  5. Result Display: The dashboard displays the result in the command history

Command Timeout

Commands have a default timeout of 60 seconds. If a device does not respond within this time, the command is marked as FAILED with a timeout message.

Command Logging

All commands are logged in the system for audit purposes. The logs include:

  • Who sent the command

  • When the command was sent

  • Which devices received the command

  • The command status and result