How To Test A GSM Modem Manually

30, Sep. 2024

 

How To Test A GSM Modem Manually

Knowledge Base  /  Frequently Asked Questions  /  Device ManageR (Legacy)

If you want to learn more, please visit our website chinaskyline.

How To Test A GSM Modem Manually

Before you begin testing your GSM modem:

' Connect the modem to Device ManageR's host system.

' Install the most recent version of the modem's drivers, which will ensure the host system is able to connect properly to the modem. The drivers should be available from the manufacturer.

' Determine the COM port that your modem is connected to. This FAQ shows you how: How To Check The COM Port Of Your Modem.

Manually send an SMS text message

Now that you have confirmed the COM port, you may attempt to manually send an SMS message using PuTTY or another serial connection tool. In our example, we're using PuTTY.

1. Open PuTTY.

2. Select Session in the navigation bar to the left.

3. In Connection type, select Serial.

4. In Serial line, enter the COM port your modem is connected to.

5. In Speed, enter the maximum port speed (baud rate) of your modem. In our example, the COM port is COM12, and the speed is .

6. Then select Open at the bottom of the screen to open the connection to the modem. The window shown below will appear; you may now type commands to the modem.

7. Now attempt to send a text message by entering the commands below in order, one line at a time.

In the commands below:

' Replace ~C with pressing the Enter key on your keyboard.

' Replace ^Z with pressing Ctrl+Z on your keyboard.

' Replace [SERVICE] with your GSM service center number.

' Replace [] with number you want to send a text to. (If you're outside the U.S., you may need to place a '+' sign before the number.)

' Replace [ALARM_TEXT] with a text message. In our example, our text message is 'hello from putty.'

Commands:

AT+CMGF=1~C

AT+CSCA='+[SERVICE]'~C

AT+CMGS='[]'~C

[ALARM_TEXT]^Z~C

If these commands are successful, your screen will appear as shown below, and you'll receive the text message on the target number.

Further troubleshooting

First, verify your modem supports SMS text mode.

SMS text mode is the only mode currently supported by Device ManageR. To verify that your modem supports it, enter the command below. If SMS text mode is available, you'll see a 1, as in the response '+CMGF: (0,1).'

AT+CMGF=?

Then verify your SIM card is unlocked.

Next, ensure you've inserted a SIM card into the modem that has been unlocked and is tied to an activated data plan with a service provider. Enter this command to verify that the SIM card is unlocked. It should respond with '+CPIN: READY.'

AT+CPIN?

Finally, verify the correct band setting is configured.

Once the SIM card is verified, ensure the proper band setting is being used to connect to the SMS service center. Enter the command below to verify what the modem is currently set to.

AT+WMBS=?

+WMBS: 4,0

The below commands will cause the modem to respond with the available band settings for this modem.

AT+WMBS?

Sierra Wireless GL band settings

These are the available band settings for a Sierra Wireless GL modem.

+WMBS: 0,x Mono band mode 850MHz is selected

+WMBS: 1,x Mono band mode extended 900MHz is selected

+WMBS: 2,x Mono band mode MHz is selected

+WMBS: 3,x Mono band mode MHz is selected

+WMBS: 4,x Dual band mode 850/MHz are selected

+WMBS: 5,x Dual band mode extended 900MHz/MHz are selected

+WMBS: 6,x Dual band mode extended 900MHz/MHz are selected

If you do not have a Sierra Wireless GL modem, please review the documentation provided with your modem to verify which setting indicates which band setting.

To change the current band setting, you may use these commands:

To set the modem to the dual band 850/MHz (North America & U.S.)

AT+WMBS=4

AT+CFUN=1

To set the modem to the dual band 900/MHz (UK and most countries outside of North America)

AT+WMBS=5

AT+CFUN=1

AT Commands Guide for GSM | emnify Developer Blog

Let's take a deep dive into the world of AT Commands: what are they and what are the most common AT commands for 2G, 3G and 4G cellular modules? We will try to answer these and many more questions in this complete guide about AT commands for cellular networks.

