Azure IoT - Getting Started with Raspberry Pi
The Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python. It’s capable of doing everything you’d expect a desktop computer to do, from browsing the internet and playing high-definition video, to making spreadsheets, word-processing, and playing games. As a dev board it is also very handy for quickly connecting to various sensors for flexible prototyping.
Accompanying Video: Intro to Azure IoT with Raspberry Pi
If you were looking for Azure Sphere, go here
- Download Github Desktop
- Click on the green 'Clone or download' button, and copy the url. Note: if you download the ZIP file, you will miss out on any notifications of updates to the project. But, if you don't want the additional software on your machine, this option is will work fine.
- Open Github Desktop, click File -> Clone Repository -> Url tab -> Paste the url into the box -> specify the local folder to clone into -> hit 'Clone'
- If you'd like more information... Github Tutorial
These are not all required. I will show some of them in the video, but if you have tools you prefer that work just fine, by all means use what you like. All of these are freely available.
- Azure Device Explorer (Helpful if using IoT Hub)
- Visual Studio Community Edition
- VSCode is a cross-platform IDE
- SD Card Formatter
Getting Started with Raspberry Pi
If you want to follow an end-to-end guide on Azure Docs, feel free to skip this section. This is provided for those of you who want to work with Raspberry Pi on other things. It's a simple guide on getting up and running with Pi.
- Hardware Overview
- GPIO pins are your gateway to interacting with the "real" world. This site, Learn Robotics, has a good explanation of the hardware layout and pins
- Common starter dev/test Peripheral
- Sense Hat - One "hat" with multiple sensors built in
- Software / Setup
- Read the Easy SD Card Setup process to prepare your SD Card for installation
- Go to RaspberryPi.org and download the Raspbian OS image (zip file). Including an image labeled 'with Desktop' will provide a more familiar experience for those of you who enjoy graphical UI's
- Use Etcher to flash the OS image to the SD Card
- Connect a usb keyboard/mouse, and a monitor, then connect a micro-usb cable to the Pi for power
- Note: If you want to use a remote viewer after the initial install, Raspberry Pi's come installed with VNC Viewer. There just a little bit of configuration that has to be done first. Oh yeah, and you'll need a wifi or wired network connection ;)
- Done. Ready for sensors and coding fun!
Connecting the Raspberry Pi Simulator to Azure IoT Hub
The fastest way to get started with streaming data into Azure is using a simulator. Simulators give you a way to see what a test stream of data will look like as it passes through back end services.
Connecting the Real-world Raspberry Pi to Azure IoT Hub
The Raspberry Pi is now running a version of Linux. What this means for you is that you can now do basically whatever you want.
Here are a couple of guides you may be intersted in:
- Connect Raspberry Pi to Azure IoT Hub (Node.js)
- Connect Raspberry Pi to Azure IoT Hub (C)
- For Python, you will need the RPi.GPIO library mentioned here
- Azure IoT Hub get started with physical devices tutorials
Now that your device is sending data to Azure IoT Hub and/or IoT Central, you have an enormous amount of capabilities to add and explorer. Below are just a few of the most common data services typically used in IoT architectures.
I also want to point you do a great sample project on how to build a web app that displays real-time data from IoT, and how easy it is to add MFA.
Azure Portal: https://portal.azure.com
Azure Services Common in IoT Architectures
- Example Architecture Diagram
- Device Registration / Ingestion
- Integration & Visualization
- Disconnected Scenarios (Very cool stuff)
- Artification Intelligence
- 3rd-Party and Open source
Azure Solution Accelerators
- IoT Solution Accelerators
- Remote Monitoring
- Device Simulation
- Connected Factory
- Predictive Maintenance
Free Supplemental Learning Materials
- Microsoft Learn
- IoT School
- AI School
- IoT & AI Workshop
- Microsoft Professional Certification Programs Note: free if just learning, but there is a fee to receive certification upon completion
- Other edX Courses