This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

FOTA with NB-IoT failing

Hi community

I'm trying to evaluate the possibilities of an application update over the air via NB-Iot. According to this post this should be possible.

I'm using the application_update example with the nRF9160-DK (B1).

The example works fine with LTE-M and is able to download the update.

In the prj.conf I changed the defaults for the fragment size (2048 B) and the network mode (LTE-M) to 512 B and NB-IoT by adding the following lines:

CONFIG_DOWNLOAD_CLIENT_HTTP_FRAG_SIZE_512=y
CONFIG_LTE_NETWORK_MODE_NBIOT=y

The code compiles and the LTE Link does connect. It also connects to the server but then it fails with the error 116, see below:

*** Booting Zephyr OS build v2.6.99-ncs1  ***
HTTP application update sample started
LTE Link Connecting ...
LTE Link Connected!
Press Button 1 to perform application firmware update
I: Configuring socket timeout (30 s)
I: Connecting to hidden-url.com
I: Downloading: FOTA/app_update.bin [0]
E: Error in recv(), errno 116
E: Download client error
Received error from fota_download

Does anyone have an idea whats wrong here?

Thanks!

Simon

  • Hi Charlie

    The PSM was set by default. I tried again after I disabled it (set the first three digits to one).

    But it is still failing, maybe there are some timeout parameters set by the carrier, I cannot say that.

    With your btw tipp of converting the bin to pcapng I looked into the trace myself. It still does the RCC Release, see attached.

    What is visible too is that there are loads of TCP retransmissions, double ACK and out-of-order packets - It seems like the tcp communication just isn't working as intended.

    I have heard about problems with NB-IoT and TCP. So I'm asking myself if its just not possible to properly communicate with TCP over NB-IoT (or only if you're lucky), what do you think?

    trace-2021-10-14T15-31-32.772Z.pcapng

    Thanks and best wishes,

    Simon

  • Hi Simon,

    I find some discussion mentioned that Swisccom does not enable the APN correction on its network that means the user needs to specify the correct APN in the device.I guess this might be the cause of the problem. Please try to add the following lines to the configuration file:

    CONFIG_PDN_SYS_INIT=y
    CONFIG_PDN=y
    CONFIG_PDN_DEFAULTS_OVERRIDE=y
    CONFIG_PDN_DEFAULT_APN="1\"IP\",\"globaldata.net\""

    Regarding TCP over NB-IoT, while NB-IoT supports both TCP and UDP as transport protocols. However, TCP is sensitive to delays and packet losses during data transmission. If you compare the feature of LTE-M and NB-IoT,  "TCP over NB-IoT" is not a good practice on TCP/MQTT, TCP/HTTP/FOTA solution, you should use LTE-M as your first option.

    Best regards,

    Charlie

  • Hi Charlie,

    Thanks for yor answer.

    If I add those two lines I get the error that these Kconfig symbols are undefined:

    c:\Users\moss\Code\application_update_moss\prj.conf:68: warning: attempt to assign the value 'y' to the undefined symbol LTE_PDP_CMD
    
    c:\Users\moss\Code\application_update_moss\prj.conf:69: warning: attempt to assign the value '"1\"IP\",\"globaldata.net\""' to the undefined symbol LTE_PDP_CONTEXT

    Do I have to somehow activate those config options? I'm using the nRF Connect SDK 1.7.0.

    Best regards,

    Simon

  • Sorry, the latest NCS uses a different way to configure APN, I have corrected the former suggestion.

  • Hi Charlie,

    thanks! I tried it again, doesn't work, trace attached. Let's put it in another way: Do you or anyone else ever managed to properly do a FOTA over NB-IoT?

    trace-2021-10-18T15-35-53.786Z.pcapng

    Best wishes,

    Simon

Related