environment: ESP32_IDF
IDE: PlatformIO, Core 4.3.4, Home 3.2.3
Platform: ESPRESSIF 32, v1.12.4
ESP_IDF_VERSION: 4.0.0 according to esp_idf_version.h
Problem 1:
some mqtt_client.c functionalities are enabled/disabled depending on ESP_IDF version (3.3.0, 4.0.0, 4.1.0).
But variable init is not related to that, causing the init fail.
For instance, "client->config->alpn_protos": It is active by default, also in v4.0.0, but it is not handled by library, and cannot be initialized externally):
MQTT_SUPPORTED_FEATURE_ALPN is only enabled in v4.1.0, causing init fail if v<4.1.0:
---------------------------------------------------------------
if (client->config->alpn_protos) {
#ifdef MQTT_SUPPORTED_FEATURE_ALPN
esp_transport_ssl_set_alpn_protocol(ssl, (const char **)client->config->alpn_protos);
#else
ESP_LOGE(TAG, "ALPN is not available in IDF version %s", IDF_VER);
goto _mqtt_init_failed;
#endif
---------------------------------------------------------------
So I get error and mqtt init failure:
-----------------------------------------------------------------------------------------------------------------
I (781) WIFI01: Event: WIFI ----- WIFI_EVENT_STA_START -> Received
I (781) WIFI01: esp_wifi_start err = 0
I (791) MOD_MQTT: [APP] Free memory: 224008 bytes
I (801) MOD_MQTT: mqtt://mqtt.eclipse.org:1883
E (811) MQTT_CLIENT: APLN is not available in IDF version HEAD-HASH-NOTFOUND
I (821) MOD_MQTT: MQTT_client_init FAILED
E (841) MQTT_CLIENT: Client was not initialized
-----------------------------------------------------------------------------------------------------------------
Error is coming from mqtt_client.c lines 503 - 509:
if (client->config->alpn_protos) {
#ifdef MQTT_SUPPORTED_FEATURE_ALPN
esp_transport_ssl_set_alpn_protocol(ssl, (const char **)client->config->alpn_protos);
#else
ESP_LOGE(TAG, "ALPN is not available in IDF version %s", IDF_VER);
goto _mqtt_init_failed;
#endif
as MQTT_SUPPORTED_FEATURE_ALPN is initialized based on
#include "mqtt_supported_features.h"
Associated error 2: esp_get_idf_version() function does not retrieving data.
This error is associated to mqtt_client.c line 507:
ESP_LOGE(TAG, "ALPN is not available in IDF version %s", IDF_VER);
As IDF_VER is not initialized, some functionality fails. Please see link, documented by PlatformIO team, related to ESP_IDF integration:
https://community.platformio.org/t/repo ... sion/14590
mqtt_client.c functionality related to ESP_IDF version not controlled on library, making init fail.
-
- Posts: 4
- Joined: Sun May 20, 2018 11:20 am
Who is online
Users browsing this forum: No registered users and 88 guests