AWS IOT Provisoning Example doesn't work

nanotoly
Posts: 3
Joined: Tue Nov 21, 2023 3:42 am

AWS IOT Provisoning Example doesn't work

Postby nanotoly » Tue Nov 28, 2023 8:47 am

Hello, I'm testing aws iot provision emxample.
i used esp-aws-iot(https://github.com/espressif/esp-aws-io ... g_with_csr)
but it occured error below, building the code.

Code: Select all

[2/12] Building C object esp-idf/Fleet-Provisioning-for-AWS-IoT-embedded-...mbedded-sdk.dir/f7893e654caf0f5cdf916ac2a3b97995/fleet_provisioning.c.ob 
FAILED: esp-idf/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/CMakeFiles/__idf_Fleet-Provisioning-for-AWS-IoT-embedded-sdk.dir/f7893e654caf0f5cdf916ac2a3b97995/fleet_provisioning.c.obj 
C:\Users\ding9\.espressif\tools\xtensa-esp-elf\esp-13.2.0_20230928\xtensa-esp-elf\bin\xtensa-esp32-elf-gcc.exe -DESP_PLATFORM -DIDF_VER=\"v5.3-dev-582-gab03c2ea13\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -ID:/dev/esp_idf/esp_aws_iot/esp-aws-iot/examples/fleet_provisioning/fleet_provisioning_with_csr/build/config -ID:/dev/esp_idf/esp_aws_iot/esp-aws-iot/libraries/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/source/include -ID:/dev/esp_idf/esp_aws_iot/esp-aws-iot/libraries/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/config -ID:/dev/esp_idf/esp_aws_iot/esp-aws-iot/libraries/Fleet-Provisioning-for-AWS-IoT-embedded-sdk -IC:/Users/ding9/esp/esp-idf/components/newlib/platform_include -IC:/Users/ding9/esp/esp-idf/components/freertos/config/include -IC:/Users/ding9/esp/esp-idf/components/freertos/config/include/freertos -IC:/Users/ding9/esp/esp-idf/components/freertos/config/xtensa/include -IC:/Users/ding9/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -IC:/Users/ding9/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -IC:/Users/ding9/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -IC:/Users/ding9/esp/esp-idf/components/freertos/esp_additions/include -IC:/Users/ding9/esp/esp-idf/components/esp_hw_support/include -IC:/Users/ding9/esp/esp-idf/components/esp_hw_support/include/soc -IC:/Users/ding9/esp/esp-idf/components/esp_hw_support/include/soc/esp32 -IC:/Users/ding9/esp/esp-idf/components/esp_hw_support/port/esp32/. -IC:/Users/ding9/esp/esp-idf/components/esp_hw_support/port/esp32/private_include -IC:/Users/ding9/esp/esp-idf/components/heap/include -IC:/Users/ding9/esp/esp-idf/components/log/include -IC:/Users/ding9/esp/esp-idf/components/soc/include -IC:/Users/ding9/esp/esp-idf/components/soc/esp32 -IC:/Users/ding9/esp/esp-idf/components/soc/esp32/include -IC:/Users/ding9/esp/esp-idf/components/hal/platform_port/include -IC:/Users/ding9/esp/esp-idf/components/hal/esp32/include -IC:/Users/ding9/esp/esp-idf/components/hal/include -IC:/Users/ding9/esp/esp-idf/components/esp_rom/include -IC:/Users/ding9/esp/esp-idf/components/esp_rom/include/esp32 -IC:/Users/ding9/esp/esp-idf/components/esp_rom/esp32 -IC:/Users/ding9/esp/esp-idf/components/esp_common/include -IC:/Users/ding9/esp/esp-idf/components/esp_system/include -IC:/Users/ding9/esp/esp-idf/components/esp_system/port/soc -IC:/Users/ding9/esp/esp-idf/components/esp_system/port/include/private -IC:/Users/ding9/esp/esp-idf/components/xtensa/esp32/include -IC:/Users/ding9/esp/esp-idf/components/xtensa/include -IC:/Users/ding9/esp/esp-idf/components/xtensa/deprecated_include -IC:/Users/ding9/esp/esp-idf/components/lwip/include -IC:/Users/ding9/esp/esp-idf/components/lwip/include/apps -IC:/Users/ding9/esp/esp-idf/components/lwip/include/apps/sntp -IC:/Users/ding9/esp/esp-idf/components/lwip/lwip/src/include -IC:/Users/ding9/esp/esp-idf/components/lwip/port/include -IC:/Users/ding9/esp/esp-idf/components/lwip/port/freertos/include -IC:/Users/ding9/esp/esp-idf/components/lwip/port/esp32xx/include -IC:/Users/ding9/esp/esp-idf/components/lwip/port/esp32xx/include/arch -IC:/Users/ding9/esp/esp-idf/components/lwip/port/esp32xx/include/sys -mlongcalls -Wno-frame-address  -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Og -fno-shrink-wrap -fmacro-prefix-map=D:/dev/esp_idf/esp_aws_iot/esp-aws-iot/examples/fleet_provisioning/fleet_provisioning_with_csr=. -fmacro-prefix-map=C:/Users/ding9/esp/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -MD -MT esp-idf/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/CMakeFiles/__idf_Fleet-Provisioning-for-AWS-IoT-embedded-sdk.dir/f7893e654caf0f5cdf916ac2a3b97995/fleet_provisioning.c.obj -MF esp-idf\Fleet-Provisioning-for-AWS-IoT-embedded-sdk\CMakeFiles\__idf_Fleet-Provisioning-for-AWS-IoT-embedded-sdk.dir\f7893e654caf0f5cdf916ac2a3b97995\fleet_provisioning.c.obj.d -o esp-idf/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/CMakeFiles/__idf_Fleet-Provisioning-for-AWS-IoT-embedded-sdk.dir/f7893e654caf0f5cdf916ac2a3b97995/fleet_provisioning.c.obj -c D:/dev/esp_idf/esp_aws_iot/esp-aws-iot/libraries/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/source/fleet_provisioning.c
D:/dev/esp_idf/esp_aws_iot/esp-aws-iot/libraries/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/source/fleet_provisioning.c:765:1: fatal error: opening dependency file esp-idf\Fleet-Provisioning-for-AWS-IoT-embedded-sdk\CMakeFiles\__idf_Fleet-Provisioning-for-AWS-IoT-embedded-sdk.dir\f7893e654caf0f5cdf916ac2a3b97995\fleet_provisioning.c.obj.d: No such file or directory
  765 | }
      | ^
