Blazor will run on a RPi! Can even create and build it there… And access GPIO. How about remotely accessing RPi’s GPIO via a Blazor WebAssembly App?

Ok, so this brings me to the end of “A Month of Blazor”. Nine blog posts this month on the topic but its time to get back to my normal domain, IoT. But before I do, I thought I should do some Blazor on a Raspberry Pi so here goes:

I have previously created a standard Blazor app on a RPi running IoT-Core and running Raspbian. That is on Windows and Linux Operating Systems on the the apps were created, built and run on the Pi as well as build on a dev machine and published via a file share. The apps were just a proof of concept. Having got to the end of this month I thought could I build and run something more complex on the RPi using Blazor?

I did a search and found there were some good examples including a BlazorBlinky:

I particularly like the discussions about using the Pi remotely using Blazor to read sensors, flash LEDs etc.

More on this later but I was able to get remote access to Blazor running on the Pi.

NB: I am using a RPi 3B:

  • Manually copied .NET Core 3.1 SDK to the device and set the path to it plus one other required enviroment variable
  • I edit files in VS Code on the device from my desktop via a share (I open the share on the desktop with VS Code).
    • I also copy files to the Pi using the file share
  • For interactions I use Remote-Desktop-xrdp

A while back I explored .NET Core IoT Libraries which implement .NET Core connectivity to various sensors and actuators on suitable hardware such as the Raspberry Pi. I also used it with Azure IoT Hub:

    "Iot.Device.Bindings"
    "System.Device.Gpio"

The functionality demonstrated there as a Console app includes:

  • Led and Button press
  • Temperature with BME280 sensor
  • Temperature and Humidity with DHTxx sensor
  • Temperature and Humidity with DHT22 sensor using 1-Wire
  • LED driven by Software PWM
  • H-Bridge Motor using L293D

I’m now working on morphing DNETCoreGPIO into a .NET Core library and then redraft the app from there into a Blazor app.
Watch this space for updates.

Nb. I also mirrored some of that functionality on the Azure Sphere here and here but no .NET Core capability there.


 TopicSubtopic
  Next: > Nuget Packages 101
<  Prev:   Blazor
This Category:Blazor
  Next: > Blazor A WASM app for presenting Sample Apps from an API Repository 
<  Prev:   Blazor