Skip to main content

Device Management - Technical Overview

The Devices Module (DevicesModule) is the heart of the digital signage system. It is responsible for:

  1. Device registration and authentication (Pairing).
  2. Real-time communication (MQTT/WebSocket).
  3. Status monitoring (Heartbeat).
  4. Remote command execution (Reboot, Refresh, Screenshot).

Pairing Process

  1. Auto-Register: The application sends a request to /api/devices/auto-register with a unique hardware identifier.
  2. Identification Code: The server generates a temporary Pairing Code and sends it to the device.
  3. User Confirmation: The user enters the code in the management interface.
  4. Key Exchange: After confirmation, the server issues a permanent deviceId and access certificate (or Token) for MQTT communication to the device.

MQTT Protocol

Devices communicate with the server using the MQTT protocol over WebSockets.

  • Broker: Mosquitto (running in Docker container).
  • Topics:
    • device/{deviceId}/command - Sending commands to the device.
    • device/{deviceId}/status - Status reports from device to server.
    • device/{deviceId}/telemetry - Performance data transmission (CPU, RAM).

Troubleshooting

Device Offline

A device is marked as Offline if no Heartbeat has been received for X minutes (configured in Config). Checks:

  1. Is the device connected to the network?
  2. Is the Mosquitto service on the server active? (docker ps | grep mosquitto)
  3. Is port 9001/1883 open in the Firewall?

Commands Not Executing

If a command (for example, screenshot) was sent but not executed:

  1. Check the command log in the DB (CommandHistory).
  2. Ensure the device is listening to the correct Topic.
  3. Check the MQTT message queue in Grafana.