AT Command Guide - Table of Contents

 

What are AT commands?

The first step to diving into the Internet of Things is connecting your hardware to a modem. The connection between a modem and your hardware is achieved using AT commands. AT commands are a short text command language dating back to , originally developed for Hayes smart modems and later used in dial-up modems in the s.

What can AT commands be used for? 

AT commands enable you to control everything around the modem, device, and SIM:

  • Wake the device or put it in sleep mode

  • Configuration of power-saving modes 
  • Scan for and register to available networks and radio types

  • Get updates about network condition changes 

  • Read/send SMS and USSD

  • Send data (TCP/IP)

  • Get hardware and SIM information (IMEI, IMSI, etc.)

  • and much more 

 

To get started, we will talk about the syntax or the types of AT commands that can be sent to the modem.

What is the syntax of AT commands? 


AT Commands usually have a standardized syntax rule - most commands have three different types: write, read, and test. And then there are also others that can be executed just to retrieve information. All standard AT commands start with AT+<command>. The response to the commands do not contain AT and only use +<command>:

1. 

Write

: AT+<x>=<'>

Sets the user-definable parameter values of the modem
The expected response is usually only "OK"

Example: AT+CREG=1 ' meaning enable network registration report

2. 

Read:

AT+<x>?

Returns the settings of the modem

Example: AT+CREG?
Response: +CREG: 1,1 ' meaning currently reports are configured to be enabled and the device is registered on the home network

3. Test: AT+<x>=?

Checks supported configurations / services of the modem
Example: AT+CREG=?
Response: +CREG: (0-2) ' meaning that 0,1,2 can be set in the AT+CREG command

4. Execute: AT+<x>

Retrieve information or execute command

Example: AT+CCID
Response: +CCID:  - returning the SIM card identifier (ICCID)

Then there are also reports that can be generated on status changes for several commands often called unsolicited results code (reports). For example when the network registration changes. These reports have a similar format to the read command but sometimes differ on a couple of parameters.   

Do different modules and vendors have different AT commands?

Whereas AT commands are standardized in 3GPP TS 27.005 and 27.007 and all manufacturers need to implement them, there can be differences based on the modem type and vendor.
Based on the modem type - for e.g., some power saving commands are only available on newer versions that also have the functionality. Parameters may also differ because the modem does not support this specific radio type configuration or error code. 

Often manufacturers introduce additional proprietary AT commands that either have new functionality or enhance existing AT commands. While these commands can be powerful,  considerations for cross-vendor firmware need to be taken.  

How do I identify proprietary AT-commands for U-Blox, Quectel, Telit, Nordic, Gemalto etc.? 

Usually vendor proprietary commands are identifiable by a slightly changed command syntax in the beginning.

  1. Quectel - start with AT+Q - e.g. AT+QCFG

  2. U-Blox - start with AT+U - e.g. AT+UDCONF

  3. Telit - start with AT '@', '#', '$' or '*' - e.g. AT@CLCK

  4. Nordic - start with AT% - e.g

    . AT%XSNRSQ


  5. Gemalto/Cinterion - start with AT^  - e.g. AT^SMSO
  6. ZTE - start with AT+Z - e.g.

    AT+ZCELLINFO

 

How do I find the AT commands my modem supports?

Every modem should have a detailed description of its AT commands in an AT command guide. Nevertheless, you can also check the list of available AT commands with an AT command itself: AT+CLAC

My AT-command only responds with ERROR - how do I get more info?

In the standard configuration, the AT-Command response is short: OK and ERROR.

For getting a more detailed output of what caused the error you can use the command AT+CMEE=1 or AT+CMEE=2. 

The error will then either start with +CMS ERROR: xxx (indicating a network error) or +CME ERROR: xxx (indicating a device error)

