The Complete Magazine on Open Source

Open source software you can use for IoT development

7.9K 1

The Internet of Things (IoT) is spread across various layers, with different types of software being used across them. This article presents a list of open source software packages which can be used in each of the layers.

You might have read Gartner and many other business forecasts on connected devices and IoT growth in the coming years. Billions of connected devices around us, as well as open hardware and software solutions, play a key role in enabling a smarter life in the near future. Before proceeding to the list of open source software in this field, let’s have a look at a few layers of the IoT architecture.

  • Layer 1 consists of end devices talking to the environment, which are also known as sensor nodes typically powered by microcontroller based targets, wearables and, sometimes, Linux boards.
  • Layer 2 consists of gateway devices, typically Linux powered target boards or handheld gadgets for interfacing end devices with cloud platforms and bridging protocols with their middleware support. High end microcontrollers with suitable frameworks can also be a choice here.
  • Layer 3 consists of servers, typically deployed on cloud platforms. They provide services like authentication, data collection, data processing, analysis, storage, visualisation, web integration, mobile app connectivity, etc. This may be further divided into various sub-layers or components.

Let us examine some open source choices for development in each layer.

Layer 1

Toolchains: GNU ARM Embedded Toolchain provides pre-built tool chains as well as source code for Cortex-M and Cortex-R processors, especially for bare metal code for microcontrollers. It has consistent releases in every quarter. The latest stable release is 2016 Q4, which ships with gcc v6.2 and is migrated to 64-bit Linux hosts, whereas the previous release of 2016 Q3 ships with gcc v5.4 and is available for 32-bit Linux. The GNU ARM Eclipse project provides Eclipse CDT extensions and support for popular targets like STM32 F series boards, and FRDM Kinetis KL series boards with C/C++ templates, using this toolchain as the backend. Most of these elements are licensed under GPL.

mbed OS: This is specifically designed for IoT needs with common C++ APIs for Cortex-M architecture from various families, and is licensed under Apache 2.0. It comes with an online IDE as well as offline components for development with support for various toolchains, IDEs (like Keil uVision, Eclipse, ARM GCC, IAR, etc) and rich libraries. It accelerates IoT development with good connectivity solutions for Ethernet, Wi-Fi, Bluetooth LE, Thread, 6LowPAN, LoRaWAN, Cellular and NFC.

Zephyr OS: This Linux Foundation Project is aimed at being a small, scalable, real-time OS for connected and resource-constrained devices, licensed under Apache 2.0. The recent release of v1.6.0 comes with a unified kernel, discarding the dual kernel (micro, nano) approach from previous releases. It can be a perfect choice for developers who are fond of Linux with its programming model for drivers, device interfaces and highly configurable services, all in a single address space.

Platform.io: This next generation IDE, with an ecosystem for IoT development, is based on the popular Atom editor with a cross-platform build system and library manager, licensed under Apache 2.0. It wraps popular frameworks like CMSIS, Arduino, mbed, Energia, ST Standard Peripheral Library and WiringPi, as well as supports native applications on Linux and Windows.

Arduino IDE, forks and add-ons: This open source physical computing platform has a simple IDE and coding style. Its power is rapidly getting enhanced by available add-ons for other families of boards, like for ESP8266, ESP32, the NRF5x series, etc. TI Enregia, a fork of Arduino, is available for popular TI launchpads like CC3200, the MSP series and Tiva Series, with rich support for board peripherals and IoT connectivity. Most of these elements are licensed under GPL v2.

Layer 2

NodeRED: This is a visual tool for wiring hardware peripherals and online services, licensed under Apache 2.0. It has a rich collection of nodes for sensor interfacing, local connectivity (serial, Wi-Fi, Bluetooth, etc), cloud connectivity (HTTP, mqtt, etc) and social media services. It can run on any OS with the Node.js runtime or in a Docker container. The latest Raspbian for Raspberry Pi and Debian for Beagle Bone Black ships with NodeRED, by default. It is also available from cloud hosted instances like IBM Bluemix, Sensetecnic FRED, etc. It can even communicate to Arduino-like targets using the Firmata protocol. Custom nodes can be built with ease using a Node.js backend and HTML frontend. It is a perfect choice for kickstarting IoT prototyping with zero or little programming effort.

Eclipse Kura: This is an OSGi based container providing various gateway services addressing M2M and IoT needs, licensed under Eclipse Public License – v1.0. Kura components are highly configurable through a Web console and can be done dynamically. Kura supports good connectivity like CANbus, Serial Bus, Bluetooth LE, cloud services via MQTT, etc, and even for hardware access using the OpenJDK Device I/O library. It aims at reducing the barrier between enterprise and embedded systems with a rich set of Java APIs.

Macchina.io: This is a toolkit for building embedded applications for IoT on top of POCO C++ libraries and the V8 JavaScript engine, licensed under Apache 2.0. The core is implemented in C++ for maximum efficiency and JavaScript is used for application development with its ease of programming. The foundation for macchina.io is Open Service Platform (OSP), which enables dynamically extensible, modular applications based on the powerful plug-in and services model similar to OSGi in Java.

Eclipse SmartHome and OpenHAB: Eclipse SmartHome is an OSGi based framework for smart home solutions. It provides a rich set of OSGi bundles for various services and a high degree of modularity. OpenHAB is a usable product design based on the SmartHome framework. It is vendor neutral and hardware/technology agnostic with automation software for rapid development of smart home solutions. Both are licensed under the Eclipse Public License – v1.0.

