2.2. Demonstration: MQTT-based Application¶
2.2.1. Overview¶
The demo is an application that monitors sensor data and notifies on updates.
By default, the application monitors the module temperature and sends it to an MQTT topic.
The demo provides both a standalone and a sandboxed versions of the application:
- The standalone application is straightforward: the application is directly started on the module.
- The sandboxed application is divided in two parts:
- the kernel: the application to start on the module. It will scan the filesystem for a sandboxed applicaton and load it once detected. After that, it will scan the filesystem again and update the application when a patch file is detected.
- the sandboxed application: the application to deploy on the module filesystem. It will be dynamically loaded by the kernel.
The mono-sandbox demo shows off the cloud connectivity.
The multi-sandbox demo shows off the capability to dynamically deploy applications and update them with binary patches (small OTAP
payload). Here, the V1 of the application sends temperature in °C
while the V2 uses °F
.
Also, both demo uses the same application code which shows off the capability to decouple the application development from the
sandboxing and application lifecycle design.
2.2.2. MQTT client¶
The demo is compatible with any MQTT broker. Any MQTT client can be used to see messages.
Tested MQTT brokers publicly available on the internet:
- HiveMQ MQTT broker
- Host:
broker.hivemq.com
mqtt
port:1883
ws
port:8000
- Host:
- Mosquitto MQTT broker
- Host:
test.mosquitto.org
mqtt
port:1883
mqtts
port:8883
ws
port:8080
wss
port:8081
- CA certificate:
{Package}/config/mosquitto.org.crt
- Host:
Tested MQTT clients:
- HiveMQ Websocket Client:
use the
ws
/wss
port. - Mosquitto Pub/Sub: use the
mqtt
/mqtts
ports.