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

nRF9160: not retrieving DNS servers with IPV6

I am currently working on a project with a nRF9160 and in the very early stages of evaluation.

I have a few, hope not too many questions that I hope can be answered here, if it is not too much trouble.
I am starting fresh with the nRF9120SK, but do have prior experience with the nRF51 and nRF52 chips, though it was several years ago, the development environments were quite different, especially with the added Zephyr libraries.  Ultimately this project might be implemented as a serial_lte_modem using another MCU that handles the main logic of the device.

I have been searching on these forums and internet search engines today and yesterday quite a bit and have a few unresolved questions.

Using a macOS Big Sur development environment, I can go into specifics but it is not related to the current question.
I am currently using the example at
/opt/nordic/ncs/v1.4.1/nrf/applications/serial_lte_modem

Built with the command
west build -b nrf9160_pca10090ns

Is there a difference between these two commands?  Does it result in the same build?
west build -b nrf9160_pca10090ns
west build -b nrf9160dk_nrf9160ns

I am using the SDK version v1.4.1, modem software version 1.2.3 (I had some trouble updating it, it was in a very early 0.6.x.x-alpha state when I received the PCB).
Following this guide
https://devzone.nordicsemi.com/f/nordic-q-a/53208/updating-nrf9160-modem-firmware-through-the-command-line
I was able to bring it up to date after a few hours of frustration.

If anyone is interested in how I brought this up to date I can share the procedure, but I had to use the python nrfjprog wrapper to do it.

I have a nRF9160DK and am using a MVNO SIM operating in Japan with KDDI by au.

I am going to provide the output of some commands so you can see the results.

It appears that this SIM only supports IPV6, is there such a thing?

Here is the output of some of the network information.

+CGPADDR: 0,"0000:0000:0000:0000:0000:004A:XXXX:9801" (removed some information for privacy)
+CGCONTRDP: 0,,"ims","","",,,,,,,1500

I have another SIM here (I have to manually set the APN) that retrieves an IPV4 address and DNS servers with the following output.

I have the following output with that SIM card, I have to use AT+CGDCONT=0,"IP","iijmio.jp" to set the APN before enabling the modem.

If you would like to add this SIM card to the list of automatically configured APNs please let me know, I am more than happy to provide details.

+CGDCONT: 0,"IP","iijmio.jp","XXX.XXX.123.XXX",0,0 (removed some information for privacy)
+CGCONTRDP: 0,,"iijmio.jp","","","202.232.2.2","202.232.2.3",,,,,1500

I am using this guide at 

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.4.1/nrf/applications/serial_lte_modem/doc/slm_description.html

to test a connection to google.com.  I can connect fine with the second listed SIM card that retrieves an IPV4 address.

I can not connect with the first SIM that retrieves an IPV6 address, it has no DNS servers.

I found information that I can manually specify DNS servers, but I don't know how to do this with AT commands.

https://devzone.nordicsemi.com/f/nordic-q-a/50029/nrf9160-modem-firmware-v1-0-0-setting-custom-dns-server/235419#235419

