espressif / esp-rainmaker

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

unable to compile after disabling the MQTT BUDGET (MEGH-4466) #252

Closed Sundareswar23 closed 1 year ago

Sundareswar23 commented 1 year ago

Answers checklist.

IDF / ESP32-Arduino version.

ESP-IDF v5.0.1-3-g886e98a2c1

Operating System used.

Windows

How did you build your project?

Command line with idf.py

Development Kit.

ESP32S3

What is the expected behavior?

successful build with disabling the MQTT budget feature

What is the actual behavior?

disable the feature try out the MQTT connection stability

Steps to reproduce.

  1. open any examples of esp-rainmaker
  2. run idf.py menuconfig
  3. under "ESP RainMaker Config" disable "Enable MQTT budgeting"
  4. Run idf.py build

Build Logs.

components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:143:1: error: unknown type name 'esp_err_t'
  143 | esp_err_t esp_rmaker_mqtt_budgeting_init(void)
      | ^~~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_budgeting_init':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:149:12: error: 'ESP_FAIL' undeclared (first use in this function)
  149 |     return ESP_FAIL;
      |            ^~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:149:12: note: each undeclared identifier is reported only once for each function it appears in
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: At top level:
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:152:1: error: unknown type name 'esp_err_t'
  152 | esp_err_t esp_rmaker_mqtt_budgeting_deinit(void)
      | ^~~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_budgeting_deinit':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:154:12: error: 'ESP_FAIL' undeclared (first use in this function)
  154 |     return ESP_FAIL;
      |            ^~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: At top level:
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:157:1: error: unknown type name 'esp_err_t'
  157 | esp_err_t esp_rmaker_mqtt_budgeting_stop(void)
      | ^~~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_budgeting_stop':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:159:12: error: 'ESP_FAIL' undeclared (first use in this function)
  159 |     return ESP_FAIL;
      |            ^~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: At top level:
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:162:1: error: unknown type name 'esp_err_t'
  162 | esp_err_t esp_rmaker_mqtt_budgeting_start(void)
      | ^~~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_budgeting_start':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:164:12: error: 'ESP_FAIL' undeclared (first use in this function)
  164 |     return ESP_FAIL;
      |            ^~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: At top level:
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:167:1: error: unknown type name 'esp_err_t'
  167 | esp_err_t esp_rmaker_mqtt_increase_budget(uint8_t budget)
      | ^~~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_increase_budget':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:169:12: error: 'ESP_OK' undeclared (first use in this function); did you mean 'ESP_LOGD'?
  169 |     return ESP_OK;
      |            ^~~~~~
      |            ESP_LOGD
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: At top level:
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:172:1: error: unknown type name 'esp_err_t'
  172 | esp_err_t esp_rmaker_mqtt_decrease_budget(uint8_t budget)
      | ^~~~~~~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_decrease_budget':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:174:12: error: 'ESP_OK' undeclared (first use in this function); did you mean 'ESP_LOGD'?
  174 |     return ESP_OK;
      |            ^~~~~~
      |            ESP_LOGD
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: At top level:
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:177:1: error: unknown type name 'bool'
  177 | bool esp_rmaker_mqtt_is_budget_available(void)
      | ^~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:10:1: note: 'bool' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
    9 | #include <esp_log.h>
  +++ |+#include <stdbool.h>
   10 | 
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_is_budget_available':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:179:12: error: 'true' undeclared (first use in this function)
  179 |     return true;
      |            ^~~~
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:179:12: note: 'true' is defined in header '<stdbool.h>'; did you forget to '#include <stdbool.h>'?
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_budgeting_init':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:150:1: error: control reaches end of non-void function [-Werror=return-type]
  150 | }
      | ^
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_budgeting_deinit':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:155:1: error: control reaches end of non-void function [-Werror=return-type]
  155 | }
      | ^
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_budgeting_stop':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:160:1: error: control reaches end of non-void function [-Werror=return-type]
  160 | }
      | ^
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_budgeting_start':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:165:1: error: control reaches end of non-void function [-Werror=return-type]
  165 | }
      | ^
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_increase_budget':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:170:1: error: control reaches end of non-void function [-Werror=return-type]
  170 | }
      | ^
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_decrease_budget':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:175:1: error: control reaches end of non-void function [-Werror=return-type]
  175 | }
      | ^
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c: In function 'esp_rmaker_mqtt_is_budget_available':
/Users/sundareswarpalanichamy/projects/ESP/esp-rainmaker/components/esp_rainmaker/src/mqtt/esp_rmaker_mqtt_budget.c:180:1: error: control reaches end of non-void function [-Werror=return-type]
  180 | }
      | ^
cc1: some warnings being treated as errors

More Information.

No response

shahpiyushv commented 1 year ago

@Sundareswar23 , we will look into this, but please note that devices sending high number of messages will be deactivated as per our fair usage policy. What exactly is your use case which requires disabling budgeting?

Sundareswar23 commented 1 year ago

@shahpiyushv i have customised the above application, publishing the messaging will be low. so i thought of disabling the mqtt budget and found this issue.

shahpiyushv commented 1 year ago

@Sundareswar23 , the issues has been fixed now. Please check with the latest rainmaker agent code.