.NET Core on IoT: Using the PS Script to run Quickstarts on RPi (Raspbian)
iot powershell dotnetcore iothub azure iot-core devicestreaming telemetry raspbian
This copy-paste setup of .NET Core to run the Azure IOT Hub SDK Quickstart apps on a RPi running Raspbian is similar to the previous (simpler) post for IOT-Core but with a few caveats …
Set the IoT Hub up as previous on the development desktop, generate the environment variables and save them to set-env.sh in the Quickstarts folder. Accept the option when generating set-env to include the .NET Core DOTNET_ROOT variable as well as adding that to the System Path. Then just copy the qs-apps folder to the RPI via a share or via FTP. In a terminal on the Pi (eg. LXTerminal or via, say, Putty or Open SSH) in quickstarts folder run
source ./set-env.sh and you are ready to run the Quickstarts.
One caveat: set-env.sh has to be mangled a little before it is run as above. Run
source ./dos2linux.sh in the quickstarts folder, in the terminal first. This gets rid of some line ending issues. (You might want to
chmod +x the .sh scripts as they have to be rerun every time a new terminal is opened.)
the ps\qs-apps folder contains 2 folders:
quickstarts is the various pairs of IoT Hub apps as dicusssed previously link here
dotnet is where .NET Core is placed by get-iothub.
When setting up the dotnet folder with the get-iothub script on the desktop you need to choose linux-arm target for Raspbian on the RPi
Typically you would run just one of the Device Quickstarts on the Pi by running
dotnet run from within a Device project folder. You would then run the Service on, say, the dev desktop. Also, it has been found the only the device apps will run on the RPi anyway.
|This Category Links|
|Next: >||.NET Core on IoT||One more way of doing this - Background|
|< Prev:||.NET Core on IoT||Using the PS Script to run Quickstarts on RPi (IoT-Core) - Simpler|