{{AppliesToAxelEsattaAppliesToAXEL Lite TN}}{{AppliesToSMARX TN}}{{AppliesToSBCX}}{{AppliesToSBC Axel TN}}{{AppliesToIoT}}{{AppliesTo IoT TN}}
{{InfoBoxBottom}}
{{WarningMessage|text=This technical note was validated against specific versions of hardware and software. It may not work with other versions.}}
|August 2019
|First public release
|-
|1.1.0
|August 2019
|Added gateway ''patterns''
|}
==Introduction==
As stated in [[MISC-TN-005:_Running_AWS_Greengrass_Core_on_SBCSPG|this Technical Note]], nowadays several cloud platforms are available to implement advanced (Industrial) IoT systems.
This Technical Note illustrates how to use the [[:Category:SBC-AXEL|SBC Axel]] (SBCX for short) to implement a [https://docs.microsoft.com/it-it/azure/iot-edge/about-iot-edge Microsoft Azure IoT Edge]-enabled device. Thanks to its flexibility and to its rich set of I/O interfaces, the SBCX single-board computer can be leveraged to implement an IoT gateway with good processing power. This combination makes this board particularly suited for the applications where significant computations have to be [[MISC-TN-005:_Running_AWS_Greengrass_Core_on_SBCSPG#Introduction|deployed on the edge]].
[[File:Edge-as-gateway.png|thumb|center|600px|Gateway ''patterns'' as defined by Microsoft Azure (image source: [https://docs.microsoft.com/en-us/azure/iot-edge/iot-edge-as-gateway ''How an IoT Edge device can be used as a gateway''])]]
It is worth to remember that this Technical Note is not a step-by-step guide to set up the edge device and the cloud platform to implement an Azure-based system. Azure documentation is rich and detailed in this regard. Rather, this document aims to underline some specific SBCX-related steps required to run the Azure IoT Edge runtime on this device successfully. Nevertheless, in the following sections, several relevant links to the Azure documentation will be provided.
==Testbed configuration==
Regarding the hardware, the testbed used for this Technical Note (TN) consists of an SBCX single-board computer equipped with a quad-core i.MX6Q system-on-chip (SoC).
For what concerns software, the following configuration was used:
* Linux kernel: <code>4.9.11-xelk-4.0.0</code> (see [[Axel_Embedded_Linux_Kit_(XELK)#XELK_4.0.0|XELK 4.0.0]])
* Debian Strech root file system (armbian)
**The root file system is the same used for this [[MISC-TN-004:_Running_Debian_(armbian)_on_SBCSPG|TN]].
==Install the Azure IoT Edge runtime==
In essence, to install Azure IoT Edge runtime to the SBCX, the procedure described in the [https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux ''Install the Azure IoT Edge runtime on Debian-based Linux systems''] guide was followed.
===Linux kernel configuration===
The Azure IoT Edge runtime is released as a [https://www.docker.com/resources/what-container Moby/Docker container]. As such, the Linux kernel must be configured appropriately in order to provide all the functionalities required to support containerization.
Starting from the default configuration file (<code>imx_v7_axel_defconfig</code>), a new kernel configuration was set up providing all the required options. This configuration is available for download [http://mirror.dave.eu/axel/SBCX-TN-002/imx_v7_axel_iotedge_defconfig here].
To verify what options are missing, [https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh this script] is very useful. Some of the checked functionalities are relevant for x86 architectures, however.
===Root file system configuration===
After setting up the Linux kernel properly, issue the following command to mount the cgroupfs hierarchy.