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

nRF9160 mqtt_simple SES build error

Hi, Sir:

I am developing nRF9160 DK(pca10090) with mqtt_simple example in nRF Connect SDK(ncs/nrf/samples/nrf9160/mqtt_simple).  Firstly build the example , build OK, but  I set CONFIG_DNS_RESOLVER =y, rebuild again, there were 2 errors:

how to eliminate these errors?

Harry

Best Wishes!

Parents
  • Hi.

    May I ask what it is you want to achieve?

    The mqtt_simple sample already does hostname resolution (via getaddrinfo), so there should be no need for doing your own DNS lookup.

    Also, I can not see any errors in the picture. What were the errors you got?

    Best regards,

    Didrik

Reply
  • Hi.

    May I ask what it is you want to achieve?

    The mqtt_simple sample already does hostname resolution (via getaddrinfo), so there should be no need for doing your own DNS lookup.

    Also, I can not see any errors in the picture. What were the errors you got?

    Best regards,

    Didrik

Children
  • Hi, Didrik:

    I tested mqtt_simple in nb-lot mode, I found it always print error when the code running in nRF9160:

    Fullscreen
    1
    2
    ERROR: getaddrinfo failed 22
    ERROR: mqtt_connect -47
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I have tested my SIM card in at_client with LTE Link Monitor, it works well, when I read SYSTEMMODE, it returned

    Fullscreen
    1
    2
    3
    AT%XSYSTEMMODE?
    %XSYSTEMMODE: 0,1,0,0
    OK
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    AT+COPS=3,2
    OK
    AT+COPS?+COPS: 0,2,"46000",9
    OK
    AT%XCBAND%XCBAND: 8
    OK
    AT+CGDCONT?+CGDCONT: 0,"IP","CMNBIOT","100.80.79.43",0,0
    OK
    AT+CGACT?+CGACT: 0,1
    OK
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

     I guess there may be a problem with DNS, so I modified the configuration mentioned above, after that, build errors:


    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    /home/hurry/ncs/nrf/samples/nrf9160/mqtt_simple/build_nrf9160_pca10090ns/zephyr/include/generated/autoconf.h (22.11.2019 09:49:50) is newer than zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj (22.11.2019 09:30:40).
    Compiling 'empty_file.c'
    zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj (22.11.2019 09:50:26) is newer than zephyr/zephyr_prebuilt.elf (22.11.2019 09:30:40).
    Linking 'zephyr_prebuilt.elf'
    B 976 KB 11.05%
    B 128 KB 26.83%
    B 2 KB 5.86%
    In function `dns_resolve_init':
    undefined reference to `net_context_get'
    undefined reference to `net_context_bind'
    ld returned 1 exit status
    Build failed
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    In china , the common DNS server is 114.114.114.114, so I added this DNS serverwe,

    Best regards,

    Harry