Open StevenB56 opened 2 years ago
I get the same error with HTTP OTA. MQTT OTA works. IDF v4.4.2
This bug is still active on release 202012.04-LTS
using ESP-IDF v4.4.1.
Commit d162eb5656bfc9c324ecaf96bd72a8dc4176f53d
on the master branch fixes this issue, but has not been backported to this release branch.
Here's the patch I applied to my clone of the example that fixes the issue on the LTS release branch:
diff --git a/examples/ota/ota_http/main/ota_demo_core_http.c b/examples/ota/ota_http/main/ota_demo_core_http.c
index 6e36fe1..6d3144c 100644
--- a/examples/ota/ota_http/main/ota_demo_core_http.c
+++ b/examples/ota/ota_http/main/ota_demo_core_http.c
@@ -296,15 +296,20 @@ const AppVersion32_t appFirmwareVersion =
};
/**
- * @brief Static buffer for TLS Context Semaphore.
+ * @brief Static buffer for TLS Context Semaphore for MQTT connection.
*/
-static StaticSemaphore_t xTlsContextSemaphoreBuffer;
+static StaticSemaphore_t xTlsContextSemaphoreBufferMqtt;
/**
* @brief Network connection context used in this demo for MQTT connection.
*/
static NetworkContext_t networkContextMqtt;
+/**
+ * @brief Static buffer for TLS Context Semaphore for HTTP connection.
+ */
+static StaticSemaphore_t xTlsContextSemaphoreBufferHttp;
+
/**
* @brief Network connection context used for HTTP connection.
*/
@@ -1041,7 +1046,7 @@ static int priv_connectToServerWithBackoffRetries( NetworkContext_t * pNetworkCo
pNetworkContext->pcHostname = AWS_IOT_ENDPOINT;
pNetworkContext->xPort = AWS_MQTT_PORT;
pNetworkContext->pxTls = NULL;
- pNetworkContext->xTlsContextSemaphore = xSemaphoreCreateMutexStatic(&xTlsContextSemaphoreBuffer);
+ pNetworkContext->xTlsContextSemaphore = xSemaphoreCreateMutexStatic(&xTlsContextSemaphoreBufferMqtt);
pNetworkContext->disableSni = 0;
uint16_t nextRetryBackOff;
@@ -1314,6 +1319,8 @@ static int32_t connectToS3Server( NetworkContext_t * pNetworkContext,
/* Status returned by OpenSSL transport implementation. */
TlsTransportStatus_t tlsStatus = TLS_TRANSPORT_SUCCESS;
+ pNetworkContext->xTlsContextSemaphore = xSemaphoreCreateMutexStatic(&xTlsContextSemaphoreBufferHttp);
+
pNetworkContext->disableSni = 0;
/* Initialize TLS credentials. */
Hi,
I had reported a bug concerning the OTA MQTT which is now solved, I tried the OTA HTTP but failed, see the logs below. As for the MQTT OTA, the ESP32 reboots following a crash. Thank you for your hard work.