# What AT Commands Should I Use to Debug a Connectivity Issue?

This guide provides general and advanced AT commands that are helpful in most cases to understand the context of a connectivity issues using a Monogoto SIM within your device.&#x20;

AT commands are essential for troubleshooting and debugging IoT device and SIM issues by enabling quick diagnostics of device status, network connectivity, and SIM authentication.&#x20;

AT commands can check network registration, signal strength, data connectivity, and error logs, as well as manage device configurations and reboot devices remotely.&#x20;

AT commands are especially useful for remote troubleshooting, reducing the need for physical intervention in hard-to-reach locations, and providing a straightforward way to resolve issues related to network attachment, data connections, and device performance.&#x20;

{% hint style="info" %}
For specific AT commands for your device, please refer to your device manual while using advanced AT commands.&#x20;
{% endhint %}

Access your device and run the following AT commands to receive an output.

&#x20;

<table data-header-hidden data-full-width="true"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td>Command</td><td>Function</td><td>Sample response</td></tr><tr><td>AT+CRSM=176,28539,0,0,12</td><td><p>Read FPLMN List (Non-preferred networks)</p><p>Get forbidden or restricted network list. All F's indicate no networks forbidden.</p></td><td>+CRSM: 144,0,"FFFFFFFFFFFFFFFFFFFFFFFF"</td></tr><tr><td>AT+CRSM=214,28539,0,0,12,"FFFFFFFFFFFFFFFFFFFFFFFF"</td><td>Clean FPLM</td><td> </td></tr><tr><td>AT+CFUN?</td><td><p>Determine What Mode the Module Is In</p><p>Modules should be set to full functionality mode.</p></td><td>+CFUN: 1,0</td></tr><tr><td>AT+CSQ</td><td><p>Signal Quality</p><p>Returns multiple values to indicate signal strength, use device command manual to decipher RSSI (Received Signal Strength Indicator) and BER (Bit Error Rate).</p></td><td>+CSQ: 22,4</td></tr><tr><td>AT+CREG?</td><td><p>Network Registration Status</p><p>Check GSM and SMS network registration.</p></td><td>+CREG: 0,5 > This means the SIM is attached in roaming mode </td></tr><tr><td>AT+CGREG?</td><td><p>GPRS Network Registration Status</p><p>Check 3G network registration.</p></td><td>+CGREG: 0,5</td></tr><tr><td>AT+CEREG?</td><td><p>EPS Network Registration Status</p><p>Checks 4G LTE network registration.</p></td><td>+CEREG: 1,1,"1234","5678",0</td></tr><tr><td>AT+CGDCONT?</td><td><p>Read PDP Context Parameters (APN)</p><p>APN should be data.mono. AT+CGDCONT=1,"IP”,”data.mono” will set APN, but verify in your device's manual.</p></td><td>+CGDCONT: 1,"IP”,”data.mono”,”0.0.0.0”,0,0</td></tr><tr><td>AT+CGACT?</td><td><p>PDP Context Activation</p><p>Shows which PDP context is active and being used. The active context (1 in this example) should match the context of the PDP context where the APN is set to data.mono for connectivity.</p></td><td>+CGACT:1,1</td></tr><tr><td>AT+COPS?</td><td><p>Operator Selection Status and Current Operator</p><p>Displays the MCC and MNC of the connected network. The last number indicates the RAT: 0 for GSM, 2 or 3 for 2G/3G, 7 for LTE, 8 for Cat-M1, 9 for NB-IoT.</p></td><td>+COPS: 1,2,"310260",2</td></tr><tr><td>AT+COPS=?</td><td><p>Networks In Reach</p><p>Lists available network operators and their MCC/MNC along with their region. This command may take a few minutes to complete.</p></td><td>+COPS:(1,"AT&#x26;T","AT&#x26;T","310410",2)</td></tr></tbody></table>

Once you have run the associated AT commands, you can utilize your device’s AT command manual to debug further with advanced AT commands.&#x20;

&#x20;

<table data-header-hidden data-full-width="true"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td>Advanced Command</td><td>Function</td><td>Sample response</td></tr><tr><td>AT+QCFG=service domain 2,1</td><td><p>Service Domain</p><p>This enables packet-switched data services on the device, ensuring that the module can use the cellular network for data transmission with combined attach</p></td><td><p>+QCFG: “service_domain”,2,1 </p><p>OK</p></td></tr><tr><td>AT+QCFG=”nwscanseq”</td><td><p>NB-IoT Scan </p><p>Your device will no longer scan NB-IOT networks and this command should only be done when you do not want to use NB-IOT</p></td><td><p>+QCFG: “nwscanseq” ,0,1,2</p><p>OK</p></td></tr><tr><td>AT+CGDCONT=1, “IP” , “data.mono”,0,0</td><td><p>Sets APN to data.mono</p><p>Manually set your APN to data.mono using an AT command</p></td><td>+CGDCONT: OK</td></tr><tr><td>AT+CGACT=1,1</td><td><p>Activate your PDP context </p><p>This activates the APN that is set on line 1 (see above)</p></td><td>+CGACT: 1,1</td></tr><tr><td>AT+CGACT=1,0</td><td><p>Deactivate your PDP context </p><p>This deactivates the APN that is set on line 1 (see above)</p></td><td>+CGACT: 1,0</td></tr><tr><td>AT+CGATT=1</td><td><p>Attach to packet-switched network</p><p>This commands tells the device to attach to the packet-switched network, allowing it to start data transmission or reception</p></td><td>+CGATT: 1</td></tr></tbody></table>

As always, please consult your device manufacture AT command manual to verify commands.&#x20;

<br>
