Changes

Jump to: navigation, search
no edit summary
{{InfoBoxTop}}
{{AppliesToSBCX}}
{{AppliesToAxel}}
{{AppliesToAxelEsatta}}
{{AppliesToAxelLite}}
{{AppliesToAxelEsattaAppliesToAXEL Lite TN}}{{AppliesToSMARX TN}}{{AppliesToSBCX}}{{AppliesToSBC Axel TN}}{{AppliesToVisualStudioCode}}{{AppliesTo VisualStudioCode 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.}}
The procedure illustrated here is based on [https://docs.microsoft.com/en-us/azure/iot-edge/how-to-deploy-modules-vscode this document], whose reading is highly recommended.
 
For more detailed information about Azure IoT Edge modules, please see [https://docs.microsoft.com/en-us/azure/iot-edge/iot-edge-modules this page].
==Setting up VSC==
</pre>
 
==What's under the hood==
For readers interested in the technologies underlying the Azure IoT Edge solution, it is worth remembering that modules are implemented as Docker containers. After deploying the ''Simulated Temperature Sensor'' module, for instance, it is easy to verify that a new container image is installed on the edge device:
<pre class="board-terminal">
armbian@sbcx:~$ sudo docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
mcr.microsoft.com/azureiotedge-simulated-temperature-sensor 1.0 a626b1a36236 4 weeks ago 200MB
mcr.microsoft.com/azureiotedge-hub 1.0 3a84bfb86c7d 4 weeks ago 252MB
mcr.microsoft.com/azureiotedge-agent 1.0 58276103181c 4 weeks ago 238MB
mcr.microsoft.com/azureiotedge-diagnostics 1.0.8 a480fa622e2a 4 weeks ago 7.34MB
</pre>
 
 
Similarly, one can use <code>docker</code> command line to verify that the ''Simulated Temperature Sensor'' module is listed among running containers:
<pre class="board-terminal">
armbian@sbcx:~$ sudo docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
145db7780bec mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0 "/bin/sh -c 'echo \"$…" 18 hours ago Up 17 hours SimulatedTemperatureSensor
200e8563544f mcr.microsoft.com/azureiotedge-hub:1.0 "/bin/sh -c 'echo \"$…" 18 hours ago Up 17 hours 443/tcp, 5671/tcp, 8883/tcp edgeHub
da40f11b4c33 mcr.microsoft.com/azureiotedge-agent:1.0 "/bin/sh -c 'echo \"$…" 10 days ago Up 17 hours edgeAgent
</pre>
 
 
The same information can be retrieved by using <code>iotedge</code> command line:
<pre class="board-terminal">
armbian@sbcx:~$ sudo iotedge list
NAME STATUS DESCRIPTION CONFIG
edgeHub running Up 17 hours mcr.microsoft.com/azureiotedge-hub:1.0
SimulatedTemperatureSensor running Up 17 hours mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0
edgeAgent running Up 17 hours mcr.microsoft.com/azureiotedge-agent:1.0
</pre>
 
 
It is also interesting to list the processes running inside the <code>azureiotedge-simulated-temperature-sensor</code> container:
<pre class="board-terminal">
root@sbcx:~# docker container top 145db7780bec
UID PID PPID C STIME TTY TIME CMD
armbian 2612 2586 0 10:24 ? 00:00:20 /usr/bin/dotnet SimulatedTemperatureSensor.dll
</pre>
 
The <code>/usr/bin/dotnet</code> file is an ARM executable ...
<pre class="board-terminal">
root@sbcx:/var/lib/docker/overlay2/b4cc9541e8175bae26aa42952490a0b2fcdd5895bfe18f8092b58c27531259b6/merged/usr/share/dotnet# file dotnet
dotnet: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=ef6dc8332270899ce1c7de629bdbcc95168fc710, stripped
</pre>
 
... while <code>SimulatedTemperatureSensor.dll</code> is a [https://en.wikipedia.org/wiki/Portable_Executable Portable Executable] file:
<pre class="board-terminal">
root@sbcx:/var/lib/docker/overlay2/b4cc9541e8175bae26aa42952490a0b2fcdd5895bfe18f8092b58c27531259b6# file merged/app/SimulatedTemperatureSensor.dll
merged/app/SimulatedTemperatureSensor.dll: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows
</pre>
 
 
 
Unfortunately, at the time of this writing, the official source code of the ''Simulated Temperature Sensor'' module was not available. The original repository was cloned [https://github.com/Warlib1975/azureiotedge-simulated-temperature-sensor here], however.
8,154
edits

Navigation menu