AT+CMEE=1 - each error message includes an error code as described 3GPP TS 27.007 Ch. 9.2. For example, the module will return +CME ERROR: 11 - meaning the SIM PIN is required.

AT+CMEE=2 - if the modem supports it, then the error message includes a string expression of the error. For example  +CME ERROR: SIM PIN required

Basic commands to get information about the modem and SIM card 

The below commands do not have a read or test command and no parameters - they only execute commands that return information. 

Name

AT Command

Description

Get manufacturer

 AT+CGMI

Returns string representation of the manufacturer

Get model 

AT+CGMM

Contact us to discuss your requirements of modem gms. Our experienced sales team can help you identify the options that best suit your needs.

Returns the model of the modem. 

Get firmware

AT+CGMR

Returns firmware  revision

Get IMEI

AT+GSN

Retrieves the International Mobile Equipment Identity of the module 

Get IMSI

AT+CIMI

Returns the current used IMSI

GET ICCID

AT+CCID

Returns the ICCID of the SIM

GET MSISDN

AT+CNUM

 Returns the number / MSISDN of the device

Removing or adding SIM PIN via AT commands 

EMnify SIMs come with the SIM PIN deactivated so they work in devices that do not have a screen or interface to enter the PIN (e.g. GPS tracker). Below you have examples on how to activate and re-activate the use of the SIM PIN. 

The two commands used for managing SIM PIN are AT+CPIN and AT+CLCK.

To remove the check for the SIM PIN:

AT+CPIN?  // check which PIN required
+CPIN=SIM PIN   // response = SIM pin code required

AT+CPIN= // enter current PIN
OK

AT+CLCK='SC',0,'' // remove SIM PIN request at startup - reboot needed
OK   

To add the check for SIM PIN:

AT+CPIN?  // check if and which PIN required
+CPIN=Ready   // no PIN required

AT+CLCK='SC',1,''  // PIN activated

You find more information about the CPIN and CLCK command below. 

Command Commands and example Parameters AT+CPIN

AT+CPIN=<pin>

Enter the PIN so that the SIM can be used

Example:
AT+CPIN="'

<code>
READY ' No PIN required
SIM PIN ' PIN code required
SIM PUK ' PUK code required
SIM PIN2 ' PIN2 code required
SIM PUK2 ' PUK2 code required
PH-SIM PIN ' USIM depersonalization requiredv1.2.x
PH-NET PIN ' Network depersonalization requiredv1.2.x
PH-NETSUB PIN ' Network subset depersonalization requiredv1.2.x
PH-SP PIN ' Service provider depersonalization requiredv1.2.x
PH-CORP PIN ' Corporate depersonalization required

AT+CPIN?
Request which PIN code is required

Response Format:
+CPIN: <code>
Example:
AT+CPIN: READY 

AT+CLCK

AT+CLCK=<fac>,<mode>,<passed>, <class>

Lock or unlock different services on the module.

Example:
AT+CLCK ='AO',2

<fac> facility 
'SC' (U)SIM PIN request at startup 
'AO' Bar All Outgoing Calls
'OI' Bar Outgoing International Calls)
'OX' Bar Outgoing International Calls except to Home Country)
'AI' Bar All Incoming Calls
'IR' Bar Incoming Calls when Roaming 
'AB' All Barring services
'AG' All outgoing barring services
'AC' All incoming barring services
'FD' SIM card or active application in the UICC (GSM or USIM)
'PF' Lock to the very first inserted SIM/UICC card
'PN' Network Personalization
'PU' Network Subset Personalization
'PP' Service Provider Personalization
'PC' Corporate Personalization 

<mode> Defines the operation 
0 - unlock facility
1 - lock facility
2 - query status

<password> Password 

<class>
1 Voice
2 Data
4 FAX
7 All telephony except SMS (Default)
8 Short message service
16 Data circuit synchronization
32 Data circuit asynchronization 0 OFF 1 ON

AT commands for network selection and configuration

