|
| 1 | +.. _at_client_sample: |
| 2 | + |
| 3 | +nRF9160: AT Client |
| 4 | +################## |
| 5 | + |
| 6 | +The AT Client sample demonstrates the asynchronous serial communication taking place over UART to the nRF9160 modem. |
| 7 | +The sample enables you to use an external computer or MCU to send AT commands to the LTE-M/NB-IoT modem of your nRF9160 device. |
| 8 | + |
| 9 | +Overview |
| 10 | +******** |
| 11 | + |
| 12 | +The AT Client sample acts as a proxy for sending directives to the nRF9160 modem via AT commands. |
| 13 | +This facilitates the reading of responses or analyzing of events related to the nRF9160 modem. |
| 14 | +The commands can be initiated from a terminal or the `LTE Link Monitor`_, which is an application implemented as part of `nRF Connect for Desktop`_. |
| 15 | + |
| 16 | +For more information on the AT commands, see the `AT Commands Reference Guide`_. |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +Requirements |
| 21 | +************ |
| 22 | + |
| 23 | +* The following development board: |
| 24 | + |
| 25 | + * nRF9160 DK board (PCA10090) |
| 26 | + |
| 27 | + |
| 28 | +Building and running |
| 29 | +******************** |
| 30 | + |
| 31 | +.. |sample path| replace:: :file:`samples/nrf9160/at_client` |
| 32 | + |
| 33 | +.. include:: /includes/build_and_run_nrf9160.txt |
| 34 | + |
| 35 | + |
| 36 | +Connecting to the nRF9160 DK board with LTE Link Monitor |
| 37 | +======================================================== |
| 38 | + |
| 39 | +To connect to the nRF9160 DK board with LTE Link Monitor, perform the following steps: |
| 40 | + |
| 41 | +#. Launch the LTE Link Monitor after programming the AT Client sample onto the nRF9160 DK board. |
| 42 | +#. Make sure that **Automatic requests** is enabled in LTE Link Monitor. |
| 43 | +#. Connect the nRF9160 DK board to the PC with a USB cable. |
| 44 | +#. Power on the nRF9160 DK board. |
| 45 | +#. Click **Select Device** and select the particular board device entry from the drop-down list in the LTE Link Monitor. |
| 46 | +#. Observe that initially the command :command:`AT+CFUN?` is automatically sent to the modem, which returns a value 4, indicating that the modem is in the offline mode. |
| 47 | +#. Observe that the LTE Link Monitor terminal display also shows :command:`AT+CFUN=1` indicating that the modem has changed to the normal mode. |
| 48 | +#. Press the reset button on the nRF9160 DK to reboot the board and start the AT Client sample. |
| 49 | + |
| 50 | + |
| 51 | +Testing |
| 52 | +======= |
| 53 | + |
| 54 | +After programming the sample to your board, test the sample by performing the following steps: |
| 55 | + |
| 56 | +1. `Connect to the nRF9160 DK board with LTE Link Monitor <Connecting to the nRF9160 DK board with LTE Link Monitor_>`_. |
| 57 | +#. Run the following commands from the LTE Link Monitor terminal: |
| 58 | + |
| 59 | + a. Enter the command: :command:`AT+CFUN?` |
| 60 | + |
| 61 | + This command reads the current functional mode of the modem and triggers the command :command:`AT+CFUN=1` which sets the functional mode of the modem to normal. |
| 62 | + |
| 63 | + #. Enter the command :command:`AT+CFUN?` into the LTE Link Monitor terminal again. |
| 64 | + |
| 65 | + The UART/Modem/UICC/LTE/PDN indicators in the LTE Link Monitor side panel turn green. |
| 66 | + This command also automatically launches a series of commands like: |
| 67 | + |
| 68 | + * :command:`AT+CGSN=1` which displays the product serial identification number (IMEI). |
| 69 | + * :command:`AT+CGMI` which displays the manufacturer name. |
| 70 | + * :command:`AT+CGMM` which displays the model identification name. |
| 71 | + * :command:`AT+CGMR` which displays the revision identification. |
| 72 | + * :command:`AT+CEMODE` which displays the current mode of operation. |
| 73 | + |
| 74 | + c. Enter the command: :command:`AT%XOPERID` |
| 75 | + |
| 76 | + This command returns the network operator ID. |
| 77 | + |
| 78 | + |
| 79 | + #. Enter the command: :command:`AT%XMONITOR` |
| 80 | + |
| 81 | + This command returns the modem parameters. |
| 82 | + |
| 83 | + |
| 84 | + #. Enter the command: :command:`AT%XTEMP?` |
| 85 | + |
| 86 | + This command displays the current modem temperature. |
| 87 | + |
| 88 | + |
| 89 | + #. Enter the command: :command:`AT%CMNG=1` |
| 90 | + |
| 91 | + This command displays a list of all certificates that are stored on your device. |
| 92 | + If the device has been added to nRF Cloud, a CA certificate, a client certificate, and a private key with security tag 16842753 (which is the security tag for nRF Cloud credentials) are displayed. |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +Sample output |
| 97 | +============= |
| 98 | + |
| 99 | +The following is a sample output of the command: :command:`AT%XMONITOR` |
| 100 | + |
| 101 | +.. code-block:: console |
| 102 | +
|
| 103 | + AT%XMONITOR |
| 104 | + %XMONITOR: 5,"","","24201","76C1",7,20,"0102DA03",105,6400,53,24,"","11100000","11100000" |
| 105 | + OK |
| 106 | +
|
| 107 | +
|
| 108 | +Dependencies |
| 109 | +************ |
| 110 | + |
| 111 | +This sample uses the following libraries: |
| 112 | + |
| 113 | +From |NCS| |
| 114 | + * ``lib/at_host`` which includes: |
| 115 | + * :ref:`at_cmd_readme` |
| 116 | + * :ref:`at_notif_readme` |
| 117 | + |
| 118 | +From nrfxlib |
| 119 | + * :ref:`nrfxlib:bsdlib` |
| 120 | + |
| 121 | +In addition, it uses the following samples: |
| 122 | + |
| 123 | +From |NCS| |
| 124 | + * :ref:`secure_partition_manager` |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | +References |
| 132 | +********** |
| 133 | + |
| 134 | +`AT Commands Reference Guide`_ |
0 commit comments