This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

building at_client for nb-iot on nrf9160-dk

select at_client folder

west build -b nrf9160dk_nrf9160ns -p

shows this warning

```

warning: The choice symbol LTE_NETWORK_MODE_NBIOT (defined at
/Users/paul_tanner/Nordic/nrfsrc/ncs/nrf/lib/lte_link_control/Kconfig:152) was selected (set =y),
but no symbol ended up as the choice selection. See
docs.zephyrproject.org/.../CONFIG_LTE_NETWORK_MODE_NBIOT.html and/or
look up LTE_NETWORK_MODE_NBIOT in the menuconfig/guiconfig interface. The Application Development
Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
might be helpful too.```

```

paul_tanner@iMac at_client % ls

CMakeLists.txt build_nrf9160dk_nrf9160

README.rst build_nrf9160dk_nrf9160ns

at_client.hex prj.conf

at_client_nbiot.hex sample.yaml

build src

```

note there is no Kconfig file here

when running the resulting binary

```

AT%XSYSTEMMODE?
%XSYSTEMMODE: 1,0,1,0

```

Not surprisingly it does not connect to any NB-IOT access point.

My questions are:

1. do I need a Kconfig for NB-IOT?

2. can I use the same firmware versions for this and LTE/M?

Thx. 

Parents
  • Sorry, forgot to say that LTE_NETWORK_MODE_NBIOT=y is set in prj.conf

  • Hi,

    The CONFIG_LTE_NETWORK_MODE_* Kconfig symbols are for the lte_link_control library.

    As the lte_link_control library is used for configuring the modem (specifically the LTE link) from an application running on the application core, and the purpose of the at_client is that you can configure the modem manually, the at_client does not use the lte_link_control library.

    As the lte_link_control library is not enabled, the Kconfig symbols it uses will not be defined. That is the reason for the build warning (in general, I recommend that you treat Kconfig warnings as errors).

    Instead, when you use the at_client sample, you must configure the modem manually. To set the system mode to NB-IoT, you can use AT%XSYSTEMMODE=0,1,x,0, where x is 1 if you also want GPS, 0 otherwise. Note that the modem must be offline (CFUN=4 or 0) when you set the system mode.

    You can then use AT+CFUN=0 to store the configuration in permanent memory.

     

    1. do I need a Kconfig for NB-IOT?

     Only when using the lte_link_control library.

     

    2. can I use the same firmware versions for this and LTE/M?

     You can use the same modem firmware for both modes. If you do not set the mode, LTE-M is the default.

    If you are using the lte_link_control library, the default is controlled by the Kconfig options. But, the system mode can also be changed at run-time by the application.

    And, again, to be clear: The at_client sample does not use the lte_link_control library, and requires you to configure the modem manually.

    Best regards,

    Didrik

  • It is a bit hard to say for sure without seeing more of the log, but at the moment those commands were sent, the modem was searching for an NB-IoT network:

    +CEREG: 5,2,"FFFE","FFFFFFFF",9,0,0,"11100000","11100000", The "2" means that it is searching, the "9" is NB-IoT, the F'es indicate that it has not found any cells yet.

    But it has not found any signal:

    +CESQ: 99,99,255,255,255,255

    This is typical of an "out of coverage" scenario, although there is a chance that the device would be able to find a network if left searching for a longer period of time.

    But, if the lte_link_control library times out, and you have not changed the timeout value, it has already been searching for 10 minutes. That should have been more than enough in most cases.

    A few months ago we had another customer report issues with Vodafone's NB-IoT network in the UK. I know they have been doing some improvements since then, but they might not have gotten to your area yet. Your Regional Sales Manager might know more about the current situation. If you do not know how to contact your RSM, you can send me a private message with your location, and I will provide the contact information.

    You can read more about the other customer's issue here: https://devzone.nordicsemi.com/f/nordic-q-a/64454/bad-nb-iot-signal-strength-in-uk

  • Thanks Didrik,

    I know that the NB-IoT coverage is patchy.  Based on your observations i think it might be worth moving to somewhere else.  No full coverage map is available but I have obtained one for my immediate area.

    Will report back later and maybe capture more logging.

  • I did another test with the asset tracker

    prj.conf includes:

    ```

    CONFIG_LTE_PDP_CONTEXT="0,\"IP\",\"lpwa.vodafone.iot\""
    CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=n
    CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y
    CONFIG_LTE_LEGACY_PCO_MODE=n
    CONFIG_LTE_PSM_REQ_RPTAU="00000110"
    CONFIG_LTE_PSM_REQ_RAT="00000010"

    ```

    Moved to a location where vodafone says there's a good NB-IoT service

    ```
    [00:00:00.322,387] [0m<inf> asset_tracker: Connecting to LTE network.[0m
    [00:00:00.329,101] [0m<inf> asset_tracker: This may take several minutes.[0m
    at%xsystemmode?

    %XSYSTEMMODE: 0,1,1,0
    OK

    ```

    It's looking for an NB-IoT service

    ```

    +CEREG: 2,"FFFE","FFFFFFFF",9,0,0,"11100000","11100000"
    [00:01:53.916,809] [0m<inf> asset_tracker: LTE cell changed: Cell ID: -1, Tracking area: 65534[0m
    [00:01:53.925,720] [0m<inf> asset_tracker: PSM parameter update: TAU: -1, Active time: -1[0m
    at+cereg?
    +CEREG: 5,2,"FFFE","FFFFFFFF",9,0,0,"11100000","11100000"
    OK

    ```

    time passes...

    ```

    [00:10:00.385,467] [0m<inf> lte_lc: Network connection attempt timed out[0m
    +CEREG: 0,"FFFE","FFFFFFFF",9,0,0,"11100000","11100000"
    [00:10:00.412,078] [0m<inf> lte_lc: Using fallback network mode[0m
    at%xsystemmode?

    %XSYSTEMMODE: 1,0,1,0
    OK

    ```

    It's now looking for an LTE/M service - which it won't find.

    Ideally it should keep looking for NB-IoT and I think I told it to do so:

    CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=n
    CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y

    Is that not correct?

  • Yes, you have configured it correctly to look for NB-IoT.

    However, the LTE link control library will by default try the other network mode as a fallback, if the device has not been able to connect to the network after a given time.

    You can disable the fallback mechanism by setting CONFIG_LTE_NETWORK_USE_FALLBACK=n in prj.conf, and you can change the timeout value with CONFIG_LTE_NETWORK_TIMEOUT (default is 600 seconds).

  • OK.  I think the problem was that we were out of range.

    The next test was from somewhere nearer to a mast.

    Now we get:

    ```

    +CEREG: 5,"1BE8","0029FF0B",9,,,"11100000","00101000"

    [00:02:01.235,626] [0m<inf> asset_tracker: Connected to LTE network.[0m

    [00:02:01.242,523] [0m<inf> asset_tracker: Network registration status: Connected - roaming[0m

    [00:02:01.251,220] [0m<inf> asset_tracker: PSM parameter update: TAU: 28800, Active time: -1[0m

    [00:02:01.479,919] [1;33m<wrn> [0m

    [00:02:01.719,909] [1;33m<wrn> date_time: getaddrinfo, error: -11[0m

    [00:02:01.928,924] [1;33m<wrn> date_time: getaddrinfo, error: -11[0m

    [00:02:02.151,916] [1;33m<wrn> date_time: getaddrinfo, error: -11[0m

    [00:02:02.408,935] [1;33m<wrn> date_time: getaddrinfo, error: -11[0m

    [00:02:02.415,344] [1;33m<wrn> date_time: Not getting time from any NTP server[0m

    [00:02:02.422,851] [0m<inf> asset_tracker: DATE_TIME_NOT_OBTAINED[0m

    [00:02:02.429,290] [0m<inf> asset_tracker: Connecting to cloud, attempt 1 of 8[0m

    [00:02:02.436,859] [0m<inf> asset_tracker: Cloud connection request sent.[0m

    [00:02:02.443,939] [0m<inf> asset_tracker: Connection response timeout is set to 30 seconds.[0m

    [00:02:02.452,789] [0m<inf> asset_tracker: CLOUD_EVT_CONNECTING[0m

    [00:02:03.655,975] [0m<dbg> nrf_cloud_transport.nct_connect: getaddrinfo failed -11[0m

    [00:02:03.663,970] [0m<inf> asset_tracker: CLOUD_EVT_CONNECTING[0m

    [00:02:03.670,166] [1;31m<err> asset_tracker: Failed to connect to cloud, error -3[0m

    [00:02:03.678,070] [1;31m<err> asset_tracker: Network error, check cloud configuration[0m

    [00:02:03.686,279] [1;31m<err> asset_tracker: Device will reboot in 300 seconds[0m

    ```

    I think we got a connection but there was another config issue.

    could it be that setting the APN

    ```

    CONFIG_LTE_PDP_CONTEXT="0,\"IP\",\"lpwa.vodafone.iot\""

    ```

    Did not work.

    I tried 

    ```

    AT+CGDCONT?
    
    
    
    
    OK

    ```

    This suggests that it is not set.  In that case any call requiring a connection would likely fail.

