RTOS in the IoT: Combating Complexity with Control

By Dr. Johan Kraft

CEO and Founder

Percepio

October 24, 2016

Story

RTOS in the IoT: Combating Complexity with Control

In the near future, almost everything will be connected to the Internet ­- at least, that's the vision for the Internet of Things (IoT). This vision...

In the near future, almost everything will be connected to the Internet ­– at least, that’s the vision for the Internet of Things (IoT). This vision belies the complexity behind it, because most of the communication will take place between the “things” in the IoT rather than people.

That’s relevant because people are really rather good at managing complexity. User interfaces have evolved to support this: keyboards have been such a successful common denominator for people and computers that they remain the default interface, while pointing devices and touch screens work intuitively from the perspective of the operator. Things – even intelligent things – may not be quite so good at managing the complex task of interfacing with other technology, except under strictly controlled conditions.

Invariably those strict conditions will translate into protocols – an approach that only works when all devices understand the protocol being used. The IoT will make use of many different kinds of protocols at the edge, particularly lightweight protocols that are suited to small, resource-limited devices. The job of getting data out of these edge devices and on to the “super highway” will fall to gateways, which are devices intended to manage local area networks of edge nodes including (but not be limited to) intelligent sensors and actuators.

Already the potential for complexity becomes apparent. Gateways may have many hundreds of nodes to manage locally, using multiple protocols, while being part of a wider area network. What makes this task even more challenging will be the nature of those nodes. Although imbued with some level of intelligence, it is unlikely that they will be aware of the local area network, and definitely not the wider area network that is the Internet; they may well see the world simply as them and the gateway. These ‘dumb intelligent’ sensors will need to communicate reliably with the gateway, not least because the gateway will have limited resources with which to manage all nodes.

Many nodes will be expected to operate for many hundreds of hours (if not years) on a single battery, perhaps even supplementing their power with harvested energy. To preserve energy, many of those nodes will likely spend most of their time in a deep sleep mode, waking periodically to check their own status, take measurements, and ultimately exchange data with the gateway. Coordinating many hundreds of resource-limited edge nodes on a network in this way will require accurate timing. Even with the extended periods of inactivity, this mode of operation describes a typical use case for an embedded real-time operating system.

An embedded RTOS today is less “software overhead” and more “essential component.” Even smaller and cheaper microcontrollers are able to run an RTOS, some of which take considerably less code space than engineers may expect. The system management features of a modern embedded RTOS can remove a lot of the complexity involved with developing an embedded device. A modern RTOS on an embedded microcontroller would typically be able to manage the device’s advanced power saving modes much more efficiently than code written by the developer. This efficiency extends to implementing communication protocols. Many of those being used in the IoT may already be provided as part of the standard middleware from RTOS suppliers, or available through their ecosystem partners.

Putting an RTOS into an IoT edge node will allow that node to more accurately control itself; reacting to network commands, periodically waking to check its status and collect data, or launch functions triggered by external events. Perhaps more importantly, it will be able to communicate with the gateway in a more reliable way, thereby maintaining a high level of network efficiency that will allow the gateway to better manage a large number of edge nodes.

The IoT is going to require a level of intelligence at the edge node that supports the inherent complexity. That intelligence will be best provided by using a small, efficient RTOS running on an advanced embedded microcontroller, supported by embedded software development tools that can make sure realizing the IoT is achievable, however large it gets.

Johan Kraft is founder and CEO of Percepio. Based in Sweden, Johan built the company up after his early days as an embedded software developer and even earlier academic work focusing on practical methods for timing analysis of embedded software.

Johan Kraft, Percepio

Dr. Johan Kraft is CEO and founder of Percepio AB. Dr. Kraft is the original developer of Percepio Tracealyzer, a tool for visual trace diagnostics that provides insight into runtime systems to accelerate embedded software development. His applied academic research, in collaboration with industry, focused on embedded software timing analysis. Prior to founding Percepio in 2009, he worked in embedded software development at ABB Robotics. Dr. Kraft holds a PhD in computer science.

More from Dr. Johan