AWS, OTA, PlatformIO, and General Confusion

So I’m attempting to evaluate AWS IoT for a potential project and am just stuck on what to do next. My goal at this point is to get working firmware created using the PlatformIO IDE that can preform a simple OTA Update test using the FreeRTOS Update job. I should also note that I’m using an ESP32-DevKitC for hardware.

I’ve been able to successfully able to run the MQTT connection example on github platformio/platform-espressif32/tree/feature/idf-v4.0/examples/espidf-aws-iot. However, it appears that the esp-aws-iot framework has no included OTA capabilities, so I’m trying to add them to my project manually.

I then created a submodule of the AWS OTA Library and tried to point the CMake file to it like in the example (never used or really heard of submodules before this so it could be an issue):

# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/../ota-for-aws-iot-embedded-sdk/otaFilePaths.cmake)
project(ota_test)

I then tried to include ota.h in my main file, but the compiler never finds it and errors out. Project file structure:

PlatformIO.ini

[env:esp32dev]
platform = espressif32
framework = espidf
board = esp32dev
monitor_speed = 115200

board_build.embed_txtfiles = 
  src/certs/private.pem.key
  src/certs/certificate.pem.crt
  src/certs/aws-root-ca.pem

Hi @TrickkStar. You seem to be on the right path. Yes, you are supposed to include otaFilePaths.cmake. However, this will only define CMake variables containing the list of directories but won’t actually include those directories into your main project. To do this, you must set COMPONENT_SRCS and COMPONENT_ADD_INCLUDEDIRS as shown here for your component: https://github.com/espressif/esp-aws-iot/blob/release/beta/examples/ota/ota_mqtt/main/CMakeLists.txt

This is a beta version of esp-aws-iot, which has demos that demonstrate how to integrate the AWS OTA Library along with other AWS libraries into the ESP32-DevKitC.