While operator selection is often an automated procedure - there are some configurations that you can do to either enforce or prefer specific operators.

 

Command

Commands and examples

Parameters

AT+COPS

Operator
scan and selection

 

 

AT+COPS=<mode>,<format>, <oper>,<AcT>

Forces to register the network
operator
Configuration Examples:
AT+COPS=1,2,""
AT+COPS=0 or AT+COPS=2
AT+COPS=1,2,"",8

<mode>:


0 - automatic (<oper> field is ignored)
1 - manual (<oper> field)
2 - deregister from network
3 - set only <format> for AT+COPS?
4 - manual/automatic (<oper> field shall be present); if manual selection fails, automatic mode (=0) is entered

<format>


0 - long alphanumeric ' e.g 'Telekom.de'
1 ' short alphanumeric e.g 'TDG'
2 ' numeric ' e.g. ''

<oper>

desired operator in <format>

<AcT>

Access technology
0 - GSM
1 - GSM Compact
2 - UTRAN
3 - GSM w/EGPRS
4 - UTRAN w/HSDPA
5 - UTRAN w/HSUPA
6 - UTRAN w/HSDPA and HSUPA
7 - E-UTRAN
8 ' LTE-M
9 - NB-IoT

If no operator is selected <format>,<oper> <Act> are omitted.

<stat>

Operator status
0 - unknown
1 - available
2 - current
3 - forbidden

AT+COPS?
Returns the current mode, the
selected operator, and Access Technology.

Response Format:
+COPS: <mode>,<format>,<oper>,<AcT>
Example Response:
+COPS: 0,0,' Telekom.de',0

AT+COPS=?

Returns / scans the list of available operators.

Response Format:
<stat>, long alphanumeric <oper>,
short alphanumeric <oper>, numeric <oper>, <AcT>

Example Response:
+COPS: (3,"Telekom.de","TDG","",2),
(1,"E-Plus","E-Plus","",2),(3,"Vodafone.de","Vodafone", "",2),(3,"Telekom.de","TDG","",7)

AT+CPLS



Preferred PLMN list
file to be used 

 

 

 

AT+CPLS=<list>
Selects which file shall be used for preferred PLMN list

Example:
AT+CPLS=0

On the SIM there are file to manage operator and radio type preference. These can be set by the user, operator or home network. These files usually start with EFxxxx

<list>: integer type
0: User controlled PLMN selector with Access Technology EFPLMNwAcT, if not found in the SIM/UICC then PLMN preferred list EFPLMNsel
1: Operator controlled PLMN selector with Access Technology EFOPLMNwAcT
2: HPLMN selector with Access Technology EFHPLMNwAcT



AT+CPLS?
Returns the selected PLMN selector list from the SIM/USIM.
Example Response 
+CPLS: 0

AT+CPLS=?
Returns list of supported <list>
Example response:
+CPLS: (0-2)

AT+CPOL

User Preferred PLMN list
configuration
(only when CPLS=0)

 

 

 

AT+CPOL=<index>,<format>,<oper>,<GSM_AcT>, <GSM_Compact_AcT>,<UTRAN_AcT>,<EUTRAN_AcT>

Set preferred operator list on the SIM 

Config example:
AT+CPOL=50,2,"",1,0,1,0

<index> order number of operator list.

The first index indicates the highest priority and the n

th

index indicates the lowest



<format>:
0 - long format alphanumeric <oper>
1 - short format alphanumeric <oper>
2 - numeric <oper>

<oper> Operator in defined Format <format>

For all parameters
<GSM_AcTn>,
<GSM_Compact_AcTn>,
<UTRAN_AcTn>,
<E-UTRAN_AcTn>:
0 - access technology not selected
1 - access technology selected




AT+CPOL?
Returns all entries from the SIM/USIM  EFPLMNwAcT or EFPLMNsel
Response format:
<index1>,<format>,<oper1>,<GSM_AcT1>,<GSM_Compact_AcT1>,<UTRAN_AcT1>,<E-UTRAN_AcT1>
Example Response:
+CPOL: 1,2,"",1,0,1,0 +CPOL: 2,2,"",1,0,1,0
'

