Device Management - Technical Overview
The Devices Module (DevicesModule) is the heart of the digital signage system. It is responsible for:
- Device registration and authentication (Pairing).
- Real-time communication (MQTT/WebSocket).
- Status monitoring (Heartbeat).
- Remote command execution (Reboot, Refresh, Screenshot).
Pairing Process
- Auto-Register: The application sends a request to
/api/devices/auto-registerwith a unique hardware identifier. - Identification Code: The server generates a temporary Pairing Code and sends it to the device.
- User Confirmation: The user enters the code in the management interface.
- Key Exchange: After confirmation, the server issues a permanent
deviceIdand 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:
- Is the device connected to the network?
- Is the Mosquitto service on the server active? (
docker ps | grep mosquitto) - Is port 9001/1883 open in the Firewall?
Commands Not Executing
If a command (for example, screenshot) was sent but not executed:
- Check the command log in the DB (
CommandHistory). - Ensure the device is listening to the correct Topic.
- Check the MQTT message queue in Grafana.