Parents
  • Hi,

     

    Is there a difference between these two commands?  Does it result in the same build?

     The board name was changed from nrf9160_pca10090(ns) to nrf9160dk_nrf9160(ns).

    For now, the two commands should be the same, but the old name (nrf9160_pca10090(ns)) will eventually be deprecated, so you should use nrf9160dk_nrf9160(ns).

     

    It appears that this SIM only supports IPV6, is there such a thing?

     I can't remember hearing about such SIM at the moment, but it doesn't sound impossible. Your network provider should be able to answer the question.

    What commands do you use to connect to google.com?

    What is the response to AT+CGDCONT? when you use the "IPv6 SIM"?

    Are you using LTE-M or NB-IoT?

     

    I found information that I can manually specify DNS servers, but I don't know how to do this with AT commands.

     There are currently no way of doing this with AT commands.

    Instead, you will have to modify the SLM application.

    Best regards,

    Didrik

  • I forgot to add the procedure I am using to connect to google.com, it is below, copied mostly from
    https://devzone.nordicsemi.com/f/nordic-q-a/53208/updating-nrf9160-modem-firmware-through-the-command-line

    AT#XSOCKET=1,1,0
    #XSOCKET: 1, 1, 0, 6
    OK

    AT#XCONNECT="google.com",80
    #XCONNECT: 1
    OK
    Send an HTTP request to the server.

    AT#XSEND=1,"HEAD / HTTP/1.1"
    #XSEND: 15
    OK

    AT#XSEND=0,"0D0A"
    #XSEND: 2
    OK

    AT#XSEND=1,"Host: www.google.com:443"
    #XSEND: 24
    OK

    AT#XSEND=0,"0D0A"
    #XSEND: 2
    OK

    AT#XSEND=1,"Connection: close"
    #XSEND: 17
    OK

    AT#XSEND=0,"0D0A0D0A"
    #XSEND: 4
    OK
    Receive the response from the server.

    AT#XRECV
    HTTP/1.1 200 OK
    Content-Type: text/html; charset=ISO-8859-1
    [...]
    #XRECV: 1, 576
    OK

    AT#XRECV
    [...]
    Connection: close
    #XRECV: 1, 147
    OK
    Close the socket.

    AT#XSOCKET=0
    #XSOCKET: 0, closed
    OK

  • Ah, I didn't attempt to connect in the first trace, here is another one where I attempted to connect with both the hostname and then with a direct IP, it froze after the direct IP attempt connect, hope the modem trace shows why.

  • Hi,

    I've tried to decode both of your traces, but neither of them contains any information.

    A valid trace is typically several hundred kilobytes large.

    Did you enable modem traces in the application with CONFIG_BSD_LIBRARY_TRACE_ENABLED=y in your prj.conf (if you are building the application with SES, you must re-open the project or use Project->Run CMake for the changes to take effect).

    In addition, you must use AT%XMODEMTRACE=1,2 to enable modem traces in the modem. You can then store the setting with AT+CFUN=0, so that the modem will output traces also after reboots. The %XMODEMTRACE AT command can only be used when the modem is offline (CFUN=0 or 4).

  • Ah, ok I am going to try again, here is another attempt with the above options enabled.

    I deleted the entire build folder and rebuilt with "west build -b nrf9160dk_nrf9160ns"

  • Hm, I ran the two commands below and restarted, the nRF9160 is in a restart loop somehow, I will try to enable some more debug options to see if I can find out why...

    I only enabled CONFIG_BSD_LIBRARY_TRACE_ENABLED=y and then rebuilt, programmed.

    I as soon as I did the two commands...

    AT%XMODEMTRACE=1,2
    AT+CFUN=0

    I pressed the hardware reset key on the dev kit and now it just loops "Ready" about once a second, and I also checked the trace file, it is empty I think.

  • I am not sure what is going on with by build, it is not outputting a trace it seems, do you have a prebuilt hex file that I can upload to it?  Also please tell me which modem firmware I should run to match with it.  I was on 1.2.3, downgraded to 1.2.2 to see if that was the issue.  I have tried SDK 1.4.1 and 1.4.99 with the same results, here is the prj.conf file for the applications/serial_lte_modem application that I used to build with.  Any recommendations?  A different application perhaps? 

    If you can just provide me with a verified working hex file it should get things going also.  Please tell me which modem firmware version I should use with it.

    #
    # Copyright (c) 2020 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    #
    # General config
    CONFIG_LOG=y
    CONFIG_LOG_DEFAULT_LEVEL=3
    CONFIG_STACK_SENTINEL=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_RING_BUFFER=y

    # Segger RTT
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n

    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_NATIVE=n

    # BSD library
    CONFIG_BSD_LIBRARY=y
    # Align the max FD entry to BSD_MAX_SOCKET_COUNT(8)
    CONFIG_POSIX_MAX_FDS=8
    # Enable below for modem trace
    CONFIG_BSD_LIBRARY_TRACE_ENABLED=y

    # Use GPIO
    CONFIG_GPIO=y
    CONFIG_GPIO_NRFX=y
    CONFIG_GPIO_NRF_P0=y

    # UART interface
    CONFIG_SERIAL=y
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_TIMER2=y

    # LTE link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

    # Stacks and heaps
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192

    # AT_CMD
    # Enable AT_CMD debug for details
    CONFIG_AT_CMD_LOG_LEVEL_DBG=y

    # Device power management
    CONFIG_DEVICE_POWER_MANAGEMENT=y

    # Enable SUPL client support
    #CONFIG_SUPL_CLIENT_LIB=y

    # FOTA
    CONFIG_HTTP_PARSER_URL=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
    CONFIG_DFU_TARGET=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    CONFIG_FLASH=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y

    #
    # SLM-specific configurations
    #
    CONFIG_SLM_LOG_LEVEL_INF=y
    # Enable GPIO wakeup if sleep is expected
    #CONFIG_SLM_GPIO_WAKEUP=y
    # Use UART_0 (when working with PC terminal)
    CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
    # Use UART_2 (when working with external MCU)
    #CONFIG_SLM_CONNECT_UART_2=y
    #CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2

    # Use optional GPS service
    #CONFIG_SLM_GPS=y
    # Use optional FTP client service
    #CONFIG_SLM_FTPC=y
    # Use optional MQTT client service
    #CONFIG_SLM_MQTTC=y
    # Use optional HTTP client service
    CONFIG_SLM_HTTPC=y

