Table of Contents

Programming with the Use of Scripts

 General audience classification icon  General audience classification icon  General audience classification icon
Several programming models for IoT script programming are available. Depending on the hardware model used (SoC or OS-based MCU), it may involve single script execution (e.g. Raspberry Pi Pico RP2040, Edge-class IoT) or multithreaded, parallel, multiple scripts, doing multiple tasks (e.g. Raspberry Pi 4, Fog-class IoT). The idea and model of the scripting programming for SoC class devices (edge) were presented in the chapter Script Programming with Middleware.
In the case of far more powerful, Fog-class IoT devices that are OS-based devices, a variety of programming languages and, thus, scripting interpreters are available.

Among others, the most common scripting languages for fog class devices are :

Bash scripting

As Bash scripting is well covered by many manuals for Linux, in the following chapters, we focus on two others: Python and C#. Moreover, accessing the GPIO in the case of the bash requires installing external tools; thus, it does not apply to IoT programming straightforwardly but rather as a supplementary tool to automate tasks other than core programming.

Python

Python programming for IoT devices is dual:

C# .NET

When writing this publication, the .NET framework with C# interpreter is available only for Raspberry Pi devices as a part of the Windows IoT operating system [1]. It is a niche, still fully functional and solid solution. Its newer versions are available only as a commercial product, however.

In the following chapters there is a brief introduction to programming with scripts for IoT devices in Python and C#: