This topic is for advances users only. More information about MQTT protocol can be found on https://mqtt.org/ and Wikipedia.

Slideshow contains an MQTT client, which can connect to remote a MQTT broker via internet connection and receive commands. Setup of the connection can be done through the web interface – menu SettingsDevice settings – section MQTT. Reload the app after changing the settings in order to apply them. Current connection status can be found via menu InformationAbout deviceMQTT connection state.

Communication

Communication via MQTT is asynchronous, Slideshow is listening for commands from external system. Once the command arrives, Slideshow executes it and returns response on another topic.

Four MQTT topics are used for the communication with each device, the names are based on the device’s MAC address (without colons):

  • SLIDESHOW/REQ/macAddress/SHELL – request from server to the device to execute shell command
  • SLIDESHOW/RESP/macAddress/SHELL – response from the device to the shell command
  • SLIDESHOW/REQ/macAddress/API – request from server to the device to execute API call
  • SLIDESHOW/RESP/macAddress/API – response from the device to the API call

Example communication

Device with MAC address 01:02:03:04:05:06 is used in all examples bellow.

Execute shell command

Request topic: SLIDESHOW/REQ/010203040506/SHELL
Request message: getprop ro.serialno
Response topic: SLIDESHOW/RESP/010203040506/SHELL
Response message: {"command": "echo test", "success": true, "result": { "result": 0, "stdout": "test\n", "stderr": "" }}

Move to the next file

Request topic: SLIDESHOW/REQ/010203040506/API
Request message: {"operation": "next"}
Response topic: SLIDESHOW/RESP/010203040506/API
Response message: {"command": "next", "success": true}

Display file on screen

Request topic: SLIDESHOW/REQ/010203040506/API
Request message: {"operation": "showFile", "parameters": {"panelName": "Whole screen", "file": "sample1.jpg", "length": 5}}
Response topic: SLIDESHOW/RESP/010203040506/API
Response message: {"command": "showFile", "success": true}

Supported commands

Move to the next file:
{"operation": "next", "parameters": {"panelName": "Whole screen"}}

Display file on the screen:
{"operation": "showFile", "parameters": {"panelName": "Whole screen", "file": "sample1.jpg", "length": 5}}

Display custom HTML content on the screen:
{"operation": "showSentHtml", "parameters": {"panelName": "Whole screen", "length": 5, "html": "<strong>Sample bold text</strong>"}}

Switch to different playlist:
{"operation": "playlist/set", "parameters": {"panelName": "Whole screen", "playlist": 1}}

Clear set playlist:
{"operation": "playlist/clear", "parameters": {"panelName": "Whole screen"}}

Get device info:
{"operation": "deviceInfo"}

Toggle fullscreen view for main panel
{"operation": "fullscreen/toggle"}

Get list of panels:
{"operation": "panels"}

Set volume:
{"operation": "volume/set", "parameters": {"vol": 5}}

Panel name in the parameters is optional, if no panel name is set, the operation will be performed on the main panel.