Reply
  • I am not sure what is going on with by build, it is not outputting a trace it seems, do you have a prebuilt hex file that I can upload to it?  Also please tell me which modem firmware I should run to match with it.  I was on 1.2.3, downgraded to 1.2.2 to see if that was the issue.  I have tried SDK 1.4.1 and 1.4.99 with the same results, here is the prj.conf file for the applications/serial_lte_modem application that I used to build with.  Any recommendations?  A different application perhaps? 

    If you can just provide me with a verified working hex file it should get things going also.  Please tell me which modem firmware version I should use with it.

    #
    # Copyright (c) 2020 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
    #
    # General config
    CONFIG_LOG=y
    CONFIG_LOG_DEFAULT_LEVEL=3
    CONFIG_STACK_SENTINEL=y
    CONFIG_NEWLIB_LIBC=y
    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_RING_BUFFER=y

    # Segger RTT
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_UART_CONSOLE=n
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n

    # Network
    CONFIG_NETWORKING=y
    CONFIG_NET_SOCKETS=y
    CONFIG_NET_NATIVE=n

    # BSD library
    CONFIG_BSD_LIBRARY=y
    # Align the max FD entry to BSD_MAX_SOCKET_COUNT(8)
    CONFIG_POSIX_MAX_FDS=8
    # Enable below for modem trace
    CONFIG_BSD_LIBRARY_TRACE_ENABLED=y

    # Use GPIO
    CONFIG_GPIO=y
    CONFIG_GPIO_NRFX=y
    CONFIG_GPIO_NRF_P0=y

    # UART interface
    CONFIG_SERIAL=y
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_TIMER2=y

    # LTE link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_AUTO_INIT_AND_CONNECT=n

    # Stacks and heaps
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_HEAP_MEM_POOL_SIZE=16384
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192

    # AT_CMD
    # Enable AT_CMD debug for details
    CONFIG_AT_CMD_LOG_LEVEL_DBG=y

    # Device power management
    CONFIG_DEVICE_POWER_MANAGEMENT=y

    # Enable SUPL client support
    #CONFIG_SUPL_CLIENT_LIB=y

    # FOTA
    CONFIG_HTTP_PARSER_URL=y
    CONFIG_FOTA_DOWNLOAD=y
    CONFIG_FOTA_DOWNLOAD_PROGRESS_EVT=y
    CONFIG_DFU_TARGET=y
    CONFIG_DOWNLOAD_CLIENT=y
    CONFIG_DOWNLOAD_CLIENT_STACK_SIZE=4096
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_IMG_MANAGER=y
    CONFIG_FLASH=y
    CONFIG_IMG_ERASE_PROGRESSIVELY=y

    #
    # SLM-specific configurations
    #
    CONFIG_SLM_LOG_LEVEL_INF=y
    # Enable GPIO wakeup if sleep is expected
    #CONFIG_SLM_GPIO_WAKEUP=y
    # Use UART_0 (when working with PC terminal)
    CONFIG_UART_0_NRF_HW_ASYNC_TIMER=2
    # Use UART_2 (when working with external MCU)
    #CONFIG_SLM_CONNECT_UART_2=y
    #CONFIG_UART_2_NRF_HW_ASYNC_TIMER=2

    # Use optional GPS service
    #CONFIG_SLM_GPS=y
    # Use optional FTP client service
    #CONFIG_SLM_FTPC=y
    # Use optional MQTT client service
    #CONFIG_SLM_MQTTC=y
    # Use optional HTTP client service
    CONFIG_SLM_HTTPC=y

Children
No Data
Related