Download from Azure fails with error code -122

Hi,

I want to download FOTA-updates with HTTPS from a function app running on Azure. I am not using IoT hub or MQTT. I'm using modem firmware 2.0.4 in combination with version 2.7.0 of the nRF Connect SDK. I have provisioned the required root certificate, and the download is performed via the download_client.

When a download is attempted, a connection is established, but downloading fails with error code -122 when `recv` is called for the first time. My understanding is that this is due to the secure buffer in the modem (2kB) being exhausted due to Azure sending too much data. I have enabled `CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024, but this leads to the same result. Is there a way to resolve this? The other questions I've found all refer to IoT hub and MQTT.

Parents
  • Hi,

    Sorry, I don't have much information to work with here... Can you maybe share some code snippets that allow me to have a better look at your implementation.

    Here is the documentation for the "Download Client" library (link). Did you call "download_client_set_host()" and "modem_key_mgmt_write()" as asked here?

    Moreover, the application must provision the TLS credentials and pass the security tag to the library when using HTTPS and calling the download_client_set_host() function. To provision a TLS certificate to the modem, use modem_key_mgmt_write() and other Modem key management APIs.

    Also, I am wondering why you are not using the Azure FOTA library (link)? I believe it should handle most of your issue by itself.

    Best regards,

    Simon

Reply
  • Hi,

    Sorry, I don't have much information to work with here... Can you maybe share some code snippets that allow me to have a better look at your implementation.

    Here is the documentation for the "Download Client" library (link). Did you call "download_client_set_host()" and "modem_key_mgmt_write()" as asked here?

    Moreover, the application must provision the TLS credentials and pass the security tag to the library when using HTTPS and calling the download_client_set_host() function. To provision a TLS certificate to the modem, use modem_key_mgmt_write() and other Modem key management APIs.

    Also, I am wondering why you are not using the Azure FOTA library (link)? I believe it should handle most of your issue by itself.

    Best regards,

    Simon

Children
Related