Prologue
Two years ago I started working on Aquila, a Domotics and Internet of things platform aimed at easing prototyping, development and testing of ideas with connected devices.
At that time, the whole "Internet of things" idea was relatively new, new IoT platforms where appearing trying to become the default platform for that type of devices.
However, each one of those platforms was incompatible with the others, some being better for some things than others, being more or less useful depending on the application.
Aquila 1.0 was created integrating open technologies and standards like 802.15.4, aiming at being a viable alternative for developers. Aquila successfully reached its original objectives, however, integrating it with other technologies is not easy and could be not flexible enough for some applications.
The Internet of things matures
During that time, another technology was becoming popular in the IoT world: a protocol named MQTT, this is not a new technology, it was created by IBM in 1999, but it turned out to be ideal for IoT applications due to its simplicity and lightness.
MQTT is based on the Publish - Subscribe concepts; Clients are connected to a server called "Broker", and can publish in certain "Topics" or subscribe to them.
Example of the workings of MQTT, Source: http://www.hivemq.com/
For example, lets say that we have two clients, one is a temperature sensor that publishes on the topic "sensor1/temperature", and the other is a screen that subscribes to the same topic. When the sensor publishes that we are at 24ºC, the screen gets that value immediately and can, for example, display it.
MQTT doesn't define the lower network layers, like the frequency, modulation, packets, etc. Instead, it runs over TCP networks, this is good because it's easily implementable on any TCP/IP network and can be integrated on mobile applications and web services. Nevertheless, this makes it harder to implement in simpler sensor networks.
Now, there is a specification called MQTT-SN - MQTT for sensor networks -, this specification is very interesting because it allows us to integrate embedded devices with any MQTT network, without losing the advantages of that sensor network, like low power usage, and surpassing it's limitations, like the limited computation power of a microcontroller.
MQTT-SN Architecture, Source: MQTT-SN spec v1.2
MQTT-SN seemed to me as the solution for interoperability between sensor networks. Aquila 2.0 had to integrate it.
There are few implementations of this specification, and I couldn't find any complete open source one. That's why I decided to implement it for Aquila 2.0.
Aquila 2.0
Characteristics of Aquila 2.0:
- Ideal for low power networks
- MQTT all the way via MQTT-SN
- Sleeping nodes support according to MQTT-SN spec
- Security by default (using radio encryption features when available)
- Easy and flexible implementation
- Interoperability between different wireless networks via MQTT
Aquila 2.0 consists of:
- MQTT-SN Gateway
- Bridge (Firmware)
- Wireless nodes (Firmware and MQTT-SN libraries)
Aquila 2.0 Architecture
The nodes implement the MQTT-SN support in firmware and are connected wirelessly to the Bridge. The Bridge transmits every message to a PC (or micro-pc like Raspberry Pi) via serial communication or USB. The PC runs the Gateway, it is in charge of: 1. Managing the devices (pairing, addressing, buffering of messages for sleeping nodes, MQTT topics, and more) and 2. Translating messages from and to your favorite MQTT Broker (like Mosca or Mosquitto).
This implementation aims to be as hardware independent as posible, this makes possible porting it to different boards, microcontrollers and radio transceptors in a relatively easy way.
Right now we have two hardware implementations:
Altair Pro
- Altair: The Aquila development board, Have you worked with Aquila 1.0 before? don't worry, update the firmware of your Altairs and they will be Aquila 2.0 compatible.
- Arduino with rfm69: There is a cheap and pretty...