Functional Programming for the Internet of Things: A Comparative Study of Implementation of a LoRa-MQTT Gateway Written in Elixir and C++

Networks for the Internet of Things typically use a gateway to provide connectivity between a low bit rate, low capability sensor network and the broader Internet. The gateway can be subject to very high traffic loads, many concurrent processes and needs to be highly reliable. Functional programming...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Veröffentlicht in:Electronics (Basel) Jg. 13; H. 17; S. 3427
Hauptverfasser: Branch, Philip, Weinstock, Phillip
Format: Journal Article
Sprache:Englisch
Veröffentlicht: Basel MDPI AG 01.09.2024
Schlagworte:
ISSN:2079-9292, 2079-9292
Online-Zugang:Volltext
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
Beschreibung
Zusammenfassung:Networks for the Internet of Things typically use a gateway to provide connectivity between a low bit rate, low capability sensor network and the broader Internet. The gateway can be subject to very high traffic loads, many concurrent processes and needs to be highly reliable. Functional programming languages such as Erlang and Elixir have proven to be an effective programming paradigm for such scenarios, notably in large-scale telecommunications switches. In this paper, we report on our experience of developing a gateway between a LoRa network and an MQTT broker using the functional programming language Elixir and the more conventional language C++. To obtain an understanding of this approach to development, we first developed an initial prototype on a single-board computer using Elixir. We then developed the same system in C++ and ran experiments to compare the two systems’ performance. In order to understand the performance of such systems on low-end IoT devices, we then developed the same system on a low-cost ESP32 micro-controller in both C++ and Elixir. We were able to run the Elixir-based system on an ESP32 micro-controller but found that its performance was significantly poorer than the same system written in C++. We conclude that functional programming has great potential for the development of IoT systems, but work needs to be carried out to improve the supporting libraries and underlying virtual machines. We also note that learning to program in a functional programming language has quite a steep learning curve.
Bibliographie:ObjectType-Article-1
SourceType-Scholarly Journals-1
ObjectType-Feature-2
content type line 14
ISSN:2079-9292
2079-9292
DOI:10.3390/electronics13173427