MQTT Front Connector
Overview
Allows the frontend client to publish and subscribe to a MQTT broker for a real-time user experience.
Can be combined with the official MQTT module which operates on the backend only (microflows).
Documentation
Description
Allows the frontend client to publish and subscribe to a MQTT broker for a real-time user experience.
Can be combined with the official MQTT module which operates on the backend only (microflows).
This module relies on “MQTT.js” bundled in javascript actions for nanoflows.
It requires a MQTT broker connection based on websocket “ws://” or “wss://”
Typical usage scenario
- real-time user experiences like dashboarding and warnings
- Multi-Concurrent-Experience between the screen (desktop app), IoT device in the hand of the user, and Alexa for voice control
- Cloud hosting of the backend and connection to local MQTT
Features and limitations
secured websocket not tested (v1.3.0)
User and password not tested (v1.3.0)
Dependencies
- mqtt (bundled using webpack)
https://github.com/mqttjs
Configuration
Just consumes the publish and subscribe activities in nanoflows.
The subscribe activity refers to a “onMessage” nanoflow. Please use the provided nanoflow template since the input parameters names are hardcoded in the javascript action.
The subcription can work on native mobile, fully independant from backend.
The challenge in implementation can be to maintain a unique subscription and avoid duplication, the options contextRegistered, subscriberContext and clientEnd allows you to alter the behaviors. See contextual comments for more guidance.
Watch the Studio Pro console “client”, eventually set the log level to trace.
Known bugs
- None