Don’t confuse Masala Chai with Chai Latte, no not the same thing! While we make chai during the snowy season, lets connect ESP8266/32 to Amazon’s AWS IoT in less than 5 minutes.
AWS IoT Core Instructions
Goto AWS IoT Core on your AWS console
Create a Policy
Generate a Policy first
Create a Policy details
- Provide a Name
- Action:
iot:*
- Resource ARM:
*
- Effect: Allow
Create a Thing
Create a Thing first
Single Thing
- Create a AWS IoT Thing
- Thing Name
- Provide a Name to the Thing
- Copy thing name into THINGNAME
- Click Next
- Create Certificates
- Click on Create Certificate
- Download Certificates Download the following
- Contents for client_cert[] from XXXXXXXXXX.cert.pem
- Contents for privkey[] from XXXXXXXXXX.private.key
- Contents for cacert[] from Root CA for AWS
- Download the Root CA Certificate
- Download the RSA 2048 bit key
Attached the Policy created from step above
Interact with AWs IoT Core
- look for HTTP end point and copt it into MQTT_HOST[]
- Copy thing name into THINGNAME (same name from step 3)
Software requirements
ESP8266
- Use ESP8266 Arduino Core version 2.5.0-beta2 or greater
- Will NOT work on ESP8266 Arduino Core v2.4.2 !!!
ESP32
- Use the latest release version
Libraries Needed
platformio.ini is included, use PlatformIO and it will take care of installing the following libraries.
Library | Link | Purpose |
---|---|---|
Arduino MQTT | https://github.com/256dpi/arduino-mqtt | communication (choose 1) |
PubSubClient | https://github.com/knolleary/pubsubclient | communication (choose 1) |
ArduinoJSON | https://github.com/bblanchon/ArduinoJson | example-data-formatting |