GithubHelp home page GithubHelp logo

skyformat99 / aws Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mongoose-os-libs/aws

0.0 1.0 0.0 2.06 MB

Amazon AWS IoT integration with Mongoose OS

Home Page: https://mongoose-os.com

License: Other

C 90.22% JavaScript 9.78%

aws's Introduction

AWS IoT support for Mongoose OS

This library implements integration of Mongoose OS with AWS IoT.

It provides device shadow API in both C/C++ and JavaScript, allowing developers to quickly prototype the device logic in JS before jumping to the C/C++ implementation.

Setup cloud side

Setup side

  • Connect the device to your computer with a micro-USB cable
  • Follow installation instructions to install mos tool on your computer
  • Start mos tool. A Web UI will appear, with the connection dialog
  • Select "Serial Port", click Connect
  • Choose "mos-PLATFORM-latest" firmware, click Flash
  • Enter your WiFi credentials, click "Save"
  • Close the device setup dialog
  • Click on configuration tab in mos Web UI, fill in AWS parameters and click "Save".

Take a look at the example video that shows how to implement Internet button functionality in less than 2 minutes:

<iframe src="https://www.youtube.com/embed/nA3tGsSFngc" width="560" height="315" frameborder="0" allowfullscreen></iframe>

mos aws-iot-setup command performs the certificate management for you, and onboard your device on AWS IoT cloud. If your device has an Atmel ECC508A secure element attached, then Mongoose Firmware will use ECC508A chip for TLS handshake and keep your credentials secure.

How to use this library

In your Mongoose OS app, edit mos.yml file and add a reference to this library. See an example app that does that.

Remote management via AWS IoT

If you're using Bash shell, you can use this alias to talk to your device interactively via AWS IoT:

alias mos1="mos --cert-file $(mos config-get mqtt.ssl_cert) --key-file $(mos config-get mqtt.ssl_key) --port mqtts://$(mos config-get mqtt.server)/$(mos config-get device.id)"
mos1 ls -l
init.js 330
index.html 250
...

For more in-depth explanation, see Secure remote device management with Mongoose OS blog post.

Device configuration

This library adds an aws configuration section to the device:

"aws": {
  "shadow": {
    "thing_name": ""
  }
}

If aws.shadow.thing_name is left empty, then the provisioned device will use a device.id, which is by default <architecture>_<mac_address>. For example, a newly provisioned ESP32 board might have esp32_C513DA thing name.

Other examples

AWS device shadow tutorial

<iframe src="https://www.youtube.com/embed/H8w0_pWu0ak" width="560" height="315" frameborder="0" allowfullscreen></iframe>

aws's People

Contributors

cpq avatar dimonomid avatar ruslanvaliullin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.