I tried MQTT for an IoT project:
Late last year, I decided to take on IoT, and with little experience in matters hands-on, it was an easy pick just for this exact reason-to build things on my own, so as to learn as much tech-packs and be as flexible as possible.
While the journey is slow, it gives me comfort to share what I encountered in my 1st major project called Smart street Lighting System which simply works by utilizing Pulse Width Modulation
LOGIC for the project
A Smart Street Lighting System would, as the name suggests, try to work with little or no human intervention, and mine is no different.3 key sensors implement that.
A combination of these 3 ensure a robust system, but unfortunately for my project, I implemented the 3 separately but still give a positive result.
The rest of the project documentation can be found on my github.
Where MQTT comes in:
My interest for this article is MQTT, which is basically a messaging protocol
I needed to send data obtained from several sensors through a protocol without much hustle. So what I needed is broker, in this case HiveMq and clients (in this case my sensor devices) ,as well as a topic in which the devices will subscribe and publish the data to.
The broker would then distribute the data to anyone subscribed to the topics. I used a client application to monitor the topics and data coming in.
Some of the cool things to note when using Mqtt include;
b)At least once (QoS 1)
c)Exactly once (QoS 2)
Researchers compared MQTT and HTTP on battery-powered devices. Result shows that; MQTT consumes 170 times less energy on 3G Networks and 47 times less energy on WiFi networks compared to HTTP. MQTT empowers IoT developers to build devices that stay connected for +10 years using a battery.
Well, to conclude ,it's clear there's much more to look into as far as MQTT is concerned and I hope to further explore this protocol for future projects.