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?

Parents
  • modem_trace.mtrace

    *** Booting nRF Connect SDK v2.5.0 ***
    I: Starting bootloader
    I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok
    =0x3
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_
    ok=0x3
    I: Boot source: none
    I: Image index: 0, Swap type: none
    I: Bootloader chainload address offset: 0x10000
    *** Booting nRF Connect SDK v2.5.0 ***
    I: LTE Node application v1.0.5
    I: Trace thread ready
    I: Trace level override: 2
    I: IMEI: 1400D8DEC570E
    E: Failed to read data (id: 1, len: 4), err: -2
    E: Failed to get Serial ID
    I: Entered state ST_DISCONNECTED
    I: Entered state ST_INIT
    +CEREG: 2,"3BAF","03B05117",7
    +CSCON: 1
    +CGEV: ME PDN ACT 0,0
    +CNEC_ESM: 50,0
    +CEREG: 5,"3BAF","03B05117",7,,,"00000000","10101111"
    I: L4 Event: Connected
    I: Entered state ST_NETWORK_UP
    I: Entered state ST_CONNECTED
    I: Subscribing to: on-config-changed/n/1400D8DEC570E
    E: Library is in the wrong state (MQTT_STATE_DISCONNECTED), MQTT_STAT
    E_CONNECTED required
    E: Failed to subscribe to topics, err: -95
    I: Connected successfully
    I: Upgrading Sensor image
    I: Upgrading self with image: https://config.api.waites.net/v1/sensor
    -core/Sensor-IEP-N1_217A7_v1.6.0.bin
    D: URI checksums 191005400,1987551763,0,0
    I: Downloading: v1/sensor-core/Sensor-IEP-N1_217A7_v1.6.0.bin [0]
    %XTIME: "8A","4270305162428A","01"
    I: Setting up TLS credentials, sec tag count 1
    I: Connecting to config.api.waites.net
    E: Error in recv(), errno 122
    W: Download socket error. 2 retries left...
    I: Reconnecting...
    I: Setting up TLS credentials, sec tag count 1
    I: Connecting to config.api.waites.net
    E: Error in recv(), errno 122
    W: Download socket error. 1 retries left...
    I: Reconnecting...
    I: Setting up TLS credentials, sec tag count 1
    I: Connecting to config.api.waites.net
    E: Error in recv(), errno 122
    E: Download client error
    D: No DFU target was initialized
    W: Download failed, retries left 4...
    I: Sleeping...
    E: Received error from fota downloadHandler, err: 4
    +CSCON: 0
    

    Hi,

    please see attached the modem trace as well as application log. Please note that the trace was collected from the DevKit to avoid any issues with custom hardware. Here are the details on the SW/HW

    Board: nRF9160DK
    modem firmware version: mfw_nrf9160_1.3.5
    nRF SDK version: v2.5.0

Reply
  • modem_trace.mtrace

    *** Booting nRF Connect SDK v2.5.0 ***
    I: Starting bootloader
    I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok
    =0x3
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_
    ok=0x3
    I: Boot source: none
    I: Image index: 0, Swap type: none
    I: Bootloader chainload address offset: 0x10000
    *** Booting nRF Connect SDK v2.5.0 ***
    I: LTE Node application v1.0.5
    I: Trace thread ready
    I: Trace level override: 2
    I: IMEI: 1400D8DEC570E
    E: Failed to read data (id: 1, len: 4), err: -2
    E: Failed to get Serial ID
    I: Entered state ST_DISCONNECTED
    I: Entered state ST_INIT
    +CEREG: 2,"3BAF","03B05117",7
    +CSCON: 1
    +CGEV: ME PDN ACT 0,0
    +CNEC_ESM: 50,0
    +CEREG: 5,"3BAF","03B05117",7,,,"00000000","10101111"
    I: L4 Event: Connected
    I: Entered state ST_NETWORK_UP
    I: Entered state ST_CONNECTED
    I: Subscribing to: on-config-changed/n/1400D8DEC570E
    E: Library is in the wrong state (MQTT_STATE_DISCONNECTED), MQTT_STAT
    E_CONNECTED required
    E: Failed to subscribe to topics, err: -95
    I: Connected successfully
    I: Upgrading Sensor image
    I: Upgrading self with image: https://config.api.waites.net/v1/sensor
    -core/Sensor-IEP-N1_217A7_v1.6.0.bin
    D: URI checksums 191005400,1987551763,0,0
    I: Downloading: v1/sensor-core/Sensor-IEP-N1_217A7_v1.6.0.bin [0]
    %XTIME: "8A","4270305162428A","01"
    I: Setting up TLS credentials, sec tag count 1
    I: Connecting to config.api.waites.net
    E: Error in recv(), errno 122
    W: Download socket error. 2 retries left...
    I: Reconnecting...
    I: Setting up TLS credentials, sec tag count 1
    I: Connecting to config.api.waites.net
    E: Error in recv(), errno 122
    W: Download socket error. 1 retries left...
    I: Reconnecting...
    I: Setting up TLS credentials, sec tag count 1
    I: Connecting to config.api.waites.net
    E: Error in recv(), errno 122
    E: Download client error
    D: No DFU target was initialized
    W: Download failed, retries left 4...
    I: Sleeping...
    E: Received error from fota downloadHandler, err: 4
    +CSCON: 0
    

    Hi,

    please see attached the modem trace as well as application log. Please note that the trace was collected from the DevKit to avoid any issues with custom hardware. Here are the details on the SW/HW

    Board: nRF9160DK
    modem firmware version: mfw_nrf9160_1.3.5
    nRF SDK version: v2.5.0

Children
No Data
Related