mangOH Red Smart Home

Skill LevelArea of FocusOperating SystemCloud Service/Platform
IntermediateAlexa Voice Service,
Embedded, IoT,
Sensors, Smart Home
LinuxSierra 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 IoT Development with Sierra Wireless’ mangOH Red

Materials Required / Parts List / Tools

Source Code / Source Examples / Application Executable

Additional Resources

Build / Assembly

  1. 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.
  2. Install the latest firmware on your WP module by following the tutorial section at mangoh.io
  3. 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.
  4. Register and login to Amazon developer site.
  5. In the Amazon developer portal, click the "Alexa" tab and then click "Add a New Skill".
  6. Choose "Custom Interaction Model" (not "Smart Home Skill API").
  7. 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.
  8. Use the files from Github to fill in the "Interaction Model".
  9. Use alexa_skill-schema.json,
    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.
  10. Register for an Amazon AWS account and login to the account.
  11. Locate the "Lambda" service within AWS.
  12. 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.
  13. Create a new Lambda function using the Node.js 6.10 Blank Function template and choose the Alexa Skills Kit trigger.
  14. Fill in the content of the function using the code in file
  15. `amazon_lambda_service.js`
  16. 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.
  17. Under Configuration > Advanced settings, set the timeout to 10s.
  18. 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.
  19. 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.
  20. 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".
  21. 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.
  22. Power on the Amazon Echo and use the app to join the Echo to a Wi-Fi network.
  23. Use the Amazon Alexa app to install the skill onto the Echo that was created above.
  24. Install a SIM card in your mangOH Red.
  25. Power on the mangOH Red and ssh to 192.168.2.2 and login as root (no password).
  26. Set your APN for use with your SIM using
  27. `cm data apn `
  28. Use `cm info` to view the details of the module. Use this information to register the module on AirVantage.
  29. On the mangOH Red, run
  30. `app start redSensorToCloud`
  31. 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.

Usage Instruction

  1. Power on the Amazon Echo.
  2. Power on the mangOH Red.
  3. ssh to the mangOH Red (192.168.2.2) and start the data publishing app by running
  4. “app start redSensorToCloud”
  5. 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.”
  6. Say “Find where is the name that you registered your WP module as in AirVantage. You should hear “OK. Modem found.”
  7. Say any of the commands “orientation”, “temperature” or “pressure” to have the Echo read the latest data point.
  8. Say “exit” to exit the skill or wait a few seconds and the Alexa will timeout and exit the skill automatically.

mangOH Red development board from Sierra Wireless
Image: mangOH Red development board from Sierra Wireless.