Choosing the tools for IoT development: languages, OSs, and connectivity channels
We’ll find out more about IoT development: what IoT is coded in, how to pick a programming language, and whether wires or Wi-Fi are more popular.
The Internet of Things (IoT) is the collective network where things and objects in the physical world can interact directly with each other without requiring human intervention.
Simple examples include a refrigerator that keeps track of milk and other products and orders them from the online store when they run out. It may also be a smart speaker connected to leakage, smoke, and other home devices and able to control and take readings from them.
A company that develops IoT devices and solutions often develops both the devices themselves as well as the software for all four levels of devices. Exceptions are companies that build individual sensors and devices for ready-made ecosystems and standards. We will hardly touch on hardware and various architectures – details about this side of IoT can be found in this video dedicated to microcontrollers.
IoT programming: how does it work?
Since the architecture of the Internet of Things consists of four levels, developers choose the technologies for programming for each of them. According to a December 2021 Eclipse Foundation study, the most popular languages in IoT are:
- The leaders in embedded devices and microcontrollers are C, C++, Java, and Python.
- For gateway programming, Python, C++, C, and Java are most often chosen.
- For server-side development, Python, Java, C++, and C are preferred.
Developing IoT devices is a standard process – there are no pitfalls, and the process is more or less predictable. The choice of a particular programming language most often depends on convenience and accepted standards, but security has almost no effect.
Python for IoT development
It is noteworthy that at the end of 2021, Python became the clear leader – although the year before, Java was at the top. By the way, this is an interesting trend: in the same TIOBE programming language popularity rating in 2021, Python finally managed to bypass Java and C, which are the undisputed leaders of the last decades.
Python is easy to learn and supported by a large, responsive community. Its syntax is clean and simple, which attracts a large number of programmers. Therefore, Python is often chosen by sociologists and biologists – to program laboratory devices. It is also the language of choice for one of the most popular microcontrollers on the market, the Raspberry Pi.
The growth in popularity of Python is quite understandable: it is a convenient and fast language in terms of writing code with a bunch of libraries for almost every task (it is especially strong in the field of machine learning and working with data), it interacts well with many programming languages (it is not without a reason that it is often called a “glue” across programming languages). In addition, devices are becoming more powerful every year and the issue of optimization is no longer as acute as the issue of the speed of development and delivery of software.
If the project is simple and does not require large computing power, you can use the standard Python libraries, but for microcontrollers, you should look at the MicroPython package – it is suitable for running Python on small boards with 256 KB of memory and 16 KB of RAM and an area of a couple of square centimeters.
Although it is quite obvious why Python’s position in the niche of microcontrollers and embedded devices is not so strong – there are much higher requirements for execution speed, energy saving, and economical memory consumption. Of course, in such conditions, Python and MicroPython are inferior to faster C, C ++, and Java.
The IoT has its own set of restrictions – for example, a one-kilobit Internet connection or a limit on the frequency of sending messages. Such limitations arise due to increased requirements for conserving resources – for example, it may be critical that your device can work for a conditional 100 years on one battery.
C++ for IoT development
The second place goes to the “pluses” – after all, thrill-seekers have not yet died out 🙂 It is often used on single-board computers like the Raspberry Pi – it is fast, like C, but development on it, as a rule, takes less time.
Java for IoT development
One of the main benefits of using Java is its portability and the ability to write code once and run it on any platform that supports the Java Virtual Machine (JVM). This makes it a great choice for enterprise solutions and projects that require security features, as it has a large set of libraries and tools for working with these.
Additionally, Java is an object-oriented programming language that has been optimized over the years for performance, making it a fast choice for executing code.
However, the most suitable programming language for a project depends on the specific use case. For example, if the goal is to monitor the filling of garbage cans in a city using sensors, it may be necessary to use a lower-level language like C or Java Embedded for embedded systems to ensure energy efficiency, as it may not be feasible to plug every trash can into an outlet or to replace batteries every few months.
C for IoT development
Yes, this old man remains a popular programming language, particularly in embedded systems and system programming. Historically, it has been widely used and has had a large code base, as well as being fast and able to interact directly with memory and hardware. C is often referred to as a “portable assembler” for this reason.
Overall, C’s versatility and performance make it a valuable tool in a variety of projects.
This language (as well as subsequent ones) is not at the top of the study, but it is often mentioned in connection with IoT. The feature of the language is that it was specially designed to support data description tools, it has a special Node.lua framework, that is, a port, or analog, of Node.js in the LUA world, and it is also built on a lightweight LUA interpreter.
Go has a rich standard library, and excellent concurrency out of the box, and its popularity in the world is constantly growing.
However, for low-level work, Go is practically not suitable. It handles data ugly, and using pointers is generally an outdated approach. In short, it is not suitable for working with protocols. Of course, even despite this, in such tasks, it is better than Java but much worse than C. And if you are afraid of the complexity of C and you are thinking about what to replace it with, better pay attention to Julia.
This is a special version of PHP for working with chips. Convenient for those who already know PHP and want to get into the Internet of things. Plus, this dialect out of the box has tools that are useful for developing IoT. In addition, over 90% of the servers in the world are still running on PHP, which is why this language is also popular in the Internet of Things development and is used to manage Linux-based microservices.
iOS developers use Swift to build smart device applications in the Apple ecosystem. The language has its libraries for the HomeKit platform, which provides support for integrating data feeds from a network of compatible devices.
What operating systems and connectivity channels are used in IoT
The use of operating systems, as in the case of programming languages, is determined by what part of the architecture you are working with (but you need to understand that for the level of microcontrollers and embedded devices operating system is an optional component).
In embedded devices, gateways, and microcontrollers, the most popular choice is Linux (mostly stripped down or specific versions – of the “regular” Linux, perhaps CentOS is more or less popular). Linux is a flexible and free operating system that can be “finished with a file” for almost any need, and can run on many different architectures. Plus, it has a huge community and a bunch of ready-made software for almost any task (except with Photoshop and Microsoft Office, but who needs them in IoT).
For everything that can be plugged into a power outlet, there is a Linux operating system. As a use case, there may be a definition of the safety of closing doors in a train. To do this, they use ordinary computers that are connected to the sensors by wire or with Bluetooth. For this system to work, you need full power and an Internet connection. Smart home applications can be written on anything – server rooms use firewalls, routers, and App Storage to download files. There are many open-source projects for writing applications, mostly built in PHP.
Linux is followed by FreeRTOS, a real-time operating system designed specifically for microcontrollers. So, it knows how to economically use even the most modest resources. A feature of real-time systems is that they guarantee in advance that the task will be completed within a specific time frame. That is, they work as predictably as possible, which is especially important for processing critical requests in the military or space industry, as well as wherever people’s lives or the performance of expensive equipment depend on accurate task processing to the millisecond. By the way, Linux can’t do that.
In third place by a wide margin is Windows. We all worked with payment terminals or ATMs, which often use the system from Microsoft. This is a closed and much less flexible system, and it is suitable only for those devices that have a lot of free resources.
In fourth place is Zephyr, another free real-time operating system designed specifically to work with embedded devices and microcontrollers.
Edge servers and the Cloud
However, for servers and in the Cloud, the situation is different – although the ranking still contains Linux (leads by a wide margin) and Windows. In addition, the Microsoft version of Linux, Azure Sphere, is quite popular. No wonder, as Azure is built on it, and this is one of the world’s leaders among Cloud platforms. Fourth place was modestly taken by FreeBSD, another free operating system that is traditionally considered more reliable and secure than Linux.
Among the connectivity channels, of course, the classic Ethernet is in the lead – wired, reliable, stable, and predictable. It provides the fastest speeds and can be almost “free” in terms of power consumption.
Of the wireless technologies, Wi-Fi is the most popular – it can be deployed relatively cheaply, you do not need to use base stations tied to telecom operators, it has excellent speed, and it can cover a relatively good distance.
Slightly less popular are cellular networks. Their advantage is that they are already on a bunch of smartphones, they can provide a good coverage area, and work over long distances. That is, they are convenient where there are no wires, and Wi-Fi simply does not provide coverage.
Bluetooth is in fourth place – it has a rather low data transfer rate, it is not so stable in operation, and it has serious restrictions on the distance between devices. But it is more economical in power consumption than Wi-Fi and cellular networks.
The world of IoT is our future, which means that the development of software for the Internet of things will become an increasingly popular occupation.
IoT solutions are typically divided into four levels: sensors that collect data, local gateways that transmit and facilitate data exchange, edge servers that store, accumulate, and process data directly where it is produced, and cloud infrastructure.
The programming languages most commonly used for IoT development are C, C++, Java, and Python, with Python becoming the clear leader in recent years. However, the most suitable programming language for an IoT project will depend on the specific use case and requirements. For instance, if you want to work with hardware and memory, pay attention to C/C ++.
If you need to set up or extend a development team for the IoT project, hire talented software developers from QIT Software. Send us a message, and let’s discuss your needs.
Subscribe to our blog
We are glad you’re interested in QIT! We'll let you know when appearing something