|Skill Level||Area of Focus||Operating System||Cloud Service/Platform|
|Intermediate||Alexa Voice Service, |
Sensors, Smart Home
|Linux||Sierra Wireless AirVantage|
Sensor to cloud demonstration using the mangOH Red, Sierra Wireless WP Series Embedded Modules featuring Qualcomm Technologies LTE IoT modems, Amazon Alexa, AirVantage and AWS Lambda.
We created this demo to showcase Sensor to Cloud capabilities of the mangOH Red platform. Using Legato Linux we have been able to intelligently collect sensor data from sensors built-in to the mangOH Red platform via Sierra Wireless WP Series Embedded Modules featuring Qualcomm® LTE IoT modems. We then do edge analytics on the data before publishing it to the AirVantage Cloud platform. We then demonstrate how to use the AirVantage platform to integrate with other cloud services. In the case of this demo, Amazon’s Lambda service is used. Finally, we use the Amazon Echo as a means of interacting with the demo. Using the echo allows us to think about the possibilities of combining voice interfaces with sensor data from mangOH Red.
Sierra Wireless WP Series Modules featuring Qualcomm LTE IoT modems are designed to support Cat-3 for high-end IoT, Cat-1 for cost-efficient, low power, scalable IoT needs, and Cat-M1/NB1 for ultra-low power and extended battery life.
IoT Development with Sierra Wireless’ mangOH Red – demo block diagram
Build / Assembly Instructions
Materials Required / Parts List / Tools
- mangOH Red
- Sierra Wireless WP class modem module
- Amazon Web Services Account
- Amazon Developer Account
- AirVantage Account
- SIM card with data
- Mobile phone or tablet with the Amazon Alexa App
Source Code / Source Examples / Application Executable
Build / Assembly
- Install the Sierra Wireless WP module into the mangOH Red board and attach the metal cover on the module. Connect both of the micro USB ports to your development computer.
- Install the latest firmware on your WP module by following the tutorial section at mangoh.io
- Download and install the Legato development virtual machine if you are running Windows or Mac OSX on your development computer. The VM is linked at the bottom of the mangOH Red resources page. If your development computer is running Linux, you may wish to install the required dependencies and tools directly into your environment. This video walks through setting up a Linux environment for development of Legato applications. If you are using the VM, you can skip to 1:05 in the video. By following the instructions in this video, the modem module will be updated with the necessary dependencies for this demo. This demo depends on Legato 17.05.0 or newer while the video covers building 16.10.2.
- Register and login to Amazon developer site.
- In the Amazon developer portal, click the "Alexa" tab and then click "Add a New Skill".
- Choose "Custom Interaction Model" (not "Smart Home Skill API").
- Choose a name for the skill and an invocation name. The invocation name will be spoken to activate the skill, so choose something that is brief, but unique.
- Use the files from Github to fill in the "Interaction Model". Use alexa_skill-schema.json,
- Register for an Amazon AWS account and login to the account.
- Locate the "Lambda" service within AWS.
- Change your AWS region in the top right corner to N. Virginia. For some reason the Alexa Skills Kit trigger type that is required for this demo isn't available in all regions.
- Create a new Lambda function using the Node.js 6.10 Blank Function template and choose the Alexa Skills Kit trigger.
- Fill in the content of the function using the code in file `amazon_lambda_service.js`
- One line of the code needs to be edited. Find the line under the heading "Main handler" where the applicationId is checked. Update the application ID string to match the application ID as it appears under the "Skill Information" section of your skill as defined in the Amazon Developer portal.
- Under Configuration > Advanced settings, set the timeout to 10s.
- Copy the ARN from the top right of the AWS Lambda screen and paste the ARN into the text box under Configuration > Endpoint in the Amazon developer portal.
- Login to AirVantage and click Develop -> API Clients. Add a new connector and paste the redirect URL from the "Configuration" section of the skill definition in developer.amazon.com.
- In the Amazon Developer Portal under Configuration, click yes for account linking and specify the authorization URL: https://eu.airvantage.net/api/oauth/authorize. Set the Client Id to match the Client Id of the API Client that was just created in AirVantage. Set the authorization grant type to "implicit grant".
- Download the Amazon Alexa app onto an iPhone or iPad. There is an Android version as well, but the Wi-Fi setup seems to be buggy.
- Power on the Amazon Echo and use the app to join the Echo to a Wi-Fi network.
- Use the Amazon Alexa app to install the skill onto the Echo that was created above.
- Install a SIM card in your mangOH Red.
- Power on the mangOH Red and ssh to 192.168.2.2 and login as root (no password).
- Set your APN for use with your SIM using `cm data apn
- Use `cm info` to view the details of the module. Use this information to register the module on AirVantage.
- On the mangOH Red, run `app start redSensorToCloud`
- Observe that data is being published to AirVantage by going to Monitor > Systems, clicking on the link to the correct module and then clicking on the "Timeline" button.
alexa_skill-slot_types.txt and alexa_skill-sample_utterances.txt
to fill in the fields for "Intent Schema", "Custom Slot Types" and "Sample Utterances" respectively.
- Power on the Amazon Echo.
- Power on the mangOH Red.
- ssh to the mangOH Red (192.168.2.2) and start the data publishing app by running “app start redSensorToCloud”
- Say “Alexa, use
”where is the activation phrase for the skill defined in the Amazon developer portal. You should hear “Sierra Wireless Alexa mangOH Red demo. Please identify your modem using find.”
- Say “Find
”where is the name that you registered your WP module as in AirVantage. You should hear “OK. Modem found.”
- Say any of the commands “orientation”, “temperature” or “pressure” to have the Echo read the latest data point.
- Say “exit” to exit the skill or wait a few seconds and the Alexa will timeout and exit the skill automatically.
Image: mangOH Red development board from Sierra Wireless.