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

nRF 9160 DK - Asset Tracker (and NTP) not working (nrf_cloud_connect_failed: 22)

Hello!

I'm trying to make the asset_tracker sample working on the nRF9160 DK. The at_client worked just fine and I was able to connect to the base station (I'm using NBiOT). Now I'm planning to send/receive some data through UDP and first I wanted to try to connect to the nRF Cloud and then try some other sample programs, such as NTP. Here's the problem:

I changed the network mode in SES to NBIoT and it works as I checked it with %XSYSTEMMODE (it returns 0,1,0,0). But as soon as the system boots I'm getting an error:

***** Booting Zephyr OS v1.14.99-ncs1 *****
Application started
LTE LC config ...
nrf_cloud_connect failed: 22

and then it just reboots. With network set as default (LTE-M) it won't "fail" but won't connect either obviously. Now i've looked for a solution online but none of it worked (even custom .hex files targeted specifically at this problem). I've tried the AT%XEPCO=0 and AT%XBANDLOCK=1, "10010101" (this one doesn't work, returns an error).

Firmware: 1.0.0
Board v0.7.0
SES V4.16 Nordic Edition (64-bit)

I've had similar experience with other example programs trying to connect to the network. They work in LTE-M mode (trying to connect), but after changing it to NBIoT they're just crashing.

NTP for example:

***** Booting Zephyr OS v1.14.99-ncs1 *****
getaddrinfo err: 22

Exception occurred in Secure State
***** HARD FAULT *****
  Fault escalation (see below)
***** BUS FAULT *****
  Precise data bus error
  BFAR Address: 0x50008120
***** Hardware exception *****
Current thread ID = 0x20020134
Faulting instruction address = 0xe380
Fatal fault in ISR! Spinning...

Again, the at_client works fine as some of the other samples (like gps), so i believe the programming procedure isn't the problem. I'm guessing there's an additional configuration procedure needed which i don't know about.

merged.hex

Parents Reply Children
  • Okay, the AT command method just didn't work, it still insisted on the old APN. I've managed to put it into the project configuration files and it worked, so the issue was about the wrong APN the whole time. Now everything works as expected, including NTP and FTP examples even through DNS, but the asset_tracker has some problems still - this time it's -111 error and honestly I don't care about it anymore. Now I'm looking forward to make the whole system compatible with our software that is using AT commands for IP traffic, so I tried to run the uart sample, but somehow even this one has some problems. I guess it's a topic for another question because I've extended this one to the extreme anyway.

    Thank you for your time.

  • Hi, I have a similar problem of not being able to change the APN. If you could provide details on how you managed to get it to work ("I've managed to put it into the project configuration files and it worked"), that would be great!

    Kind regards, Terje

  • Hi,

    at the time the APN  was disappearing after cutting off the power, but I was able to change it with +CGDCONT command. You need to turn off the module first (by AT command), because CID0 can't be changed otherwise. In order to make it default (I'm not sure if this is the correct way, but here's how I did it and it worked), I changed it in the config files:

    - initial project config - conf in the project folder:

    • CONFIG_LTE_NETWORK_MODE_NBIOT=y
    • CONFIG_LTE_PDP_CMD=y

    after building the project (it was overwritten after every change of the project config), in build_nrf9160_pca10090ns/zephyr/.config :

    • CONFIG_LTE_PDP_CONTEXT="0,\"IP\",\"test.nbiot\"".

    After building the project once again, it should be the default APN. Good luck.

Related