mqtt_11-658x464

This article guides you to build smart gateways by making use of e-con Systems™ eSOMiMX6 based development kit Ankaa. Nowadays everyone talks about Machine to Machine (M2M) communication and Internet Of Things (IoT) .

What is the idea behind M2M and IoT ?

The idea behind them is very simple – Data exchange between devices.

Since devices have the capability to exchange data between them, they have become smarter and intelligent. These smart devices have started enabling new business opportunities by connecting your devices, sensors, cloud services and data to create a network of everything.

The devices can vary from liquid level sensors, power line meters, phones, wearables, refrigerators, washing machines, microwave ovens, etc.

Before diving into how to develop a smart gateway application, lets try to understand what are the common challenges faced in IoT communication.

Challenges in IoT communication

In Machine to Machine communication and IoT, the interconnected devices are usually short range and low powered embedded devices where resources are scarce. This demands the protocol implemented for connecting the devices to be lightweight, easy, reliable and act smartly in using battery, CPU and bandwidth. This enables devices to do their main functions using available power for a longer time. Because of these demands the standard protocols over resource expensive Wi-Fi cannot be directly used in these devices.

This brought the need for creating new protocols which can cater the IoT communication requirements. One such protocol is MQTT.

MQTT


MQTT (Message Queuing Telemetry Transport)
was developed by Andy Stanford-Clark (IBM) and Arlen Nipper (Eurotech; now Cirrus Link) in 1999 for the monitoring of an oil pipeline through the desert. The goals were to have a protocol, which is bandwidth-efficient and uses little battery power, because the devices were connected via satellite link and this was extremely expensive at that time.

MQTT is a publish/subscribe messaging protocol for low power embedded so that they can operate for a long time. Publish/Subscribe is event-driven and enables messages to be pushed to clients. MQTT broker acts as a central communication point in charge of dispatching messages between the senders and the rightful receivers.

The central concept in MQTT is to dispatch messages as topics. Each client publishes a message to the broker by including a topic. A topic is a simple string that can have one or more hierarchy levels. The hierarchies are represented as path strings separated by a slash.

To demonstrate MQTT protocol we used e-con’s eSOMiMX6 device which acts as a broker and subscriber as well. The Publisher is a PC which requests to toggle the GPIO pin present on our eSOMiMX6 board. The broker (again eSOMiMX6) receives the message, filters them, decide who is interested in the messages and then send the message to the subscribed clients. The eSOMiMX6 toggles the GPIO pin based on the command from the publisher.

The setup was simple and took us less than 30 minutes.

Check this video:

And if you want to try this application on your eSOMiMX6 board please download the manuals, source code and binaries from our developer site and make your own IoT device.

For further assistance and queries please get in touch with sales@e-consystems.com