Overview

    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.

    Documentation

    The documentation of the library can be found hereYou may also refer to the provisioning user guide to know how to use this library for provisioning.

    Getting started with the library

    Requirements

    1. This library uses esp-idf v4.2
    2. Download and install the ESP-IDF tools installer for windows, or you may follow the official instructions here for other OS.
    3. Python 2.7.10 or later should have been installed by the ESP-IDF Tools installer, if not install it
    4. Clone the repository.
      git clone https://github.com/BuildStormTechnologies/esp32_platform.git
    5. Change the working directory to the provision example on cloned repository.
      cd esp32_platform/provisionByClaim

    Example Setup

    1. Follow this article to setup AWS and generate provisioning certificates.
    2. Same certificates will be used for all the examples
    3. Copy the generated certificates to ..\<example>\main\claimCerts folder and rename them as follows
      aws-root-ca.pem
      certificate.pem.crt
      private.pem.key
    4. Update the following Wi-Fi and AWS parameters in app_config.h of the example

    Building the project

    1. Open the ESP-IDF 4.2 CMD command prompt
    2. Navigate to ..\<example> folder
    3. Build Command
      idf.py build
    4. Erase the chip (first time only)
      idf.py -p <SERIAL_PORT> erase_flash
    5. Flash Command
      idf.py -p <SERIAL_PORT> flash monitor

    Testing MQTT Publish & Subscribe

    1. On first boot, device will register itself and reboot
    2. Open the AWS IoT console, and in the left menu, choose Test to open the MQTT client.
    3. Following images shows subscribe/publish functionality

    The device logs the topic names on the serial terminal for your reference.

    1. Subscribe topic: testSub/ESP32
    2. Publish topic:testPub/ESP32

    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 hello@buildstorm.com