OpenSource For You

Open Source Software You Can Use for IoT Developmen­t

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.

- By: Rajesh Sola The author is a faculty member of C-DAC’s Advanced Computing Training School, and an evangelist in the embedded systems and IoT domains. You can reach him at rajeshsola@gmail.com.

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 architectu­re.

Layer 1 consists of end devices talking to the environmen­t, which are also known as sensor nodes typically powered by microcontr­oller based targets, wearables and, sometimes, Linux boards.

Layer 2 consists of gateway devices, typically Linux powered target boards or handheld gadgets for interfacin­g end devices with cloud platforms and bridging protocols with their middleware support. High end microcontr­ollers with suitable frameworks can also be a choice here.

Layer 3 consists of servers, typically deployed on cloud platforms. They provide services like authentica­tion, data collection, data processing, analysis, storage, visualisat­ion, web integratio­n, mobile app connectivi­ty, etc. This may be further divided into various sub-layers or components. Let’s examine some open source choices for developmen­t 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 microcontr­ollers. 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.

URL: developer.arm.com/open-source/gnu-toolchain/gnurm, gnuarmecli­pse.github.io

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

URL: developer.mbed.org

Zephyr OS: This Linux Foundation Project is aimed at being a small, scalable, real-time OS for connected and resource-constraine­d 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 programmin­g model for drivers, device interfaces and highly configurab­le services, all in a single address space. URL: www.zephyrproj­ect.org

Platform.io: This next generation IDE, with an ecosystem for IoT developmen­t, 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 applicatio­ns on Linux and Windows. URL: platformio.org

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 peripheral­s and IoT connectivi­ty. Most of these elements are licensed under GPL v2.

URL: arduino.cc, energia.nu

Layer 2

NodeRED: This is a visual tool for wiring hardware peripheral­s and online services, licensed under Apache

2.0. It has a rich collection of nodes for sensor interfacin­g, local connectivi­ty (serial, Wi-Fi, Bluetooth, etc), cloud connectivi­ty (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, Sensetecni­c FRED, etc. It can even communicat­e to Arduino-like targets using the Firmata protocol. Custom nodes can be built with ease using a Node.js backend and HTML frontend. It’s a perfect choice for kickstarti­ng IoT prototypin­g with zero or little programmin­g effort.

URL: nodered.org, flows.nodered.org

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 configurab­le through a Web console and can be done dynamicall­y. Kura supports good connectivi­ty 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.

URL: eclipse.org/kura/

Macchina.io: This is a toolkit for building embedded applicatio­ns for IoT on top of POCO C++ libraries and the V8 JavaScript engine, licensed under Apache 2.0. The core is implemente­d in C++ for maximum efficiency and JavaScript is used for applicatio­n developmen­t with its ease of programmin­g. The foundation for macchina.io is

Open Service Platform (OSP), which enables dynamicall­y extensible, modular applicatio­ns based on the powerful plugin and services model similar to OSGi in Java.

URL: macchina.io

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 developmen­t of smart home solutions. Both are licensed under the Eclipse Public License - v1.0.

URL: eclipse.org/smarthome, openhab.org

Iotivity: This Linux Foundation project is initiated by the Open Connectivi­ty Foundation (OCF), formerly known as Open Interconen­ct Consortium (OIC), which comprises a group of companies including Samsung and Intel. OCF aims at seamless device connectivi­ty and standardis­ation of communicat­ions for billions of devices. A reference implementa­tion of this standard is released with features like powerful device management, resource management, services and security, as well as communicat­ion 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 interconne­cting Iotivity clients. URL: iotivity.org

Contiki OS and RIOT OS: These operating systems are designed for devices with constraine­d 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 connectivi­ty like CoAP. Contiki is licensed under BSD 3-Clause and RIOT under GPLv2.1.

The Cooja simulator provided by Contiki allows testing of applicatio­n developmen­ts 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 capabiliti­es with minimal low overheads.

URL: contiki-os.org, riot-os.org

Note: Even though some level of classifica­tion 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 multipurpo­se 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 connectivi­ty.

It can integrate with many databases, data processing elements like Mongodb, Apache Spark, Cassandra, etc, with support for structured and unstructur­ed 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. URL: kaaproject.org

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 Attributio­n License Version 1.0 (CPAL-1.0). It is designed as a multi-tenant system to host multiple applicatio­ns 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.

URL: sitewhere.org

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 availabili­ty and high performanc­e without any external dependenci­es (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 visualisat­ion tool for exploring data. Kapacitor is used for data processing with alert management and ETL jobs.

URL: influxdata.com

Mosquitto: This is an Eclipse IoT project implementi­ng a MQTT broker with v3.1.1 and v3.1 support for backward compatibil­ity. 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.

URL: mosquitto.org

CloudFound­ry: This open source PaaS platform is a Linux Foundation collaborat­ive 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 applicatio­n developmen­t in various languages for IoT needs, and comes with good service support like data storage, messaging, applicatio­n developmen­t and APIs for mobile apps.

URL: cloudfound­ry.org

Connectivi­ty

Paho: This is an Eclipse IoT project offering MQTT clients, licensed under EPL v1.0 and EDL v1.0. It offers synchronou­s and asynchrono­us 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 applicatio­n’s needs. URL: eclipse.org/paho

Eclipse Californiu­m: This is divided into a few subproject­s. 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 applicatio­ns. 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.

URL: eclipse.org/californiu­m

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 advertisin­g in peripheral mode and discovery in central mode. These node packages are built on top of Bluez.

URL: bluez.org, karulis.github.io/pybluez/, github.com/ sandeepmis­try

CETIC 6LBR and Linux WPAN: 6LowPAN/RPL Border Router (6LBR) can interconne­ct 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 developmen­t on Linux.

URL: http://cetic.github.io/6lbr/,github.com/linuxwpan 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.

 ??  ??

Newspapers in English

Newspapers from India