Embedded systems in IoT are expected to be run by reliable, resource-efficient software. Devices on the edge are typically required to communicate with central nodes, and in some setups with each other, constituting a distributed system. The Erlang language, favored for its constructs that support building fault-tolerant, distributed systems, offers solutions to these challenges. Its dynamic type system and higher-level abstractions enable fast development, while also featuring tools for building highly available and fault-tolerant applications. To study the viability of using Erlang in embedded systems, we analyze the solutions the language offers, contrasting them with the challenges of developing embedded systems, with a particular focus on resource use. We measure the footprint of the language’s constructs in executing tasks characteristic of end devices, such as gathering, processing and transmitting sensor data. We conduct our experiments with constructs and data of varying sizes to account for the diversity in software complexity of real-world applications. Our measured data can serve as a basis for future research, supporting the design of the software stack for embedded systems. Our results demonstrate that Erlang is an ideal technology for implementing software on embedded systems and a suitable candidate for developing a prototype for a real-world use case.
Hot code loading allows changing the server code without any noticeable effects for clients. It is an integral part of the Erlang language and the BEAM runtime. Handling code change scenarios has to be developed into the application and requires care from the developer. This paper presents static analysis-based code checkers for detecting code errors which could impede performing hot code loads in Erlang applications. Our work analyses some specific erroneous patterns that impede a hot code load when migrating server states between code versions.
Validating IoT systems can be simplified by abstracting the source code interfaces responsible for communication. Edge devices often use different communication methods than those available during development. By using a uniform source code interface for different communication methods, a programmer can conveniently change communication functions used during development to those available in production. In our paper, we present EMoL (Erlang Messaging and Monitoring over LoRa), a software layer for communication, specific to wireless embedded devices, developed in the Erlang programming language. This layer implements the same interfaces as default Erlang functions, allowing developers to abstract communication and validate fault tolerance before deploying to actual devices.