All Projects → mongoose-os-apps → Aws Iot Button

mongoose-os-apps / Aws Iot Button

Licence: other

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Aws Iot Button

Arc.codes
The Architect web site! 🌩
Stars: ✭ 271 (+632.43%)
Mutual labels:  aws, lambda, sns
Github To S3 Lambda Deployer
⚓️ GitHub webhook extension for uploading static pages to AWS S3 directly after commiting to master via Lambda written in Node.js
Stars: ✭ 23 (-37.84%)
Mutual labels:  aws, lambda, sns
Lambdaguard
AWS Serverless Security
Stars: ✭ 300 (+710.81%)
Mutual labels:  aws, lambda, sns
Aws Cli Cheatsheet
☁️ AWS CLI + JQ = Make life easier
Stars: ✭ 94 (+154.05%)
Mutual labels:  aws, lambda, sns
Dazn Lambda Powertools
Powertools (logger, HTTP client, AWS clients, middlewares, patterns) for Lambda functions.
Stars: ✭ 501 (+1254.05%)
Mutual labels:  aws, lambda, sns
Archive aws Lambda Go Shim
Author your AWS Lambda functions in Go, effectively.
Stars: ✭ 799 (+2059.46%)
Mutual labels:  aws, lambda
Serverless Plugin Warmup
Keep your lambdas warm during winter. ♨
Stars: ✭ 814 (+2100%)
Mutual labels:  aws, lambda
Aws Lambda Resize Images
AWS Lambda function to generate a set of resized images (large, medium, small)
Stars: ✭ 6 (-83.78%)
Mutual labels:  aws, lambda
Aws Lambda Workshop
Some incremental examples suitable to host an AWS Lambda Functions workshop
Stars: ✭ 18 (-51.35%)
Mutual labels:  aws, lambda
Dawson Cli
A serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda)
Stars: ✭ 721 (+1848.65%)
Mutual labels:  aws, lambda
Lambdalogs
A CLI tool to trace AWS Lambda calls over multiple CloudWatch log groups.
Stars: ✭ 18 (-51.35%)
Mutual labels:  aws, lambda
Lambda Deployment Example
Automated Lambda Deployments with Terraform & CodePipeline
Stars: ✭ 25 (-32.43%)
Mutual labels:  aws, lambda
Thingsboard Gateway
Open-source IoT Gateway - integrates devices connected to legacy and third-party systems with ThingsBoard IoT Platform using Modbus, CAN bus, BACnet, BLE, OPC-UA, MQTT, ODBC and REST protocols
Stars: ✭ 796 (+2051.35%)
Mutual labels:  aws, iot
Sitewhere
SiteWhere is an industrial strength open-source application enablement platform for the Internet of Things (IoT). It provides a multi-tenant microservice-based infrastructure that includes device/asset management, data ingestion, big-data storage, and integration through a modern, scalable architecture. SiteWhere provides REST APIs for all system functionality. SiteWhere provides SDKs for many common device platforms including Android, iOS, Arduino, and any Java-capable platform such as Raspberry Pi rapidly accelerating the speed of innovation.
Stars: ✭ 788 (+2029.73%)
Mutual labels:  aws, iot
Aws Toolkit Vscode
AWS Toolkit for Visual Studio Code, an extension for working with AWS services including AWS Lambda.
Stars: ✭ 823 (+2124.32%)
Mutual labels:  aws, lambda
Aws Sdk Js V3
Modularized AWS SDK for JavaScript.
Stars: ✭ 737 (+1891.89%)
Mutual labels:  lambda, sns
Lambda Proxy Router
A simple router for AWS Lambda Proxy Functions
Stars: ✭ 14 (-62.16%)
Mutual labels:  aws, lambda
Sherlock Holmes Partying In The Jungle
Parses AWS events payloads into a plain JavaScript object
Stars: ✭ 12 (-67.57%)
Mutual labels:  lambda, sns
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-27.03%)
Mutual labels:  aws, lambda
React Native Aws Iot Device Shadows
React Native Component for connecting to AWS IoT Shadows from a device using SDK JavaScript bundle
Stars: ✭ 30 (-18.92%)
Mutual labels:  aws, iot

AWS IoT button example

This is an Internet Button reference project: when a button on the device is pressed, a cloud backend gets a notification and performs an action. In this particular case, AWS Lambda function sends an email to the specific email address. But, again, the action could be anything.

aws iot button

Prerequisites

Architecture

The data flow is as follows:

  • User presses the button
  • Device sends a message to the MQTT topic DEVICE_ID/button_pressed
  • AWS IoT receives the message and calls AWS Lambda Function
  • AWS Lambda Function publishes a message to the AWS SNS (Simple Notification Service)
  • AWS SNS notifies subscribers: in this case, just sends a message to a single email address
  • User receives the email

Build instructions

  1. Follow the Cloud side setup instructions to setup AWS CLI utility and your AWS credentials
  2. Follow the Device setup instructions to setup your device and provision it to the AWS IoT
  3. Download this repository as a zip file and extract this app on your computer
  4. Exit any running mos.exe process
  5. Open a command prompt (on Windows) or terminal (on Mac/Linux) and go to the extracted app.
  6. You should be able to see the mos.yml file by running dir mos.yml command (on Windows) or ls -l mos.yml (on Mac/Linux)
  7. Find out your device ID
mos config-get device.id

On Windows, here and further, you might need to specify the full path to the mos.exe binary:

c:\path\to\mos.exe config-get device.id
  1. Run the following command to create AWS Cloud Formation stack. Change $DEVICE_ID to your actual device ID, and $MY_EMAIL to your email:
aws cloudformation create-stack --stack-name my-internet-button --parameters ParameterKey=TopicName,ParameterValue=$DEVICE_ID/button_pressed ParameterKey=SubscriptionEmail,ParameterValue=$MY_EMAIL --capabilities CAPABILITY_IAM --template-body file://aws_button_template.json
  1. Wait until the stack creation is completed (it may take a few minutes). Alternatively, you can use the web UI to check the status and read event details: https://console.aws.amazon.com/cloudformation/home

  2. During the stack creation, AWS will send a Subscription Confirmation email, so check your email and confirm the subscription by following a link.

  3. Run the following command to ensure that the stack creation is complete:

aws cloudformation wait stack-create-complete --stack-name my-internet-button
  1. Copy the fs/init.js file to your device:
mos put fs/init.js
  1. Attach to the device to see the device logs
mos console
  1. Reboot your device by pressing a reboot button
  2. When the device is connected to the AWS IoT, push the "flash" button on your device. In the device's console, you'll see a message like this:
Published: yes topic: esp8266_DA84C1/button_pressed message: {"free_ram":26824,"total_ram":44520}

Now, check your email. It'll contain a new message:

Button pressed: esp8266_DA84C1/button_pressed
  1. Now you can go to your AWS dashboard and play with your stack. For example, you may add more subscriptions to the SNS: other than sending emails, it can also call some URL, send SMS, etc. And, of course, you can modify your lambda function to do whatever you want in response to the button press.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].