This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:scriptingprogramming [2023/11/13 17:14] – pczekalski | en:iot-open:scriptingprogramming [2024/03/05 13:42] (current) – [Programming with the use of scripts] pczekalski | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Programming with the use of scripts | + | |
| + | ====== Programming with the Use of Scripts ====== | ||
| + | {{: | ||
| 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, | 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, | ||
| Among others, the most common scripting languages for fog class devices are : | Among others, the most common scripting languages for fog class devices are : | ||
| - | * Bash scripting (OS command scripting) usually does not provide support for the GPIO, intended to automate OS tasks; | + | * Bash scripting (OS command scripting) usually does not provide support for the GPIO, intended to automate OS tasks, |
| - | * Python scripting, cross-platform for both Edge-class devices (Micrpython) and Fog-class (regular Python, usually run on Linux); | + | * Python scripting, cross-platform for both Edge-class devices (Micrpython) and Fog-class (regular Python, usually run on Linux), |
| - | * C#, limited to the Windows IoT for Raspberry Pi; | + | * C#, limited to the Windows IoT for Raspberry Pi. |
| - | ==== Bash scripting | + | === 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. | 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 === |
| Python programming for IoT devices is dual: | Python programming for IoT devices is dual: | ||
| * Regular Python interpreter can be used in Fog class devices such as Raspberry Pi and its clones. In this case, the Python interpreter is run as a separate process in the Linux OS, the same way as in regular PCs. It has full access to the GPIO, however. | * Regular Python interpreter can be used in Fog class devices such as Raspberry Pi and its clones. In this case, the Python interpreter is run as a separate process in the Linux OS, the same way as in regular PCs. It has full access to the GPIO, however. | ||
| * Micropython is dedicated to SoCs and is distributed as the firmware that must be flashed into the device. Commonly, Micropython exposes serial communication on dedicated pins, exposing a Python console that looks similar to the command line Python interface in the PCs | * Micropython is dedicated to SoCs and is distributed as the firmware that must be flashed into the device. Commonly, Micropython exposes serial communication on dedicated pins, exposing a Python console that looks similar to the command line Python interface in the PCs | ||
| - | ==== C# .NET ==== | + | === C# .NET === |
| When writing this publication, | When writing this publication, | ||
| - | + | <WRAP excludefrompdf> | |
| + | In the following chapters there is a brief introduction to programming with scripts for IoT devices in Python and C#: | ||
| + | * [[en: | ||
| + | * [[en: | ||
| + | </ | ||