nRF9161 FOTA + TLS Download Error

Hi,

We are using `fota_download` library on our nRF9161 design running mfw-nrf91x1_2.0.1 to download a firmware upgrade image from our Amazon AWS server location.

When trying to download with TLS enabled, fota_donwload_start function errors out with errno 122: EMSGSIZE, however everything works fine when TLS is not being used. We are also able to download the image if TLS is setup on our local PC/server.

Our current understanding is that the nRF9161 delegates TLS/socket processing to the modem firmware. Adjusting the fragment size in our firmware to a smaller value hasn't resolved the problem, and error 122 persists.
We’ve looked into modifying the TLS settings on AWS server, however that doesn’t seem to be an option as of now.

Wondering if you have any recommendations on how to work around the problem?

  • Yes, we have set CONFIG_DOWNLOAD_CLIENT_BUF_SIZE to 4096 and tried fragmentation size both 1024 and 2048 however the download still fails.

    We have tried to setup another server and set fragmentation size to 1024 on the server side and found out that download does works for  both CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024 and CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_2048.

    Unfortunately we are unable to change the fragmentation size on the AWS server. Is there any other work around we could try?

  • Reading through your case again, is this the nRF9160 or the nRF9161? Assuming that you see the same issue on both devices?

    Could you also check the Life Cycle Events on AWS server?

    Please add the following to your project to enable more debug information:

    CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL_DBG=y

    CONFIG_DOWNLOAD_CLIENT_LOG_HEADERS=y

    Kind regards,
    Øyvind

  • The file is being downloaded through HTTPS via AWS API Gateway where mTLS is enabled. The link that you sent was to AWS IoT where we do not currently have an issue

  • Thanks for your patience. 

    OhmMyGod said:
    We have tried to setup another server and set fragmentation size to 1024 on the server side and found out that download does works for  both CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_1024 and CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_2048.

    No updates yet to this issue. Still ongoing investigation. 

    Could you please try adding the following configs for more debug logs

    CONFIG_NRF_MODEM_LIB_LOG_LEVEL_DBG=y
    CONFIG_NRF_MODEM_LIB_NET_IF_LOG_LEVEL_DBG=y
    CONFIG_NET_CONNECTION_MANAGER_LOG_LEVEL_DBG=y
    CONFIG_NET_LOG=y
    CONFIG_DOWNLOAD_CLIENT_LOG_LEVEL_DBG=y
    

    Thanks!

    Kind regards,
    Øyvind

Related