Skip to main content

Remote Device Control

This module allows administrators to perform operations on screens in real-time, without requiring physical access to the device. Communication is performed using WebSocket and MQTT to ensure speed (Low Latency).

Architecture

  1. Admin Client sends an HTTP request (POST /remote-control/:deviceId).
  2. Server verifies permissions and saves the command in DB (CommandHistory).
  3. EventsService distributes the command to the connected device via Socket.
  4. Device executes the command (for example, using Accessibility Service on Android).
  5. Device returns a response (ACK/result) to the server.
  6. Server updates the status in DB and returns a response to the client.

Supported Commands

CommandParametersDescription
RELOAD-Refresh the application (Reload JS Bundle).
RESTART-Restart the application.
SCREENSHOT-Capture screenshot and send to server.
WAKE_UP-Turn on the screen (Wake Lock).
SET_VOLUMElevel: numberChange volume level (0-100).
INSTALL_UPDATEversion: stringRemote application version update (OTA).

Troubleshooting

Accessibility Error

If the command fails with an Accessibility Service error, ensure that the accessibility service is enabled on the Android device for the GabaiSmart application. The service is required for operations such as swipe, tap, and screenshot on certain devices.

Timeout

The server waits for a response from the device for up to 30 seconds. If the device does not respond (for example, disconnected from network), the request will fail with RequestTimeoutException. You can check the connection status in Device Monitoring.