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 Reply Children
  • I've managed to figure it out, the key information was in the documentation of the download client:

    The library requires the host server to provide a Content-Range field in the HTTP GET header when using HTTPS.

    The error I received (-122) was confusing to me because I incorrectly attributed it to the size of the certificates. After implementing support for the Range and Content-Range in our download endpoint, the download succeeded.

Related