What is MQTT?
In this post, I’m going to tell you what MQTT is, how it can be used for IOT Applications and how to fetch data from Ubidots cloud using MQTT protocol.
MQTT stands for Message Queuing Telemetry Transport. MQTT is an easy to use lightweight protocol which can be used for fetching or pushing data to or from devices. MQTT is basically a publish and subscribe system where you can publish a message or a value as a server and at the same time receive messages as a client.
Applications of MQTT
MQTT is a perfect solution for IoT applications. MQTT can be used to read data from the sensors and store it in the cloud or make the data available to other devices across the word.
You can control a device in your home such as a fan or a light bulb from the home network or even from an online global dashboard.
Using Ubidots widgets, it is very easy to implement your very own IoT system using MQTT. You can create a dashboard which consists of various types of widgets which can be used to get or write data to and from the server, gather information from the sensors with in your home or industrial environment and monitor/control your devices from your mobile or a webpage.
Advantages of MQTT
The main advantage is that, MQTT makes it very easy to establish connection between various devices simultaneously and fetch/push data to and from various IOT devices.
Since it is a lightweight protocol, we can effortlessly integrate in all environments and send/receive data using connections with very low bandwidth without much of a delay.
Working of MQTT
Some terms to Understand
Publish -> Publishing means simply making data or messages available to other devices.
Subscribe -> Subscribe to a particular message to receive the message from the publisher.
Messages are the information (data or command) that are exchanged between the devices.
Broker is the device that stands in between the Publisher and Subscriber that will take care of all the communication.
Topic Specifies where you want to publish your messages (kind of like URL).
Using the publish/subscribe system you can do pretty much anything you could ever want it in your own home automation projects.
MQTT communication Example
For example if you’d like to turn on a lamp in your meeting room of your office, you would publish a message (ON) to a topic (office/meetingroom/lamp).
If the lamp is subscriber to the same topic, it will receive the message, ON and the lamp will turn ON.
Ubidots provides a simple and secure method for sending and receiving data to and from IoT devices using the global cloud network in real-time. Ubidots provides a firm platform for hobbyists, enthusiasts as well as professionals, enabling them to easily retrieve and use the sensor data around the world and turn it into something useful.
We can use the Ubidots platform to send various sensor values or other data to the cloud, store it there safely and retrieve them anytime we want using simple API calls.
In the next part, I will show you how you can connect Arduino and Ubidots using MQTT. Stay Tuned!
New to Robotics?
We have a beginners guide on “Getting Started with Robotics” which will give you a kick start in this field. Check out our free video tutorial below for a brief introduction.
Top Arduino Projects You can Try this Summer Vacation
Top Robotics Projects You can Try this Summer Vacation
Did you find this page useful? Help us to improve by rating this page.