AT+COPN


List all known operators

AT+COPN
Lists all the known operators that can be set by AT+CPOL

Example Reponse
+COPN: "","AeroMobile"
'
+COPN: "","vodafone IT"

 

AT+CREG
AT+CGREG
AT+CEGREG

Network registration report

AT+CREG applies to GSM/UMTS CS domain 

AT+CGREG
applies for GPRS/UMTS PS domain (GPRS)

AT+CEREG applies for LTE

Some LTE only modules may show registration status also for CREG and CGREG based on backwards compatibility

 

 

 

The syntax for CREG, CGREG, CEGREG is the similar- here explained with AT+CREG

AT+CREG =<n>
Set result code output. Triggers status change reports in different formats. 
For <n>=1: +CREG:<stat>
For <n>=2: +CREG: <stat><lac>,<ci>,<AcT>
For <n>=3: +CREG: <stat>,<lac>,<ci>,<AcT>,<cause_type>,<reject_cause>
For <n>=4 or 5 - additional parameters modem specific

Config Example:
AT+CREG=1

<n> Report configuration
0 ' Disable network registration unsolicited results code reports
1 ' Enable network registration unsolicited result code reports
2 ' Enable network registration and location information in reports <lac/tac/rac><ci><AcT>
3 - enable also <cause_type>,<reject_cause> in reports 
4 / 5 -  dependent on module there can be additional parameters  <rac>, <ActiveTime>,<P-RAU>,<GPRS-READY-timer> (only applies to AT+CGREG and CEREG)

<stat>:
0 - not registered, MT is not searching
1 - registered, home network
2 - not registered, MT is searching
3 - registration denied
4 - unknown (e.g. out of coverage)
5 - registered, roaming

<AcT>: Access Type
0 - GSM      1 - GSM Compact
2 - UTRAN  3 - GSM w/EGPRS
4 - HSDPA   5    UTRAN HSUPA
6 - UTRAN w/HSDPA and HSUPA
7 - E-UTRAN
8 ' LTE-M
9 - NB-IoT

<lac/tac/rac> Location Area / Tracking Area / Routing Area Code
<ci> Cell ID
<active time> Active Time value (T) for Power Save Mode
<P-RAU> period to send RAU/TAU

The syntax for CREG, CGREG, CEGREG is the similar- here explained with AT+CREG

AT+CREG?
Return Current Registration Status

Response Examples:
For <n>=1: CREG: <n><stat>
+CREG: 1,1
for <n>=2: +CREG: <n>,<stat><lac>,<ci>,<AcT>
+CREG: 2,5,"","01DB7C01", 2
For n=3: +CREG: <n>,<stat>,<lac>,<ci>,<AcT>,<cause_type>,<reject_cause>

AT+CREG =?
Returns values supported for <n> result code configuration

Example Response
+CREG: (0-3)

AT commands for radio signal quality analysis

Command

Commands and examples

Parameters

AT+CSQ

Signal Quality Reports

AT+CSQ
Reads the signal quality for the connected technology.

Response Format:
+CSQ: <rssi>,<qual>
Example Response:
+CSQ: 21,3

<rssi> received signal strength RSSI values
0: 113 dBm or less
1: 111 dBm
2...30: 109... 53 dBm
31: 51 dBm or greater
99 - not known or not detectable

<qual> For 2G ' Bit Error rate ( ~assumed value)
0: BER < 0,2 % ~0,14 %
1: 0,2 % < BER < 0,4 %  ~0,28 %
2: 0,4 % < BER < 0,8 %  ~0,57 %
3: 0,8 % < BER < 1,6 %  ~1,13 %
4: 1,6 % < BER < 3,2 % ~2,26 %
5: 3,2 % < BER < 6,4 % ~4,53 %
6: 6,4 % < BER < 12,8 % ~9,05 %
7: 12,8 % < BER ~18,10 %
99: not detectable

