-
I have a project that was originally implemented with Azure Iot C SDK on an ESP32 and recently I started porting the code to Azure FreeRTOS Middleware. Originally when one or more properties were altered on the Device Properties JSON the device would automatically receive the updated JSON without calling for any LL API funcions. In Azure FreeRTOS Middleware my Device properties won't update unless I call AzureIoTHubClient_RequestPropertiesAsync, and adding ProcessLoop to a loop (as is done with IoTHubClient_LL_DoWork) doesn't appear to work because the TLS_Socket_Recv funcion breaks when there is nothing to receive at the socket. I used the socket implementations from the sample ESP32 project in the iot-middleware-freertos-samples repo. Is there a way to receive Device Properties updates automatically or is an update thread needed? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So I solved this problem by implementing the Transport layer functions using the esp-tls API instead of the esp_transport_ssl. For some reason if you're using the sample TLS functions from the esp32 demo while AzureIoTHubClient_ProcessLoop is inside a loop it breaks when the socket reads no data. I recommend this approach if you're having the same problem since it's very straightforward to implement (and simpler too), just read the ESP-TLS page on the ESP-IDF reference. |
Beta Was this translation helpful? Give feedback.
So I solved this problem by implementing the Transport layer functions using the esp-tls API instead of the esp_transport_ssl. For some reason if you're using the sample TLS functions from the esp32 demo while AzureIoTHubClient_ProcessLoop is inside a loop it breaks when the socket reads no data. I recommend this approach if you're having the same problem since it's very straightforward to implement (and simpler too), just read the ESP-TLS page on the ESP-IDF reference.