Every time an IoT developer starts thinking about choosing an operating system for a new device, there are a myriad of options available to muddy the waters. Many are from well-known providers, like FreeRTOS from Amazon and Azure RTOS from Microsoft or Zephyr RTOS from Linux, and they each have a number of features that are aimed at helping IoT developers make the most of their IoT device designs. So how do you know which RTOS to choose?
Let’s start by taking a look at the roles an RTOS needs to fulfill in IoT and then zero in to discuss how FreeRTOS and Azure RTOS in particular can each fulfill those roles in different ways.
What Is an RTOS in IoT?
The world of IoT needs a high level of speed, reliability, and energy efficiency that isn’t guaranteed in a desktop computing environment. So whereas a typical desktop would use a full OS to run multiple applications and perform as many functions as necessary at any given time, IoT devices need a faster, simpler, and more efficient option. The answer is a real-time operating system, or RTOS.
Some of the main features of an RTOS are:
- Only performs one task at a given time
- Responds in near real time to commands
- Requires little processing power
These features make an RTOS ideal for a system on a small IoT device, like a smart watch or a proximity sensor in a smart security system.
However, an RTOS presents certain challenges. This is because IoT operating systems, unlike a traditional OS, are embedded. This means that, unlike on your personal computer, where you can upload and configure software with a few clicks, with an RTOS you don’t have an easy screen and user interface for tinkering with the system.
Since the process of adding software to an embedded system can be complex, the best RTOS providers supply an easy-to-use interface for simpler interaction with these systems. This is the goal of both FreeRTOS and Azure RTOS.
What Are the Differences Between FreeRTOS vs. Azure RTOS?
Let’s start with a brief overview of each option.
FreeRTOS was developed by Amazon to bring the concept of a lightweight RTOS to a whole new level with a greatly simplified system and limited feature set. That means FreeRTOS has pretty much the lowest amount of energy usage possible, and as a result, it’s great for low power IoT use cases.
Take for example an IoT system that has sensors spread across a wide area to collect weather data. Such an application would require thousands of sensors, and the last thing anyone would want would be to have to constantly change thousands of batteries. Reduced energy consumption and green functionality are important requirements that FreeRTOS can fulfill in a system like that.
While the feature-light and energy-light functionality of FreeRTOS has many advantages, including ease of use, low cost, and a low barrier of entry, there are also disadvantages. The lack of a comprehensive feature set makes FreeRTOS somewhat inflexible. Rather than being applicable to virtually any IoT use case, FreeRTOS is best suited for highly specific applications that require low computing power and don’t require a high degree of customization. Still, FreeRTOS is easy to use for newcomers to IoT development.
By contrast, Azure RTOS from Microsoft has an incredibly rich feature set. More than just a simple operating system, Azure RTOS is a full embedded development suite. The main tools of the suite include:
- ThreadX, which is the actual name of the RTOS
- FileX, which is a file allocation table designed for fast and predictable performance
- GUIX Studio, which is a graphical user interface design environment
- TraceX, a Windows-based analysis tool that provides a graphical visualization of system events
- NetX, an implementation of TCP/IP protocol standards for embedded applications
Azure RTOS also prioritizes interoperability, flexibility, and high performance, making it ideal for more processing-intensive IoT use cases. However, the variety of features and high customizability create a tougher learning curve for developers.
Finally, both Threadx and FreeRTOS are open source and free to use, and both are easy to integrate with any cloud platform, like AWS or Azure Cloud.
Should I Choose Azure RTOS or Freertos for my IoT needs?
Both of these RTOS options are incredibly popular. In fact, FreeRTOS gets downloaded around once every three minutes, and Azure RTOS has been used for over 10 billion devices around the world. You only need to consider which is ideal for your particular use case.
FreeRTOS is lightweight and simple to use for new developers. It’s best for IoT devices that require little data processing power and where latency isn’t a huge issue. By contrast, Azure RTOS is best for more experienced developers who require a high degree of customizability. It’s also good for use cases that require a little more processing power or highly specific functionality.
Nabto and RTOS in IoT
There are ways to overcome some of the downsides of each of these RTOS options and expand the number of possible use cases. For example, FreeRTOS may experience latency due to more limited processing capabilities. When integrated with AWS, FreeRTOS can also have security issues, and the same goes for Threadx when integrated with Azure Cloud. These security issues stem from the fact that communication sent from the IoT device to the client device generally has to pass through the cloud, meaning the data can potentially be intercepted by third parties. That detour through the cloud also increases latency, especially in a low processing power environment.
Nabto helps solve this issue by enabling P2P communication between the IoT device and the client device. Since all data remains on the client device, it is encrypted end-to-end, and latency is very minimal. And because the whole point of an RTOS is to achieve as close to a real time response as possible, this low latency is extremely important in many IoT applications.
When it comes to FreeRTOS vs. Azure RTOS, the truth is that both are solid options for embedded systems. While one might be more suited to certain IoT use cases than the other, they’re both predictable, well-documented, and high quality. So either way you go, you can be sure you’ll have a dependable RTOS for your IoT device.
Read Our Other Resources
We’ve also published a range of IoT device resources for our community, including:
- Our P2P explainer, which provides an understanding of the benefits of P2P connectivity in IoT
- The Top Microcontroller Series for Your IoT Projects, so you know how to choose the best MCU for your use case
- The 10 Best Development Boards for IoT in 2022 to show you what to look for in IoT dev boards