Introducing the Tiny Home Area Network Stack

TinyHAN MQTTIn 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.


5 thoughts on “Introducing the Tiny Home Area Network Stack

  1. Mike Post author

    RFM69W (and variants) yes, but probably not for RFM12B simply because I don’t have any and they’re going obsolete anyway.

  2. nunzio

    Hi Mike,
    many thanks for your sharing,
    I’m very interested to IoT and mqttsn, so tinyHAN sounds good to my ears 🙂
    I have a good knowledge of the stm32 environments and so I was wondering if I can help from the “gateway” side..

  3. Mike Post author

    I had to take the Redmine part of the site offline because it was crashing the server. I will be copying the content over to the main site, but I haven’t had time yet. You can still find the documentation in the Github repo.

Leave a Reply

Your email address will not be published. Required fields are marked *