MQTT Client
Please note, in order to use Sensors and Sensor events, Premium (ENTERPRISE) license is required.
Requirements
- Android application with version 4.0.394 or higher.
- Windows application with version 4.0.87 or higher.
- JSCore application with version 4.1.760 or higher.
JsCore devices are only able to open connections to the broker through WebSocket.
- Ensure to configure your broker accordingly.
Setup & Configuration
- Navigate to Devices menu, then select the device where you want to use utilize the connection.
- Open the device settings by clicking on the icon
OR
- Click on the device card, then Select Settings tab
- Find sensor settings, then set the following sensor configuration:
{
  "services": [
    {
      "uid": "mqtt_1",
      "type": "MQTT",
      "settings": {
        "port": 1884,
        "rules": [
          {
            "pattern": "id\"\\s*:\\s*\"?([^\"{}]*)\"?\\s*,\\s*\"event\"\\s*:\\s*\"?([^\"{}]*)\"?\\s*,\\s*\"value\"\\s*:\\s*\"?([^\"{}]*)\"?",
            "idGroupIndex": 1,
            "eventGroupIndex": 2,
            "valueGroupIndex": 3
          }
        ],
        "topic": "wallboard/#",
        "address": "mqtt://192.168.1.175"
      }
    }
  ]
}
Mqtt over WebSocket
If you want to use the Mqtt over WebSocket use this configuration
{
  "services": [
    {
      "uid": "mqtt_1",
      "type": "MQTT",
      "settings": {
        "port": 8884,
        "path": "mqtt",
        "rules": [
          {
            "pattern": "id\"\\s*:\\s*\"?([^\"{}]*)\"?\\s*,\\s*\"event\"\\s*:\\s*\"?([^\"{}]*)\"?\\s*,\\s*\"value\"\\s*:\\s*\"?([^\"{}]*)\"?",
            "idGroupIndex": 1,
            "eventGroupIndex": 2,
            "valueGroupIndex": 3
          }
        ],
        "topic": "wallboard/#",
        "address": "ws://192.168.1.175"
      }
    }
  ]
}
Do not add the 
/ character at the start of the path parameterAuthentication
If you have configured your broker to authenticate client you can include your credentials in the configuration
{
  "services": [
    {
      "uid": "mqtt_1",
      "type": "MQTT",
      "settings": {
        "port": 1884,
        "rules": [
          {
            "pattern": "id\"\\s*:\\s*\"?([^\"{}]*)\"?\\s*,\\s*\"event\"\\s*:\\s*\"?([^\"{}]*)\"?\\s*,\\s*\"value\"\\s*:\\s*\"?([^\"{}]*)\"?",
            "idGroupIndex": 1,
            "eventGroupIndex": 2,
            "valueGroupIndex": 3
          }
        ],
        "topic": "wallboard/#",
        "address": "mqtt://192.168.1.175",
        "password": "exmaplePassword",
        "username": "exampleUsername"
      }
    }
  ]
}
Status Reporting
You can configure the device to periodically (every two minutes) send messages to a topic of your choosing.
That includes information about the status of the device (detailed below).
{
  "services": [
    {
      "uid": "mqtt_1",
      "type": "MQTT",
      "settings": {
        "port": 1884,
        "rules": [
          {
            "pattern": "id\"\\s*:\\s*\"?([^\"{}]*)\"?\\s*,\\s*\"event\"\\s*:\\s*\"?([^\"{}]*)\"?\\s*,\\s*\"value\"\\s*:\\s*\"?([^\"{}]*)\"?",
            "idGroupIndex": 1,
            "eventGroupIndex": 2,
            "valueGroupIndex": 3
          }
        ],
        "topic": "wallboard/#",
        "address": "mqtt://192.168.1.175",
        "password": "exmaplePassword",
        "username": "exampleUsername",
        "sendDeviceStatus": true,
        "deviceStatusTopic": "wallboard"
      }
    }
  ]
}
Status Message format
{
    deviceId: string; //Device's ID in Wallboards system
    serverStatus: boolean; //Weather the devuce is able to connect to the server
    battery: number; //Battery percentage of the device (if it has one, otherwise 0)
    wifiDbm: number; //Wifi strength in Dbm (if connected, otherwise 0)
    wifiLevel: number; //Wifi strength in Level (1-5) (if connected,otherwise 0)
    startCount: number; //Number of applications starts in the last metrics cycle
    crashCount: number; //Number of applications crashes in the last metrics cycle
}