<qual> For 3G - EcNo
0: ECN0_LEV >= 44
1: 38 <= ECNO_LEV < 44
2: 32 <= ECNO_LEV < 38
3..5 14 <= ECNO_LEV < 32
6: 8 <= ECNO_LEV < 14
7: ECNO_LEV < 8

<qual> For LTE/NB-IoT/LTE-M - RSRQ
0: RSRQ_LEV < 5
1: 5 <= RSRQ_LEV < 10
2: 10 <= RSRQ_LEV < 14
3..5: 14 <= RSRQ_LEV < 26
6: 26 <= RSRQ_LEV < 30
7: RSRQ _LEV >= 30

<rxlev> RSSI with 1dbm steps
0: less than -110 dBm
1..62: from -110 to -49 dBm 
63: -48 dBm or greater

<ber> - Bit Error Rate as above for 2G

<rscp> RSCP with 1dBm steps
0: less than -120 dBm
1..95: from -120 dBm to -26 dBm 
96: -25 dBm or greater

AT+CSQ=?
Returns list of supported parameters <rssi>,<qual>

Example Response
+CSQ: (0-31,99),(0-7,99)

 AT+CESQ

Extended signal quality 

AT+CESQ
Return signal quality for all radio types the module can monitor. 

Response format: 
+CESQ: <rxlev>,<ber>,<rscp>,<ecn0>,<rsrq>,<rsrp>

Example Response:

+CESQ:99,99,255,255,31,62

AT+CESQ=?

Returns list of supported parameters value ranges <rxlev>,<ber>, <rscp>, ecno>, <rsrp>, <rsrq>

Example Response:
+CESQ: (0-63,99),(0-7,99),(0-96, 255),(0-49,255),(0-34,255),(0-97, 255)

AT commands to establish a PDP context / data session

Command

Commands and examples

Parameters

AT+ CGDCONT

Define PDP context

<AT+CGDCONT=<cid>,<PDP_type>,<APN>,<PDP_addr>,<data_comp>,<head_comp>

Set the parameters for the PDP context.

Example
AT+CGDCONT=1,"IP","em",
"0.0.0.0",0,0

<cid> PDP context identifier
<PDP_type> - Packet Data Protocol type as string
"IP", 'PPP' , 'IPV6', 'IPV4V6'

<APN> - Access Point Name string for EMnify "em"

 <PDP_addr> (IP) Address identifying the mobile terminal. EMnify assigns private static IPs - so 0.0.0.0 is fine

 <d_comp> - controls PDP data compression - for SNDCP

0 OFF
1 ON
2 V.42bis
3 V.44

<h_comp> - controls PDP header compression
0 - off
1 ' on
2 - RFC  for SNDCP only
3 - RFC
4 - RFC (applicable for PDCP only)

 

AT+CGDCONT?

Returns list of current PDP definitions

Response Format:
+CGDCONT: <cid>,<PDP_type>,<APN>,<PDP_addr>, <data_comp>,<head_comp>

 Example Response:
+CGDCONT: 1,"IP","em","0.0.0.0",0,0,0,0
2,"IPV4V6","em", "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0" ,0,0,0,0

AT+CGACT

Activate and Deactivate PDP contexts

AT+CGACT=<state>,<cid>
Activate or deactivate PDP context 

Example: 
AT+CGACT=1,1

<state>
0 - deactivate
1 - activate

<cid> PDP context ID

 

 

AT+CGACT?
Read status of PDP contexts
Response format
+CGACT<state>,<cid>
Example Response:
+CGACT=1,1

Final Thoughts

These were some of the standard AT commands that all modems support. They let you configure and have control over your cellular communication. Many manufacturer-specific AT commands exist which let you optimize the communication. We will talk about these in another blog post.

For more sim to voipinformation, please contact us. We will provide professional answers.