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
  • Hi,

     

    Your problem is the dns resolution, as "getaddrinfo err: 22" indicates that your local carrier does not provide you with a DNS server.

    You can try to hardcode the IP address if you want, and in addition, I would recommend that you contact your carrier to let them know about this issue.

     

    Kind regards,

    Håkon

  • Hi,

    thank you for your response. I'm still trying to make the NTP sample work. At this moment I'm fine with providing an exact IP address . So i've changed the NTP_HOST domain name to IP address (tried many, 129.240.2.6 for example) and figured that it could work without any other changes, as I looked it up in udp_with_psm sample and it's done the same way there (just an IP address as an getaddrinfo function argument). Looks like it works:

    client_fd: 2
    bind err: 0
    
    sendto ret: 48

    and iirc the return value of sendto is supposed to represent octets sent. But there's no response from the NTP server.

    I've also tried sending it to our private server but without success (no packets received on server side).

    Making the asset_tracker work would be nice but i'm not sure how to make it work without the DNS server and it's not my priority.

  • Hi,

     

    Thank you for the log.

    Do you have a iBasis SIM card you can try with nb-iot to see if this works better?

    Have you contacted your current local carrier and asked about the issues you are seeing? DNS does not seem to be provided by the network, and I would also recommend asking if they have any restriction in TCP based traffic on NB-IoT.

     

    Kind regards,

    Håkon

  • No, I don't have the iBasis SIM. I'm trying to use different APN now. I'm able to do that manually in at_client and it does connect successfully:

    at+cgdcont?
    +CGDCONT: 0,"IP","test.nbiot","100.88.198.213",0,0

    However, after restarting the module it just insists to use the old APN (aiut.nbiot), even when I didn't specify it. I guess the same is happening when loading a program and it connects to the network automatically (like the ftp you've sent me to test). Is there a way to stop it from connecting to the old APN?

  • Set the APN manually, then issue "AT+CFUN=0" to store it persistently.

    When you reboot, it should now have the APN that you set.

     

    Kind regards,

    Håkon

  • Well, it doesn't work. The APN is remembered after changing the mode to offline (4), but power off just resets it to the default one.

    at+cgdcont?
    +CGDCONT: 0,"IP","aiut.nbiot","10.12.0.2",0,0
    OK
    at+cfun=0
    OK
    AT+CFUN?
    +CFUN: 4
    OK
    at+cgdcont=0,"IP","test.nbiot",,,,0
    OK
    AT+CFUN=1
    OK
    at+cgdcont?
    +CGDCONT: 0,"IP","test.nbiot","100.120.208.204",0,0
    OK
    at+cgcontrdp=0
    +CGCONTRDP: 0,,"test.nbiot","","","213.158.199.1","213.158.199.5",,,,,1500
    OK
    at+cfun=4
    OK
    AT+CFUN?
    +CFUN: 4
    OK
    AT+CFUN=1
    OK
    at+cgdcont?
    +CGDCONT: 0,"IP","test.nbiot","100.120.208.206",0,0
    OK
    at+cfun=0
    OK
    at+cfun=1
    OK
    AT+CFUN?
    +CFUN: 1
    OK
    at+cgdcont?
    +CGDCONT: 0,"IP","aiut.nbiot","10.12.0.2",0,0
    OK

  • Also, are there any plans for supporting IP traffic through AT commands? This is a bit of a deal breaker, as we'd have to make drastic changes in our software.

Reply Children
Related