Pi to Azure to Alexa

Overview

This project is about surfacing information from a Raspberry Pi through an Microsoft Azure infrastructure to an Amazon Alexa Skill. This could be an architecture that would support telemetry data collection over time by automating the collection, transport and storage of data from a Raspberry Pi. Maybe the most obvious example of a system like this would be a weather station that cyclically collects data from sensors.

pi-to-azure-to-alexa

Goals and Intentions

  • Use Windows 10 IoT Core on Raspberry Pi 3 to produce data.
  • Use Visual Studio and C# for all coding.
  • Use Microsoft Azure PaaS Infrastructure.
  • Surface information through Amazon Alexa Skill.

Project Steps

This project contains many detailed steps which will not be completely outlined step-by-step in this story. I will try to pull together all the resources necessary to replicate the project and point out details that took me hours to track down solutions.

The order in which to execute these steps can vary. You can perform the steps in any order which interests you or meets your goals. I can provide the sequence of steps that I went through to complete the project.

  • Setup Amazon Echo (Dot/Tap whatever) and practice using the built in features, admin website/app, and skills available in the Amazon store.
  • Setup Raspberry Pi with Windows 10 IoT Core and install the Windows 10 IoT Core Dashboard on your computer. Connect your Raspberry Pi to your WiFi network and setup administration of the Pi using the Dashboard.
  • Learn how to build Windows IoT Core Background Application and deploy it to the Raspberry Pi and execute.
  • Learn how to build a simple Amazon Alexa Skill and deploy the skill to an Azure Api App.
  • Publish the Alexa Skill to Amazon Developer Portal then test it to ensure it is working.
  • Setup the Azure IoT Hub, Azure functions and DocumentDB database.
  • Change the Alexa Skill to pull information from DocumentDB database.
  • Change the Windows IoT Core Background Application to simulate (or use sensors to pull) data and push messages to the IoT Hub.
  • Write the Azure Function to receive IoT Hub messages and write documents to DocumentDB database for Alexa Skill consumption.
  • Change Alexa Skill to query DocumentDB and respond to utterances related to the data you are collecting with your Raspberry Pi.

Setup Amazon Echo (Dot or Tap)

You will need to setup your Amazon Echo going through the Setup Instructions provided by Amazon.  The Amazon Echo Support page has links to many other support documents describing how to use and troubleshoot your device.

Setup Raspberry Pi

Install the Windows 10 IoT Core on your Raspberry Pi.

https://developer.microsoft.com/en-us/windows/iot/GetStarted

Install Windows 10 IoT Core Dashboard

https://developer.microsoft.com/en-us/windows/iot/Downloads

Setup and get familiar with Managing a Windows IoT device using the IoT Dashboard and Device Portal apps.

https://developer.microsoft.com/en-us/windows/iot/docs/iotdashboard

Build Windows IoT Core > Background Application (IoT)

Here is a sample IoT background application for generating a random number, build a IoT message and sending the message to the IoT Hub. You can comment out the IoT code until we get to that step below. The sample solution also contains a sample IoT client console application to view the IoT messages as they are sent by the Raspberry Pi. More on this once we get the IoT Hub created.

Deploy your background application to the Raspberry Pi

https://developer.microsoft.com/en-us/windows/iot/docs/appdeployment

Build the Amazon Alexa Skill Visual Studio Solution

Use Visual Studio to create a ASP.NET Web API Project hosted in Azure App Service. Of course you will need an Azure account if you don’t already have one.

Read More:  Pi to Azure to Alexa

Scroll to Top