espressif/esp-azure

Several missing files from pnp_example (CA-61)

Opened this issue · 1 comments

I'm trying to implement a Plug and Play application for the ESP32, and I'm having a lot of problems with the various versions of the needed libraries.

It is my understanding that the generated code relies on the public-preview branch of azure-iot-sdk-c, or at least version 1.3.5. I tried to use the previow/pnp_example branch of this repository (examples/azure_iot_pnp_sample), but the compilation process fails.

At first the problem seems to be some missing files in the CMakeLists.txt: pnp_azure_board_sensor.c and pnp_azure_board_device_info.c

CMake Error at /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:445 (add_library):
  Cannot find source file:

    /tmp/esp-azure/examples/azure_iot_pnp_sample/main/pnp_azure_board_sensor.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
Call Stack (most recent call first):
  /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:508 (idf_component_register)
  main/CMakeLists.txt:11 (register_component)


CMake Error at /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:445 (add_library):
  Cannot find source file:

    /tmp/esp-azure/azure-iot-sdk-c/c-utility/pal/dns_async.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
Call Stack (most recent call first):
  /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:508 (idf_component_register)
  /tmp/esp-azure/port/CMakeLists.txt:123 (register_component)


CMake Error at /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:445 (add_library):
  No SOURCES given to target: __idf_main
Call Stack (most recent call first):
  /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:508 (idf_component_register)
  main/CMakeLists.txt:11 (register_component)


CMake Error at /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:445 (add_library):
  No SOURCES given to target: __idf_port
Call Stack (most recent call first):
  /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:508 (idf_component_register)
  /tmp/esp-azure/port/CMakeLists.txt:123 (register_component)


CMake Generate step failed. 

Even removing said files from the CMake listing another error occurs, about another missing file:

CMake Error at /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:445 (add_library):
  Cannot find source file:

    /tmp/esp-azure/azure-iot-sdk-c/c-utility/pal/dns_async.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
Call Stack (most recent call first):
  /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:508 (idf_component_register)
  /tmp/esp-azure/port/CMakeLists.txt:123 (register_component)


CMake Error at /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:445 (add_library):
  No SOURCES given to target: __idf_port
Call Stack (most recent call first):
  /home/maldus/Source/esp-idf-v4.0/tools/cmake/component.cmake:508 (idf_component_register)
  /tmp/esp-azure/port/CMakeLists.txt:123 (register_component)


CMake Generate step failed.  Build files cannot be regenerated correctly.
cmake failed with exit code 1

At this point I'm not sure whether an example for the pnp functionality exists/works, as this is similar to other problems I have encountered while trying to include the sdk in my project. I believe the file dns_async.c was present in a previous version of the library, but has been removed/changed in the public-preview update. Is it supposed to work? Am I missing something?

@Maldus512 The pnp preview supported only make, not cmake. Please apply these 2 patches to fix the cmake issues.

0001-azure_iot_pnp_sample-Fixed-a-compilation-error-seen-.txt
0002-azure_iot_pnp_sample-Fix-the-broken-cmake-support.txt

Please also execute git submodule update --init --recursive once in esp-azure preview/pnp_example branch.