Reply
  • OK.  I think the problem was that we were out of range.

    The next test was from somewhere nearer to a mast.

    Now we get:

    ```

    +CEREG: 5,"1BE8","0029FF0B",9,,,"11100000","00101000"

    [00:02:01.235,626] [0m<inf> asset_tracker: Connected to LTE network.[0m

    [00:02:01.242,523] [0m<inf> asset_tracker: Network registration status: Connected - roaming[0m

    [00:02:01.251,220] [0m<inf> asset_tracker: PSM parameter update: TAU: 28800, Active time: -1[0m

    [00:02:01.479,919] [1;33m<wrn> [0m

    [00:02:01.719,909] [1;33m<wrn> date_time: getaddrinfo, error: -11[0m

    [00:02:01.928,924] [1;33m<wrn> date_time: getaddrinfo, error: -11[0m

    [00:02:02.151,916] [1;33m<wrn> date_time: getaddrinfo, error: -11[0m

    [00:02:02.408,935] [1;33m<wrn> date_time: getaddrinfo, error: -11[0m

    [00:02:02.415,344] [1;33m<wrn> date_time: Not getting time from any NTP server[0m

    [00:02:02.422,851] [0m<inf> asset_tracker: DATE_TIME_NOT_OBTAINED[0m

    [00:02:02.429,290] [0m<inf> asset_tracker: Connecting to cloud, attempt 1 of 8[0m

    [00:02:02.436,859] [0m<inf> asset_tracker: Cloud connection request sent.[0m

    [00:02:02.443,939] [0m<inf> asset_tracker: Connection response timeout is set to 30 seconds.[0m

    [00:02:02.452,789] [0m<inf> asset_tracker: CLOUD_EVT_CONNECTING[0m

    [00:02:03.655,975] [0m<dbg> nrf_cloud_transport.nct_connect: getaddrinfo failed -11[0m

    [00:02:03.663,970] [0m<inf> asset_tracker: CLOUD_EVT_CONNECTING[0m

    [00:02:03.670,166] [1;31m<err> asset_tracker: Failed to connect to cloud, error -3[0m

    [00:02:03.678,070] [1;31m<err> asset_tracker: Network error, check cloud configuration[0m

    [00:02:03.686,279] [1;31m<err> asset_tracker: Device will reboot in 300 seconds[0m

    ```

    I think we got a connection but there was another config issue.

    could it be that setting the APN

    ```

    CONFIG_LTE_PDP_CONTEXT="0,\"IP\",\"lpwa.vodafone.iot\""

    ```

    Did not work.

    I tried 

    ```

    AT+CGDCONT?
    
    
    
    
    OK

    ```

    This suggests that it is not set.  In that case any call requiring a connection would likely fail.

Children
Related