In the past I have bemoaned the resource requirements and closed nature of “standard” RF protocols such as ZigBee and other 802.15.4 based specs. In the meantime low-cost radio modules like the RFM12B, RFM22B and the newer RFM69 series (all from HopeRF) have started to become the radios of choice in open source Internet of Things projects. The problem is that despite a tendency towards standards like MQTT and HTTP on the Internet side, there does not seem to have been any attempt to standardise on what goes over the air, leaving a situation where everyone uses the same radios but nothing can actually interoperate.
Tiny Home Area Network (TinyHAN) is an attempt to address this in the form of an Apache licensed, highly portable protocol suite for resource constrained embedded systems using cheap sub-GHz radio hardware. The software is written in portable C and uses a layered approach to enable interoperability even between devices using different radios. This initial release of the suite supports basic client/server topologies currently without security, but with authentication and encryption to be added in the near future. Various examples are included, as well as a GnuRadio based sniffing tool that can be used with an RTL-SDR dongle.
A key feature of the protocol is the ability to support two-way communication even with battery powered nodes that spend most of their time asleep. Even without significant power optimisation the included simple sensor example consumes around 80 uA average current while reporting its battery voltage every 5 seconds and still enabling remote control of an LED.
At the upper edge the stack is protocol agnostic. A lightweight binary name/value protocol is being developed as the preferred application layer, reducing the code complexity of sensor nodes to a bare minimum. In the current testing environment this TinyHAN Application Protocol layer is being mapped directly to MQTT topics by an STM32-based coordinator node running a port of the Paho MQTT client, FreeRTOS and LwIP – this code will be released in due course.
The result is a fully MQTT-enabled IoT sensor and control node in around 5KB flash, with all the Internet complexity moved to the coordinator which only needs to be paid for (and powered) once.
More information including a written protocol specification and download links can be found on the project page.