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. 

  • 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.

  • I have not tried to set the APN manually lately, the modem usually figures that out automatically based on the network, so my memory there is a bit rusty. I will run some tests tomorrow and come back to you then.

    But, it could also be that the network does not support ePCO.

    Could you try to add CONFIG_LTE_LEGACY_PCO_MODE=y to the prj.conf?

    And are you building with SES? If so, you must re-open the project, or use 'Project -> Run CMake...' for changes to prj.conf (or other configuration files) to take effect.

  • Looks like there is a dependency where you need

    CONFIG_LTE_PDP_CMD=y

    for 

    CONFIG_LTE_PDP_CONTEXT=...

    to be allowed.

    It's still not working but at lease now AT+CGDCONT? produces the right result.

    Some other issue is causing it to give up after only one connection attempt.

Related