15. MQTT
MQTT (Message Queuing Telemetry Transport) is a lightweight publish/subscribe messaging protocol designed for M2M (machine to machine) communication. MQTT is fast becoming one of the leading protocols for IoT (internet of things) deployments.
Thanks to MQTT support, EEZ BB3 can be easily and securely remotely monitored and controlled. Furthermore, EEZ BB3 can be integrated into existing IoT infrastructure.
For efficient and fast deployment, it is recommended to familiarize yourself with the basic terms of the MQTT protocol. An example of an interaction with EEZ BB3 via the MQTT description protocol is described below using the MQTT Explorer application which is available for free at https://mqtt-explorer.com/
Please note that topics are case-sensitive, i.e. <hostname>/system/exec/restart is not equal to <hostname>/system/exec/RESTART.
15.1. Set channel parameter using subscribe topic
1 |
Start MQTT Explorer and enter parameters for connection to your MQTT server (aka broker): Name, Protocol, Host, Port, Username and Password.
|
2 |
For example, if we want to set the output voltage on a channel, it will be necessary to type in the Publish section as topic <hostname>/dcpsupply/ch/<ch>/set/u. In this example, the hostname is bb3-zd and to set the output voltage on channel 2 it will be necessary to type as topic bb3-zd/dcpsupply/ch/2/set/u, set its value to 30 (type is json) and click on the Publish button.
|
3 |
The newly set output voltage value will be visible after the topic bb3-zd/dcpsupply/ch/2/umon is refreshed.
|
15.2. Drawing a topic graph
1 |
Select a topic of interest, and click the graph icon in the History section
|
2 |
The default settings graph will appear below the topic list.
|
3 |
Graph settings can be changed by selecting the settings icon.
|
15.3. Publish topics
15.3.1. System
Topic |
Description |
<hostname>/system/pow |
Returns 0 when EEZ BB3 enters standby mode, or 1 when in active mode |
<hostname>/system/event |
Latest message from the event log formatted as [<event_id>, <event_type>, <event_message>]. For example: [14011, "Info", "Ch2 output on"] |
<hostname>/system/pow/battery |
RTC battery voltage |
<hostname>/system/pow/auxtemp |
AUX sensor temperature |
<hostname>/system/pow/fan |
Cooling fan status and speed |
<hostname>/system/pow/total_ontime |
Total active time of the EEZ BB3 (MCU module). Resolution is 1 minute |
<hostname>/system/pow/last_ontime |
Duration since the EEZ BB3 was turned on. Resolution is 1 minute |
15.3.2. Dcpsupply
Topic |
Description |
<hostname>/dcpsupply/ch/<ch>/oe |
Status of the channel output |
<hostname>/dcpsupply/ch/<ch>/uset |
Returns set output voltage |
<hostname>/dcpsupply/ch/<ch>/iset |
Returns set output current |
<hostname>/dcpsupply/ch/<ch>/umon |
Measured output voltage |
<hostname>/dcpsupply/ch/<ch>/imon |
Measured output current |
<hostname>/dcpsupply/ch/<ch>/temp |
Measured channel temperature |
<hostname>/dcpsupply/ch/<ch>/total_ontime |
Channel total active time. Resolution is 1 minute |
<hostname>/dcpsupply/ch/<ch>/last_ontime |
Duration since the last on time. Resolution is 1 minute |
15.4. Subscribe topics
15.4.1. System
Topic |
Description |
<hostname>/system/exec/restart |
Sending 1 initiates EEZ BB3 restart |
<hostname>/system/exec/power |
Send 0 to enter standby mode, or 1 to return back |
<hostname>/system/exec/initiate |
Initiate trigger system by sending 1 |
<hostname>/system/exec/abort |
Abort trigger system by sending 1 |
<hostname>/system/exec/display/window/text |
Displays pop-up message on the EEZ BB3 display |
<hostname>/system/exec/display/window/text/clear |
Use to clear text message sent as described above |
<hostname>/system/exec/profile/recall |
Recall user defined profile by sending profile number (0 to 9) |
15.4.2. Dcpsupply
Topic |
Description |
<hostname>/dcpsupply/ch/<ch>/set/oe |
Sets channel output state: 1 to On or 0 to Off |
<hostname>/dcpsupply/ch/<ch>/set/u |
Sets output voltage |
<hostname>/dcpsupply/ch/<ch>/set/i |
Sets output current |