During the next couple of months, I’ll be sharing some amazing experiences around AI. Some of these experiences includes IoT devices like a Raspberry Pi, and of course some Machine Learning.Net (ML.Net). Because ML.Net is built with .Net Core, it makes sense to share the 5 simple steps you need to do to install .Net Core in a Raspberry Pi.
Of course, my 1st try was to navigate to the official .Net page (see references), which automatically detect my Linux distro and proposes a set of x64 SDKs.
I’m completely sure that I’m working in a 32 bits environment, however I’ll double check this with the following commands
sudo apt-get install lshw
After installing lshw I confirm that I’m in a 32 bit environment
Bonus: lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).
Now I need to navigate to the download page to download the specific Linux 32-bit version (see references).
Once I got the image downloaded its time to extract the file on a specific folder. I’ve created a folder named “dotnet” with the following command
sudo mkdir -p dotnet
And to extract the image from the Downloads folder
sudo tar zxf dotnet-sdk-2.2.401-linux-arm.tar.gz -C /home/pi/dotnet/
Let’s create a symbolic link to the extracted binaries
sudo ln -s /home/pi/dotnet/dotnet /usr/local/bin
And it’s done! Let’s invoke the .DotNet help command to test it
Now we can follow the steps of [.NET Core on Raspberry Pi, see references] to create a Console Application and to test the device.
To create a new console App
dotnet new console
And test the app
sudo dotnet run
We can publish the app for linux / raspberry pi
sudo dotnet publish -r linux-arm
And copy the generated folder to be used in another device
So next steps will be some other tests with Raspberry Pi and .Net Core. And the following image is a big teaser of this
Greetings @ Toronto
- .Net Tutorial Hello World https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install
- Download .Net Core https://dotnet.microsoft.com/download/dotnet-core/2.2#sdk-2.2.401
- GitHub .NET Core on Raspberry Pi https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md
- Get started with .NET Core on Windows/Linux/macOS using the command line https://docs.microsoft.com/en-us/dotnet/core/tutorials/using-with-xplat-cli
- Installing Visual Studio Code in a #RaspberryPi https://elbruno.com/2019/08/20/vscode-installing-visual-studio-code-in-a-raspberrypi-a-couple-of-lessons-learned-code/
- My ML.Net posts https://elbruno.com/tag/mlnet/