We have written a library around esp-idf that helps you focus on developing applications quickly. The library provides API which is simpler to use, you can write applications without digging into protocol level details. We have included some of the key requirements that are needed to go from prototype to production stage. Like device provisioning, every device that speaks to AWS IoT requires a unique device certificate to authenticate and connect itself. The current version of the library includes device provisioning by claim method, the device would acquire its certificate when it connects the AWS IoT for the first time.
Getting started with the library
- This library uses esp-idf v4.2
- Download and install the ESP-IDF tools installer for windows, or you may follow the official instructions here for other OS.
- Python 2.7.10 or later should have been installed by the ESP-IDF Tools installer, if not install it
- Clone the repository.
git clone https://github.com/BuildStormTechnologies/esp32_platform.git
Change the working directory to the provision example on cloned repository.
- Follow this article to setup AWS and generate provisioning certificates.
- Same certificates will be used for all the examples
- Copy the generated certificates to
..\<example>\main\claimCertsfolder and rename them as follows
- Update the following Wi-Fi and AWS parameters in
app_config.hof the example
Building the project
- Open the
ESP-IDF 4.2 CMDcommand prompt
- Navigate to
- Build Command
- Erase the chip (first time only)
idf.py -p <SERIAL_PORT> erase_flash
idf.py -p <SERIAL_PORT> flash monitor
Testing MQTT Publish & Subscribe
- On first boot, device will register itself and reboot
- Open the AWS IoT console, and in the left menu, choose Test to open the MQTT client.
- Following images shows subscribe/publish functionality
The device logs the topic names on the serial terminal for your reference.
- Subscribe topic:
- Publish topic:
The free usage of library is limited to 30 min. It is meant for testing and demonstration only. If you need access to the source code of the library or if you’re looking for a customized solution, reach out at email@example.com