DotNet Core on Debian (Pocket Beagle and variants)

https://www.hanselman.com/blog/InstallingTheNETCore2xSDKOnARaspberryPiAndBlinkingAnLEDWithSystemDeviceGpio.aspx

So first thing is to download:

sudo apt-get install curl libunwind8 gettext
wget https://download.visualstudio.microsoft.com/download/pr/9650e3a6-0399-4330-a363-1add761127f9/14d80726c16d0e3d36db2ee5c11928e4/dotnet-sdk-2.2.102-linux-arm.tar.gz
wget https://download.visualstudio.microsoft.com/download/pr/9d049226-1f28-4d3d-a4ff-314e56b223c5/f67ab05a3d70b2bff46ff25e2b3acd2a/aspnetcore-runtime-2.2.1-linux-arm.tar.gz

Then extract

mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-2.2.102-linux-arm.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
tar zxf aspnetcore-runtime-2.2.1-linux-arm.tar.gz -C $HOME/dotnet

You should then be able to do dotnet info

dotnet --info

Another major tool is WinSCP. This will allow you to automatically sync changes from the build folder directly to the linux device in realtime. As soon as you build the project the files get copied, and can be run on the device via the command line. You don’t need to publish everytime.

(To be continued)

Ok so it turns out there is a problem with System.Device.GPIO

Some SoCs have more than one GPIO bank. For these we gave more than one entry in /dev/:
/dev/gpiochip0, /dev/gpiochip1 … /dev/gpiochipX

This patch add a method to return how many GPIO banks the hardware have.

From Add a Method to select default GPIO bank (#346) · dotnet/iot@74c0ee8 · GitHub

But this feature seems to not have made it to the nuget package as yet. I guess we’ll have to wait to flash that led. :thinking:

In the mean time if you want to see the list of pins and their name and assignments you can run this command on the pocket beagle:

gpioinfo

On RPI the command seems to be

gpio readall

Exactly my point. This is very promising but not a complete story just yet.

look at their repo… they (community) are start to port device driver…

click here

The RPI CM3(+) has two banks and GpioController enumerates bank0 and bank1. If you get Device.Gpio from myget.org feed you have daily builds. I was advised one month ago about the commit of the modification.

Now LibGpioDriver() accept a gpio chip number.

Myget isn’t free so its not a viable alternative to just waiting till they publish a version with the modifications.

You can freely use as nuget source: https://dotnet.myget.org/F/dotnet-core/api/v3/index.json
This contains lot of prerelease, including System.Device.Gpio and Iot.Device.Binding 19251.2 (May 1st) that contains the commit you refer to.

1 Like

I guess the next task will be for someone to write an abstraction layer for the PocketBeagle, and other beagle bone variants.

I mostly use Unosquare libs for Rpi .net core, but this is an abstraction on WiringPi with some limitation. At the moment there’s no unification of gpio and peripheral abstraction. Something will happens in the near future I think.