Giter VIP home page Giter VIP logo

fan-aws-iot-esp01-mqtt's Introduction

Fan + ESP-01 + MQTT + AWS IoT Core + AWS Lambda

AWS Setup:

  1. Clone the repository and cd into it
git clone [email protected]:imharvol/fan-aws-iot-esp01-mqtt.git && \
cd ./fan-aws-iot-esp01-mqtt/
  1. Zip the lambda code, name the archive function.zip and move it into the terraform folder:
cd ./lambda/ && \
zip ./function.zip ./index.js && \
cd .. && \
mv ./lambda/function.zip ./terraform/ 
  1. Create the lambda layer for @aws-sdk/client-iot-data-plane in a file named layer.zip and move it into the terraform folder. Feel free to use create-lambda-layer-aws:
cd ./terraform/ && \
npx create-lambda-layer-aws @aws-sdk/client-iot-data-plane && \
cd ..
  1. Initialize and apply with Terraform:
terraform init && \
terraform apply

ESP-01 Setup:

  1. Rename esp01-arduino/secrets.example.h as esp01-arduino/secrets.h
mv esp01-arduino/secrets.example.h esp01-arduino/secrets.h
  1. Replace the values for the WiFi SSDI and password, and make sure that the Thing's name matches the deployed Thing's name.

  2. Fetch the Amazon Root CAs and replace the values in esp01-arduino/secrets.h:

curl https://www.amazontrust.com/repository/G2-RootCA1.pem
curl https://www.amazontrust.com/repository/G2-RootCA3.pem
  1. After deploying to AWS with Terraform, get the endpoint, the device's certificate and the private key and replace the values in esp01-arduino/secrets.h:
terraform output -raw iot_endpoint
terraform output -raw thing_private_key
terraform output -raw thing_certificate_pem

fan-aws-iot-esp01-mqtt's People

Contributors

imharvol 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.