espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
431 stars 145 forks source link

implicit declaration of function 'esp_rmaker_factory_get_size' (MEGH-4644) #263

Open sebamsc opened 1 year ago

sebamsc commented 1 year ago

Answers checklist.

IDF / ESP32-Arduino version.

v5.0.2

Operating System used.

Linux

How did you build your project?

Command line with idf.py

Development Kit.

ESP-WROOM-32

What is the expected behavior?

Compile without errors.

What is the actual behavior?

Compiling project fails when trying to compile esp_rmaker_client_data.c can't find reference to:

Steps to reproduce.

  1. Start this project from a copy of multi_device (a few years ago), then added a few components and grow the project from there.
  2. Tried to compile with ESP-IDF v5.0.2 and lastest ESP-Rainmaker version.

sdkconfig.txt

Build Logs.

...
/home/sebastian/Escritorio/espressif/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_client_data.c: In function 'esp_rmaker_get_client_cert_len':
/home/sebastian/Escritorio/espressif/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_client_data.c:78:12: error: implicit declaration of function 'esp_rmaker_factory_get_size'; did you mean 'esp_rmaker_factory_get'? [-Werror=implicit-function-declaration]
   78 |     return esp_rmaker_factory_get_size(ESP_RMAKER_CLIENT_CERT_NVS_KEY) + 1; /* +1 for NULL terminating byte */
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |            esp_rmaker_factory_get
/home/sebastian/Escritorio/espressif/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_client_data.c: In function 'esp_rmaker_get_mqtt_conn_params':
/home/sebastian/Escritorio/espressif/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_client_data.c:128:27: error: 'esp_rmaker_mqtt_conn_params_t' has no member named 'client_key_len'; did you mean 'client_key'?
  128 |         mqtt_conn_params->client_key_len = esp_rmaker_get_client_key_len();
      |                           ^~~~~~~~~~~~~~
      |                           client_key
/home/sebastian/Escritorio/espressif/esp-rainmaker/components/esp_rainmaker/src/core/esp_rmaker_client_data.c:133:27: error: 'esp_rmaker_mqtt_conn_params_t' has no member named 'client_cert_len'; did you mean 'client_cert'?
  133 |         mqtt_conn_params->client_cert_len = esp_rmaker_get_client_cert_len();
      |                           ^~~~~~~~~~~~~~~
      |                           client_cert
cc1: some warnings being treated as errors
[11/58] Building C object esp-idf/esp_rainmaker/CMakeFiles/__idf_esp_rainmaker.dir/src/console/esp_rmaker_commands.c.objIn file included from /home/sebastian/Escritorio/espressif/esp-rainmaker/components/esp-insights/components/rmaker_common/include/esp_rmaker_utils.h:16,
                 from /home/sebastian/Escritorio/espressif/esp-rainmaker/components/esp_rainmaker/src/console/esp_rmaker_commands.c:25:
/home/sebastian/Escritorio/espressif/esp-idf-v5.0.2/components/lwip/include/apps/sntp/sntp.h:9:2: warning: #warning "sntp.h in IDF's lwip port folder is deprecated. Please include esp_sntp.h" [-Wcpp]
    9 | #warning "sntp.h in IDF's lwip port folder is deprecated. Please include esp_sntp.h"
      |  ^~~~~~~
[1/2] Generating binary image from built executableesptool.py v4.5.1
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.

More Information.

The project compiled without problems before I moved to a different computer where I start working with newest release of ESP-IDF (v5.0.2) and lastest version of ESP-Rainmaker.

In the environment that the project compiles I'm using ESP-IDF v5.0.1 and ESP-Rainmaker from this commit

sanketwadekar commented 1 year ago

@sebamsc I tried building the multi-device example with IDF 5.0.2 and latest Rainmaker commit cc861bffc818c607e799f66c79923fd4e2d00447. I did not face any build issues. Please check that you've updated esp-rainmaker submodules using git submodule update --init --recursive