MQTT Lab 3

 

https://aws.amazon.com/what-is/mqtt/ = MQTT Protocol

MQTT (Message Queuing Telemetry Transport) is a lightweight, publish-subscribe network protocol. It is designed for connections with remote locations. In 1999, Andy Stanford-Clark (IBM) and Arlen Nipper authored the first version of the protocol which was used to monitor oil pipelines with the SCADA industrial control system.


There are several moving parts in the MQTT Protocol. The broker acts as the central point between all communications. This component allows the publishers message to be distributed to all the subscribers of the topic. The topic acts like an ‘address’ which tells the publisher where to publish its messages, and the subscriber where to look for messages. An example of a topic would be “Home/Kitchen/Light” where the message may indicate if the light in the kitchen is turned on or off.

The publisher sends its messages (generally sensor data in the form of a JSON payload) which is then received by the broker. The subscriber receives the messages only from topics that it is subscribed to.

The objective of this lab is to set up the IoT MQTT panel so that we can send and receive messages from our Micro:Bits.



I set up several panels to monitor the data being transmitted from my Micro:Bit , and my class mates Micro:Bits. The ‘debug’ panel was extremely useful because it outputted the raw JSON payload being sent from the Micro:Bits so I could ensure that the payload is in the correct format. Along with this, I set up 2 gauges and 2 sliders. The ‘HRV 1’ Gauge and ‘HRV Slider’ are affected by the payload from everyone’s Micro:Bit whereas, the  gauge labelled ‘input 2’ and ‘slider input 2’ are only influenced by my Micro:Bit. The gauge allowed me to monitor the rotation of my Micro:Bit and the slider allowed me to send a signal (in the range of 0-255) to my Micro:Bit which was then displayed on the LED matrix.

 

I found this lab to be enjoyable. It was interesting to see the Micro:Bits communicating wirelessly with each other. If I could continue this lab, I would like to connect the HRV Sensor to the Micro:Bit to monitor heart rate using the ‘Line Graph’ panel on the MQTT app. It would be exciting to investigate other applications such as video and/or emailing,  I did find an article where somebody managed to send both a photo and video from a security camera when motion was detected.

https://davidmac.pro/posts/2021-07-21-files-over-mqtt/ = MQTT sending video + Images (using Python).

Comments

Popular posts from this blog

Blog 2 - HRV Demo

Week 1: HRV Review

Blog 5 - FFT & HRV