In this session delivered at NDC London 2021 I talk about how you can control a 3D printed Robot Arm with a Raspberry Pi, .NET 5, Blazor and SignalR.
You can find the github repo and workshop instructions here;
https://bit.ly/dotnet5robotarmrepo
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
Building a Raspberry Pi Robot with .NET 5, Blazor and SignalR - NDC London 2021
1. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Building a Raspberry Pi
Robot Arm with .NET 5,
Blazor and SignalR
PETE GALLAGHER
PETECODES.CO.UK / PJGCREATIONS.CO.UK
28/01/2021
2. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
About Me
Pete Gallagher
@pete_codes / @PJGCreations
www.PeteCodes.co.uk
www.PJGCreations.co.uk
Pete@PJGCreations.co.uk
IT Consultant, Microsoft Certified Trainer & Azure MVP, Pluralsight Author
Decades of Desktop, Web & Embedded Software experience,
Meetup Organiser,
STEM Ambassador, Code Club Organiser … Gadget Addict
Father of two inquisitive girls
3. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
What we’re going to be doing…
.NET 5
Installing .NET 5
Hello World(s)
Raspberry Pi GPIO and the Circuit
Basic GPIO control
Device Bindings and Driving Servos
Blazor and SignalR
Final Demo
Q&A
4. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
.NET 5
5. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
.NET 5
INFRASTRUCTURE
.NET STANDARD
.NET is a software development platform
DESKTOP WEB CLOUD MOBILE GAMING IoT AI
6. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
What’s new in .NET?
Open Source and Cross Platform (Including the Pi)
C#9 Language Features
Records
Init Only Properties
Pattern Matching
Top Level Programs
System.Text.Json
James Newton-King
7. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
.NET Ecosystem Momentum
> 1.5M
.NET Core Developers
In Visual Studio
#1 Most Loved
Framework
.NET Core
Top 30
Highest velocity OSS Projects
github.com/dotnet
github.com/aspnet
Top 5
Language on GitHub
C#
7x
Faster than Node.js
ASP.NET Core
40%
New to .NET are students
dot.net download survey
Build 2020 – Journey to one .NET - https://www.youtube.com/watch?v=ctSqiD8BGPM
8. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Install
9. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Install
Single Line Install
wget -O - https://raw.githubusercontent.com/pjgpetecodes/dotnet5pi/master/install.sh | sudo bash
10. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Demo 1
Console App
11. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
.NET Core & GPIO
12. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
System.Device.Gpio
Supports I/O, SPI, PWM, I2C
Supports Raspberry Pi, Beagleboard,
Hummingboard, Odroid etc
Supports Linux and Windows 10 IoT
Installs via the CLI or Nuget PM
https://www.nuget.org/packages/
System.Device.Gpio
13. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi GPIO
Board Numbering
BCM Numbering
14. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Circuit 1
Pin 10
Pin 26
15. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Demo 2
Hello World (Again!)
16. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Iot.Device.Bindings
Support for
BME280 Temp / Humidity Sensor
MCP23xxx I/O Expander
Explorer Hat
Sense Hat
Servos
Much more…
https://www.nuget.org/packages/
Iot.Device.Bindings
17. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Circuit 2
18. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Servo Control Board
Pin 25
Pin 35
Pin 13
Pin 12
19. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Servos
Control
Power
Ground
20. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Servos
21. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Demo 3
Servo Demo
22. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Blazor
23. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
“Blazor is a single-page app
framework for building
interactive client-side Web
apps with .NET”
Scott Hansleman
Blazor
24. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Blazor
Started Life as Steve Sanderson’s Pet Project
Web UI Framework based in C#
Replaces JavaScript
Razor and HTML
Server Side or Client Side WebAssembley
Client Side .NET with no plugins
Support in most modern Browsers
https://bit.ly/pjgblazor
25. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
SignalR
26. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
“ASP.NET SignalR is a library for
ASP.NET developers to add real-
time web functionality to their
applications”
Wikipedia
SignalR
27. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
SignalR
Open Source
Created by David Fowler
and Damian Edwards in 2011
Enables Bi-directional
Real-Time communications
Supports;
Web Sockets
Server-Sent Events
Long Polling
https://bit.ly/pjgsignalr
28. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Demo 4
Drive the Arm!
29. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Uno Platform
30. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
The Uno Platform is a Universal
Windows Platform Bridge that
allows UWP-based code to run on
iOS, Android, WebAssembly, Mac &
Linux
Uno
Uno Platform
31. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Uno Platform
UWP – XAML – C#
Created by Jérôme Laban
Open Source & Cross Platform
Uno Platform 3.0 – UnoConf
WinUI 3
Skia and GTK for Linux UI (Preview)
https://bit.ly/pjgunoplatform
32. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Raspberry Pi Demo 5
UI with UNO!
33. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Links
GitHub and Workshop
https://bit.ly/dotnet5robotarmrepo
C# 9 + Dot Net 5
https://bit.ly/pjgdotnet5announcement
Installing Dot Net 5 on the Raspberry Pi
http://bit.ly/dotnet5pi
Dot Net GPIO Nuget Package
https://www.nuget.org/packages/System.Device.Gpio
Dot Net IoT Device Bindings Source Code
https://github.com/dotnet/iot/tree/master/src/devices
3D Printed Robot Arm – From the presentation
https://www.thingiverse.com/thing:1015238
3D Printed Robot Arm - Workshop
http://bit.ly/pjgrobotarmparts
34. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Links
Blazor
https://bit.ly/pjgblazor
MatBlazor
https://www.matblazor.com/
Awesome Blazor
https://github.com/AdrienTorris/awesome-blazor
SignalR
https://bit.ly/pjgsignalr
Uno Platform
https://bit.ly/pjgunoplatform
35. THURSDAY 18TH FEBRUARY
FROM 18:30 GMT ON ZOOM!
Terence Eden
The Connected House of Horrors
Peter Shaw
Building your own USB Gadgets with .NET
37. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Twitter
@pete_codes / @PJGCreations
Email:
pete@pjgcreations.co.uk
Website:
https://www.petecodes.co.uk
https://www.pjgcreations.co.uk
Notts IoT:
https://www.nottsiot.co.uk
Dot Net Notts:
https://www.dotnetnotts.co
Notts Dev Workshop:
https://www.nottsdevworkshop.co.uk
LATi:
https://www.lati.org.uk
Agile Engineering Podcast:
https://agileengineeringpodcast.com/
Azureish Live:
https://www.twitch.tv/azureishlive
Contact Me
Slides: https://bit.ly/pjgndc2021
38. Building a Robot Arm with Raspberry Pi, .NET 5, Blazor & SignalR – Copyright Pete Gallagher 2021 – @Pete_Codes
Contact Me
Pete Gallagher
@pete_codes / @PJGCreations
www.PeteCodes.co.uk
www.PJGCreations.co.uk
Pete@PJGCreations.co.uk
Editor's Notes
.NET is an entire software development platform that takes care of a lot of the heavy lifting for you when you want to build an application. Applications frameworks help you build the specific types of apps or workloads and enable you to literally build any app for any platform with any operating system. Each .NET workload shares a common infrastructure and .NET Standard library. This means not only are your .NET skills portable, but your actual code is portable no matter what you’re building. This makes it easy to share reusable components (called libraries) across the breadth of applications people build.
Additionally, there are a broad set of development tools that makes it really productive to write, debug, build and manage code bases.
See: www.dot.net
Build 2020 – Journey to one .NET - https://www.youtube.com/watch?v=ctSqiD8BGPM
https://insights.stackoverflow.com/survey/2019#technology-most-loved-dreaded-and-wanted-loved3
github.com/cncf/velocity
octoverse.github.com
www.techempower.com/benchmarks/#section=data-r18&hw=ph&test=plaintext
Each PWM Channel is created passing in;
The Chip Number
The PWM Channel
The Frquency
Optionally, the Duty Cycle Percentage
We also then create two ServoMotor objects, passing in;
The PWM Channel we'll be using
The Maximum Angle of the Servo - We're using a 180 degree Servo, so we pass in 180 here
The Minimum Pulse Width
The Maximum Pulse Width
Blazor replaces javascript and runs C# on the client side directly in the browsers with no plugins needed.
Blazor Server – Works as a web Server (Shipped)
Blazor Web Assembly (May 2020)
Blazor Renders HTML, but Blazor Native but can render to other things like Native Controls for Mobile.
Blazor replaces javascript and runs C# on the client side directly in the browsers with no plugins needed.
Blazor Server – Works as a web Server (Shipped)
Blazor Web Assembly (May 2020)
Blazor Renders HTML, but Blazor Native but can render to other things like Native Controls for Mobile.
Originally developed as a pet project by Steve Sanderson at Microsoft, Blazor is Web UI Framework which is based on C#, Razor and HTML. Blazor compiles down to WebAssembly, which makes it super (or blazingly) fast (Hence the Razor with a “B”).
Blazor allows developers to write client side .net… You may say “Oh, like Silverlight?”… Nope, no plugins needed… It’s just supported natively in most modern browsers.