Toly
Published © GPL3+

Internet Button On ESP8266 and AWS IoT Tutorial

Internet Button project: when a button on the device is pressed, a cloud backend gets a notification and performs an action. Using AWS IoT.

BeginnerFull instructions provided6 minutes5,825
Internet Button On ESP8266 and AWS IoT Tutorial

Things used in this project

Hardware components

NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
ESP8266 NodeMCU is used, but you can really use any ESP8266 based board
×1

Software apps and online services

AWS IoT
Amazon Web Services AWS IoT
AWS IoT receives the message and calls AWS Lambda Function
AWS Lambda
Amazon Web Services AWS Lambda
AWS IoT receives the message and calls AWS Lambda Function
AWS SNS
Amazon Web Services AWS SNS
AWS SNS notifies subscribers: in this case, just sends a message to a single email address
Mongoose OS
Mongoose OS

Story

Read more

Code

Code snippet #3

Plain text
# You can change "my-internet-button" stack name to something else
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

Code snippet #4

Plain text
# 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: <a href="https://console.aws.amazon.com/cloudformation/home" rel="nofollow"> https://console.aws.amazon.com/cloudformation/hom...</a>
# NOTE: During stack creation, AWS will send a Subscription Confirmation email,
# so check your email and confirm the subscription by following a link.
aws cloudformation wait stack-create-complete --stack-name my-internet-button

Credits

Toly

Toly

9 projects • 8 followers

Comments