AT Commands
Everything you need to know about AT Commands
AT Commands (abbreviated from Attention Commands) are the way to control cellular modems. It provides a standardized way to instruct modems on how to behave and where to connect to.
Even though the commands are standardized by the 3GPP, different modems adhere to different versions of the specifications and manufacturers may provide additional vendor-specific AT Commands. Hence we recommend to keep the AT Commands manual of your modem manufacturer close when configuring your cellular modem.
AT Commands Basics
AT Commands usually start with AT
, followed by a <command>
and in some cases a <value>
.
There are 4 types of AT Commands: Set, Read, Test and Execute.
Set
AT+<command>=<value>
Instruct the modem to perform an action, such as activating the modem or enabling roaming. For example, the command to set the modem to active is:AT+CFUN=1
Read
AT+<command>?
AT+COPS?
Test
AT+<command>=?
AT+CFUN=?
Execute
AT+<x>
Some commands can be simply executed. For example, the command to check and return the signal quality:AT+CSQ
Pro tip: It is possible to send multiple AT Commands to the modem at the same time. To do so, list the commands in one line separated by a semi column ;
, only write AT
at the start of the first command.
For examples: AT+CMEE=2;+CPIN?;+CIMI
Connect to the modem
In order to send AT Commands, you need to connect to the modem first. You may need a program which provides the interface between your computer and the modem. You can use minicom, screen or miniterm for Linux/MacOS or PuTTY for Windows. When using Windows, you might need to install a driver to establish a connection. Have a look at the modem manufacturer's website for details about a possible driver.
To test if the connection with the cellular modem has been established, enter AT
. When the modem responds with OK
you're set.
Before you get start started
Not all modems support the AT Commands listed in the examples in this page. For details, always check the AT Command manual of your specific cellular modem.
Before starting the configuration process, reset the modem to its default configuration and activate the modem:
Set the error reporting to verbose, resulting in more descriptive error messages:
Check the status of the SIM card. If you receive an error, the SIM may not be inserted well, or the SIM is locked with a PIN. By default, Monogoto SIMs are not PIN protected.
Query device information
Request the modem hardware version
Request the modem firmware version
Make sure you run the latest modem firmware version possible. Compare the response with the latest version published by your modem manufacturer.
Request the IMSI (International Mobile Subscriber Identity):
Request the ICCID (Integrated Circuit Card ID), which is the identification number of the SIM card:
Network provider and cellular technology settings
The AT Command related to the Network Provider and cellular technology: AT+COPS
Syntax: AT+COPS=<mode>,<format>,<oper>,<AcT>
Read the operator and access technology:
The test command lets the modem perform a network scan:
Be patient, it may take several minutes before the modem responds, you cannot send any AT Commands in the meantime.
Set the network and technology parameters
To find which of the networks Monogoto has roaming agreements with, review the Coverage lists.
Check the radio signal strength and signal quality:
+CSQ
returns 2 values separated by a comma. The first value represents the signal strength and provides a value between 0 and 31; higher numbers indicate better signal strength. The second value represents the signal quality indicated by a value between 0 and 7. If AT+CSQ
returns 99
, the signal is undetectable or unknown.
Network Configuration
Set the APN to data.mono
:
data.mono
:Read the APN configuration:
Set the PDP (packet data protocol) context to active:
Read if the PDP context is set correctly:
Read network status:
The second variable indicates the status:
0
: Not registered
1
: Registered, home network
2
: Not registered, but the modem is trying to connect
3
: Registration denied
4
: Unknown (for example, out of coverage)
5
: Registered, roaming
90
: Not registered due to UICC failure
Check the the FPLMN:
We are instructing the SIM to retrieve the data file 28539 in binary format. If we receive a string of 24 "F"s, it indicates that the FPLMN list is empty, which is the desired outcome. If the result contains anything other than 24 "F"s, it means that there is data written in the FPLMN
Clear the FPLMN:
Validate if your device received an IP address:
Do you see an IP address? Congratulations! 🎉 You’ve successfully connected your cellular modem to Monogoto. Have a look at the Things logs in the Monogoto Console to find more details about the established connection.
Last updated