Iotivity: This Linux Foundation project is initiated by the Open Connectivity Foundation (OCF), formerly known as Open Interconenct Consortium (OIC), which comprises a group of companies including Samsung and Intel. OCF aims at seamless device connectivity and standardisation of communications for billions of devices. A reference implementation of this standard is released with features like powerful device management, resource management, services and security, as well as communication based on CoAP, and has been released under the Apache v2.0 License. This project also provides a few modules for building cloud services for interconnecting Iotivity clients.

Contiki OS and RIOT OS: These operating systems are designed for devices with constrained network and memory resources. They come with full IPv4 and IPv6 capable stacks and support low-power wireless standards such as 6LowPAN, RPL, etc, and protocol connectivity like CoAP. Contiki is licensed under BSD 3-Clause and RIOT under GPLv2.1.

The Cooja simulator provided by Contiki allows testing of application developments for large wireless networks with emulation of various hardware targets. RIOT is a user-friendly OS similar to Contiki and comes with additional offerings like a minimal footprint, C++ APIs, threading, and real-time capabilities with minimal low overheads.

Note: Even though some level of classification is done based on the design goals and primary usage, certain elements are used across layers, e.g., Contiki and RIOT can also be used in Layer1, mbed.org and Zephyr OS can be used in Layer 2, and so on.

Layer 3

Kaa IoT: Kaa is a multipurpose middleware platform for connected things and enabling end-to-end IoT solutions. It can be deployed on Amazon Web Services or your own server. A rich set of SDKs can be generated from a Kaa server with APIs in different languages for seamless device connectivity. It can integrate with many databases, data processing elements like Mongodb, Apache Spark, Cassandra, etc, with support for structured and unstructured data and messaging frameworks like Apache Kafka. It enables highly available servers with clustering support, thus reducing downtime and precluding single points of failure using Zookeeper support.

SiteWhere: This is an open platform for IoT with good protocol support and powerful device and asset management services, and is licensed under the Common Public Attribution License Version 1.0 (CPAL-1.0). It is designed as a multi-tenant system to host multiple applications in a single instance of deployment. Popular open source solutions like Apache Spark, OpenHAB and InfluDb/Grafana can be integrated by SiteWhere. It can be deployed on public clouds such as Azure, Amazon EC2, service providers based on Ubuntu Juju, Docker or your own server.

InfluxData TICK stack: InfluxData provides the TICK stack with four powerful components for time series data management. It is written in the Go language and licensed under MIT terms.
Telegraf is used for data collection and publishing metrics with the rich set of input, output and service plugins.

InfluxDb is a time series data base with high availability and high performance without any external dependencies (unlike other open source time series models like OpenTSDB based on Hbase or KairosDB based on Cassandra). It has good support for down sampling high precision data and data retention policies.

Chronograf is a visualisation tool for exploring data.

Kapacitor is used for data processing with alert management and ETL jobs.

Mosquitto: This is an Eclipse IoT project implementing a MQTT broker with v3.1.1 and v3.1 support for backward compatibility. It is licensed under the Eclipse Public License – v1.0 and EDL 1.0. It also provides client libraries and powerful reference clients. Popular cloud services like CloudMQTT are built on top of Mosquitto.

CloudFoundry: This open source PaaS platform is a Linux Foundation collaborative project and has been released under the Apache 2.0 License. It is available as a service from a few commercial providers like Bluemix or as an open source product to be deployed on one’s own servers. It supports the full life cycle of application development in various languages for IoT needs, and comes with good service support like data storage, messaging, application development and APIs for mobile apps.

Connectivity
Paho: This is an Eclipse IoT project offering MQTT clients, licensed under EPL v1.0 and EDL v1.0. It offers synchronous and asynchronous API mode in various languages like C, C++, Java, Python, Go, JavaScript, and .Net (C#). It also provides an Android service for building mobile apps and reference apps, which can be customised according to an application’s needs.

Eclipse Californium: This is divided into a few sub-projects. The core comes with the Java API model for the CoAP client and server design, and a few reference apps. It can be built as a Maven project and can be embedded in other Java applications. The Scandium sub-project implements DTLS 1.2 for secure CoAP. It also provides a proxy library and reference app for CoAP-HTTP bridging. These are dual licensed under EPL v1.0 and EDL v1.0.

Bluez and bindings: This is an official Linux Bluetooth protocol stack and comes with a user space library and tools. It supports various classical protocols like L2CAP, RFCOMM, SDP, etc, as well as LE protocols, profiles like GATT, and GAP. It has Python bindings via PyBluez and Node.js packages. Bleno and noble via npm are available for BLE advertising in peripheral mode and discovery in central mode. These node packages are built on top of Bluez.

CETIC 6LBR and Linux WPAN: 6LowPAN/RPL Border Router (6LBR) can interconnect end devices running on 6LowPAN with the Internet, by bridging the 802.15.4 network with IPv6 on the gateway side. It supports various 15.4-capable targets like OpenMote, TI CC25xx/26xx platforms and Linux hosts like Raspberry Pi, and can run in Bridge mode or Router mode. It is based on the Contiki project and licensed under similar terms.

Linux WPAN enables the 802.15.4 stack at the kernel level and user space tools for 6LowPAN based development on Linux.

Wireshark filters: Wireshark, a well-known network protocol analyser and packet generator, is licensed under the GNU GPL. It has rich filter supports for Internet protocols like MQTT, CoAP, HTTP, Websockets, etc. It can also analyse Bluetooth (classic, LE) packets and IEEE 802.15.4 traffic.

 

  • Danish Vasta

    Very useful article!