Testing the cellular connection with the AT Client sample

A good starting point for experimenting with the nRF9160 DK is to program and test the nRF9160: AT Client sample. You can also use it to troubleshoot and debug any connection issues.

The AT Client sample enables you to send AT commands to the LTE-M/Narrowband Internet of Things (NB-IoT) modem of your nRF9160 DK to test and monitor the cellular connection.

Complete the following steps to build and test the AT Client sample:

  1. Build and program the sample application as described in Building and programming a sample application.

    Use the following information when opening the nRF Connect SDK Project, where NCS_folder is the folder where you installed the nRF Connect SDK (for example, C:\NCS):

    • CMakeLists.txt: NCS_folder\nrf\samples\nrf9160\at_client\CMakeLists.txt
    • Board Directory: NCS_folder\zephyr\boards\arm\nrf9160dk_nrf9160
    • Board Name: nrf9160dk_nrf9160ns
    • Build Directory: accept the default
    Note: The AT Client sample is also provided as a prebuilt firmware image. If you do not want to build the sample yourself but program it to troubleshoot connection issues, follow the steps in Updating the application firmware to program the nrf9160dk_at_client_*.hex file from the nRF9160 DK application and modem firmware package that you can download from the nRF9160 DK Downloads page.
  2. Test the AT client sample as described in Testing the AT Client sample.
  3. Optional: If you are experiencing problems when testing the GPS functionality, check if the network operator supports Power Saving Mode (PSM) or Extended Discontinuous Reception (eDRX) with the Subscriber Identity Module (SIM) card that you are using.
    PSM or eDRX are required to retrieve Global Positioning System (GPS) data.

    Complete the following steps to check if PSM is activated:

    1. In nRF Connect LTE Link Monitor, deselect the check box for Automatic requests.
    2. In the terminal view, enter AT+CFUN=4 in the AT command text field and click Send to put the modem in offline state.
    3. Enter AT+CFUN?.
      The command should return +CFUN: 4, which indicates that the modem is in offline state. If it returns a different value, repeat the previous step.
    4. Enter one of the following AT commands to set the system mode:
      • For LTE-M: AT%XSYSTEMMODE=1,0,1,0
      • For NB-IoT: AT%XSYSTEMMODE=0,1,1,0
    5. Enter AT+CFUN=0 to set the parameter to non-volatile memory.
    6. Power-cycle the nRF9160 DK.
    7. In LTE Link Monitor, select the check box for Automatic requests and connect to the device again.
    8. Enter AT+CFUN=1 to turn on the modem.
    9. Enter AT+CFUN?.
      The command should return +CFUN: 1, which indicates that the modem is in normal mode.
    10. Enter AT+CEREG=4 to enable receiving Active Time and periodic Tracking Area Update (TAU) values.
      See Network registration status +CEREG for more information.
    11. Enter AT+CEREG? to display the received values.
      You should see non-empty values at the eighth and ninth position of the returned comma-separated string.
    If the values are received correctly, PSM is activated.
See the nRF91 AT Commands Reference Guide for a list of supported AT commands.