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

nRF9160 - getaddrinfo return 60

Hello,

I'm trying to run Simple_mqtt code on developement board with nRF9160. Connection to LTE takes in my opinion very long time. On basic AT sample code it's connecting a way faster. Next and main issue is that I can't connect to any mqtt broker. First I didn't change anything in code and at end I have information:

ERROR: getaddrinfo failed 60
ERROR: mqtt_connect -47

I changed mqtt broker for HiveMQ and I have exactly the same error. I'm using the latest software from your side:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2020-02-25T18:25:23.497Z INFO Application data folder: C:\Users\PiotrDurys\AppData\Roaming\nrfconnect\pc-nrfconnect-linkmonitor
2020-02-25T18:25:23.598Z DEBUG App pc-nrfconnect-linkmonitor v1.1.1 official
2020-02-25T18:25:23.599Z DEBUG App path: C:\Users\PiotrDurys\.nrfconnect-apps\node_modules\pc-nrfconnect-linkmonitor
2020-02-25T18:25:23.599Z DEBUG nRFConnect 3.3.0 is supported by the app (^3.2.0)
2020-02-25T18:25:23.599Z DEBUG nRFConnect path: C:\Users\PiotrDurys\AppData\Local\Programs\nrfconnect\resources\app.asar
2020-02-25T18:25:23.599Z DEBUG HomeDir: C:\Users\PiotrDurys
2020-02-25T18:25:23.599Z DEBUG TmpDir: C:\Users\PIOTRD~2\AppData\Local\Temp
2020-02-25T18:25:23.601Z VERBOSE Could not fetch serial number for serial port at COM5
2020-02-25T18:25:23.602Z VERBOSE Could not fetch serial number for serial port at COM3
2020-02-25T18:25:27.638Z INFO Modem port is opened
2020-02-25T18:25:27.648Z DEBUG modem >> AT+CFUN?\x0D\x0A
2020-02-25T18:25:27.655Z DEBUG modem << +CFUN: 1\x0D\x0A
2020-02-25T18:25:27.657Z DEBUG modem << OK\x0D\x0A
2020-02-25T18:25:27.689Z DEBUG modem >> AT+CGSN=1\x0D\x0A
2020-02-25T18:25:27.695Z DEBUG modem << +CGSN: "352656100373839"\x0D\x0A
2020-02-25T18:25:27.698Z DEBUG modem << OK\x0D\x0A
2020-02-25T18:25:27.701Z DEBUG modem >> AT+CGMI\x0D\x0A
2020-02-25T18:25:27.707Z DEBUG modem << Nordic Semiconductor ASA\x0D\x0A
2020-02-25T18:25:27.709Z DEBUG modem << OK\x0D\x0A
2020-02-25T18:25:27.719Z DEBUG modem >> AT+CGMM\x0D\x0A
2020-02-25T18:25:27.727Z DEBUG modem << nRF9160-SICA\x0D\x0A
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I'm attaching log from connection. 

Regards

Piotr Durys

  • Hi.

    What SIM card are you using, and have you been able to use it (to send data) with other samples previously (such as the asset_tracker application)?

    When getaddrinfo times out (error code 60), that usually indicates that you are not able to send IP data due to the SIM card not being activated or supporting LTE-M/NB-IoT.

    As to why it takes so long to connect, it looks like it first tries to search for an LTE-M network, but when not finding one after 10 minutes, it starts to look for an NB-IoT network which it finds in a couple of seconds.

    Best regards,

    Didrik

  • Hi,

    Thank you for fast answer. 

    I'm using T-mobile Poland NB-IoT card. I'm able to connect with this card to MQTT brocker via other module form quectel. I'm sure that the card is correct. I know that the T-mobile prefer using UDP instead of TCP/IP maybe that is the issue. Is this possible to switch searching NB-Iot first than LTE-M?

  • You can set the preferred mode in the prj.conf file.

    Add the following line to the prj.conf file to use NB-IoT by default:

    CONFIG_LTE_NETWORK_MODE_NBIOT=y

    Note that if you are using Segger Embedded Studio, you have to re-open the project for changes made in prj.conf to take effect.

    Could you take a modem trace to help me find th esource of your problem?

    This guide explains how to capture a modem trace: https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/how-to-get-modem-trace-using-trace-collector-in-nrf-connect

  • Hello,

    Bellow I'm attaching needed information to debug the issue:

    • The mfw(modem f/w version) information = v1.1.1
    • Serial log file saved in Link Monitor.(*.txt)
    • Modem trace captured by Trace Collector. (trace*.bin)
    • nRF91 DK version(if you used) = 0.9.0

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    2020-02-27T09:09:47.115Z INFO Application data folder: C:\Users\PiotrDurys\AppData\Roaming\nrfconnect\pc-nrfconnect-linkmonitor
    2020-02-27T09:09:47.195Z DEBUG App pc-nrfconnect-linkmonitor v1.1.1 official
    2020-02-27T09:09:47.195Z DEBUG App path: C:\Users\PiotrDurys\.nrfconnect-apps\node_modules\pc-nrfconnect-linkmonitor
    2020-02-27T09:09:47.195Z DEBUG nRFConnect 3.3.0 is supported by the app (^3.2.0)
    2020-02-27T09:09:47.195Z DEBUG nRFConnect path: C:\Users\PiotrDurys\AppData\Local\Programs\nrfconnect\resources\app.asar
    2020-02-27T09:09:47.195Z DEBUG HomeDir: C:\Users\PiotrDurys
    2020-02-27T09:09:47.195Z DEBUG TmpDir: C:\Users\PIOTRD~2\AppData\Local\Temp
    2020-02-27T09:09:47.199Z VERBOSE Could not fetch serial number for serial port at COM5
    2020-02-27T09:09:47.199Z VERBOSE Could not fetch serial number for serial port at COM3
    2020-02-27T09:10:15.285Z INFO Modem port is opened
    2020-02-27T09:10:15.295Z DEBUG modem >> AT+CFUN?\x0D\x0A
    2020-02-27T09:10:15.326Z DEBUG modem << +CFUN: 1\x0D\x0A
    2020-02-27T09:10:15.329Z DEBUG modem << OK\x0D\x0A
    2020-02-27T09:10:15.347Z DEBUG modem >> AT+CGSN=1\x0D\x0A
    2020-02-27T09:10:15.356Z DEBUG modem << +CGSN: "352656100373839"\x0D\x0A
    2020-02-27T09:10:15.358Z DEBUG modem << OK\x0D\x0A
    2020-02-27T09:10:15.364Z DEBUG modem >> AT+CGMI\x0D\x0A
    2020-02-27T09:10:15.373Z DEBUG modem << Nordic Semiconductor ASA\x0D\x0A
    2020-02-27T09:10:15.380Z DEBUG modem << OK\x0D\x0A
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    trace-2020-02-27T09-11-58.462Z.bin

    Regards

    Piotr Durys

  • Thanks, I'll have a look at the trace to see if I find anything wrong.

    In the meantime, Where does the AT commands come from?

    What happens if you do not send them?

    If the link Monitor is sending them automatically, you can turn it off by un-selecting the "Automatic requests" checkbox.

1 2 3 4