Close

MQTT-SN

A project log for Iota: Internet of things for all

A low cost Internet of things platform to build your own smart house

nathanandrewwilliamsnathan.andrew.williams 08/19/2014 at 09:350 Comments

The difficulty with writing software to communicate between different systems is that each system needs to be able to understand the other.

If you send specific messages, the code on both sides needs to know how to understand those messages.

This causes a problem when you want to start sending new messages that you didn’t plan for before.

You would have to go and update the code everywhere before you can send it.

MQTT-SN

The solution is to provide a common messaging format, and Iota uses MQTT-SN.

MQTT-SN is a version of MQTT designed for sensor networks where nodes have limited processing and memory.

MQTT provides a “publish & subscribe” model and allows new message types to be created on the fly without needing special code ahead of time.

Publish & Subscribe

The Publish & Subscribe model is a flexible messaging design which allows nodes to publish (send) any message they like, and to subscribe to messages they are interested in.

MQTT uses a “topic id” for this which might look like:

/bedroom/master/temperature

With the above topic id, a temperature sensor in the master bedroom would publish the current temperature, maybe every few minutes.

The sensor doesn’t know or care if anyone wants to know, it just keeps publishing.

These messages go to a “message broker” who handles receiving and sending of messages.

Other nodes might subscribe to the above topic id, and will get a copy of the message whenever it is published.

Discussions