Trouble with adding OTA library into ESP32 project

salkaleidoscope wrote on December 19, 2019:

Hi,
I have been having trouble trying to build my amazon freertos project with OTA library on ESP32 Wrover kit. I have my project setup similar to this project on github where we are using amazon-freertos as a submodule: Link: [https://github.com/ParmanBabra/amazon-freertos-examples]

Similarly, in the CMakeLists.txt file at the root of my project I have

target_link_libraries(my_app PRIVATE AFR::ota)

to try and include the OTA library but we still get this error during the build:

[2/22] Building C object CMakeFiles/my_appdi...ertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c.obj FAILED: CMakeFiles/my_app.dir/amazon-freertos/libraries/freertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c.obj
../amazon-freertos/libraries/freertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c:39:40: fatal error: aws_iot_ota_agent_internal.h: No such file or directory
[3/22] Building C object CMakeFiles/my_app.di...ertos_plus/aws/ota/src/http/aws_iot_ota_http.c.obj FAILED: CMakeFiles/my_app.dir/amazon-freertos/libraries/freertos_plus/aws/ota/src/http/aws_iot_ota_http.c.obj../amazon-freertos/libraries/freertos_plus/aws/ota/src/http/aws_iot_ota_http.c:43:40: fatal error: aws_iot_ota_agent_internal.h: No such file or directory

Is there an error in the include directories for the OTA since library since both aws_iot_ota_mqtt.c and as_iot_ota_http.c files can’t seem to find aws_iot_ota_agent_internal.h? or is there some other way I need to include the OTA library in my project?

Tiangang-AWS wrote on December 23, 2019:

Hi,

Sorry for the trouble, we’ve identified a bug from our 201912.00 release that will cause this. The fix is already pushed to master branch and will be available in next release. You can update your submodule to the latest master branch and this problem should go away. You can also check my example repo here, https://github.com/tgsong/amazon-freertos-examples

Tiangang

salkaleidoscope wrote on January 06, 2020:

Thank you, this fixed the issue.