One of, the most important aspects for an IoT solution, in my point of view, is device management, and more specifically the ability to receive over the air firmware updates (OTA). If OTA works, all other problems can be potentially solved.


My architecture in the [Air ex Machina] project, consists of the following layers:

  • backend, cloud based system. (e.g. airvantage)
    • gateway - integration platform (e.g. openhab on BBB)
      • sensor device (e.g. freeRTOS application on CC3200)


Cloud based systems are remote managed/updated by design, so the challenge is on the other layers. I have explored various approaches for solving this problem without having to reinvent the wheel, and I think it’s interesting to discuss the following ones:


  • Resin.io
  • Xen hypervisor / Mirage OS
  • Eclipse Kura, Leshan, Wakaama and lwM2M


Resin.io is a really cool startup, trying to solve both device managment problems and simplify code push / application update, on RPi/BBB/NUC hardware. They use docker containers to encapsulate the application on the end devices. I have been experimenting with their platform and it works great. So the idea here is that one could launch openhab on BBB as a docker container, through resin, and hence efficiently manage the gateway remotely.

I did not have time to test it, but I am guessing that a combination of these two should work:

https://registry.hub.docker.com/u/tdeckers/openhab/

https://registry.hub.docker.com/u/armv7/armhf-ubuntu/

By the way, resin and openhab are both partners of canonical on Snappy Ubuntu Core, so I expect to see great things coming from there..


A hypervisor could also be exploited to provide device management, running openhab within a VM. I think, this idea could work very nice with Intel NUC and VMware’s Hypervisor, but when going on a BBB (or lower) virtualization might not be so easy. However it seems with Xen this could be possible, since it does run on ARMv7 http://wiki.xenproject.org/wiki/Xen_ARMv7_with_Virtualization_Extensions

Xen has a very rich ecosystem so there must be many management tools/cloud fronts that could act as the manager-server which controls the BBB with the VM containing openhab. I am guessing that when a small change in a file takes place, a new VM image will have to get pushed, which is a disadvantage, but possibly Mirage (and Irmin?), might be able help in reducing the VM to only the necessary components of the OS along with the application. There is an interesting relevant project called http://nymote.org which might provide such solution in the future among with solving connectivity issues between devices. If this approach is adopted for IoT, there will definitely be an interesting debate on docker containers vs hypervisors :-)


Finally, one can solve device management for both gateway and microcontrollers, by utilizing some (new) Eclipse IoT projects which are designed exactly for that.

Here is a nice overview of what's available: End-to-end IoT solutions with Java and Eclipse IoT


Kura is a Java/OSGi-based framework for IoT gateways you should definitely check out. It basicly has (almost) all the features that I could ask, for remote managment. Has APIs for hardware communication (serial ports, GPS, watchdog, GPIOs, I2C, etc.), management of network configurations, communication with M2M/IoT Integration Platforms, and overall gateway management.

and there is support for beaglebone

http://eclipse.github.io/kura/doc/beaglebone-quick-start.html

https://eclipse.org/kura/downloads.php


Kura provides a web interface, were you can control your BBB and you can upload you application as an equinox OSGi bundle. So theoretically, if you load all the OSGi bundles of openhab in to it, you will be able to have openhab running within Kura. Not very practical though, so I hope Eclipse Smarthome takes Kura into account, (or vise versa) so we can have best of both worlds :-)


Going a layer lower at CC3200, two very promising eclipse projects which I am sure IoT developers will use in the future (when OTA becomes even more nessesary) are Eclipse Leshan & Wakaama. They are OMA Lightweight M2M (LWM2M) server/client implementations in Java and C.

This is how the Leshan web interface looks like:

68747470733a2f2f7261772e6769746875622e636f6d2f6d73616e676f692f6c657368616e2f6d61737465722f6c657368616e2d636170747572652e706e67.png


So one can have Leshan running on BBB, and wakaama running on CC3200 compiled together with the end application. This provides usefull data of CC3200 to BBB, but more importantly a mechanism for over the air updates, to the CC3200.
Unfortunately, there is no CC3200 port of Wakaama yet, but it should not be that difficult to port, so I guess it’s only a matter of time.


I definitely recommend looking in to Benjamin Cabé's blog, for more details: http://blog.benjamin-cabe.com/