compilation terminated.
[3/12] Performing build step for 'bootloader'
[1/1] cmd.exe /C "cd /D D:\dev\esp_idf\esp_aws_iot\esp-aws-iot\examples\fleet_provisioning\fleet_provisioning_with_csr\build\bootloader\esp-idf\esptool_py && C:\Users\ding9\.espressif\python_env\idf5.3_py3.11_env\Scripts\python.exe C:/Users/ding9/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 D:/dev/esp_idf/esp_aws_iot/esp-aws-iot/examples/fleet_provisioning/fleet_provisioning_with_csr/build/bootloader/bootloader.bin"
Bootloader binary size 0x6870 bytes. 0x790 bytes (7%) free.
ninja: build stopped: subcommand failed.

 *  The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command ninja " terminated with exit code: 1. 
I think, main problem is "esp-idf\Fleet-Provisioning-for-AWS-IoT-embedded-sdk\CMakeFiles\__idf_Fleet-Provisioning-for-AWS-IoT-embedded-sdk.dir\f7893e654caf0f5cdf916ac2a3b97995\fleet_provisioning.c.obj" doesn't exist.



My Trial
1. find directory
so i tried to find "esp-idf\Fleet-Provisioning-for-AWS-IoT-embedded-sdk\CMakeFiles\__idf_Fleet-Provisioning-for-AWS-IoT-embedded-sdk.dir\f7893e654caf0f5cdf916ac2a3b97995\fleet_provisioning.c.obj.d" file.
But I can't find even "esp-idf\Fleet-Provisioning-for-AWS-IoT-embedded-sdk\CMakeFiles" directory.

2. latest version update
i notice 'fleet provisioning' example is most recent example. provisioning example is not exist in LTS version.
So, I reinstall esp-idf and esp-aws-iot library for the latest version.

ESP-IDF : 5.2 ->>> ESP-IDF : master branch
esp-aws-iot : 202012.04LTS >>>> esp-aws-iot : master branch

But this trial also doesn't work.

3. without example code
my last trial is provisioning without example code.

i made firmware that can connect and pub/sub to AWS IOT MQTT server.
It works well, and i can get message from normal topic(ex. 'sdk/test/python' topic).
But It cannot get message from '$aws' topic. It make me unable to provision.

4. send certificate to normal topic
I wonder it is possible to get cert information by mqtt topic.
So, I publish cert data to normal topic(ex. 'sdk/test/python' topic).
message content(get from "$aws/certificates/create/json/accepted" topic) :

Code: Select all

{
  "certificateId": "fa2c...",
  "certificatePem": "-----BEGIN CERTIFICATE-----\nMIIDWjCCAkKgAwIBAgI...\n-----END CERTIFICATE-----\n",
  "privateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpQIBAAKCAQEA...\n-----END RSA PRIVATE KEY-----\n",
  "certificateOwnershipToken": "eyJ2ZXJzaW..."
}
My ESP succeed to get message, but occured error below.

Code: Select all

E (9690) coreMQTT: Dumped packet. DumpedBytes=2490.
I think provisioning messages are too big to receive.



My ENV
vscode esp-idf : v5.2, master branch version
chip : ESP32-wroom-32d
OS : window 10



Question
1. How can i run 'esp-aws-iot' provisioning example??
2. How can i expend MQTT message size for cert message



thanks for your help.

Who is online

Users browsing this forum: No registered users and 110 guests