Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AT SMS Command Set

AT commands

https://swappa.com/esn/

Shutdown:

  AT+CFUN=0
  > OK

Scratchpad

Wiping the phone number from your CDMA device (Carrier Reset)

MMS

AT+CGDCONT=1,"IP","wap.cingular" ATD99**1#

at+CSCA? +CSCA: "+13123149810",145 at+cgpaddr AT!GSTATUS? AT^SYSINFO at+creg 0,1,6405,06F44F45 at+cnum "@@@@@@@@@@@@@@@@@@","+14794621244",145 at+copn at+CUSD at^SYSINFO ^SYSINFO: 2,3,0,5,1 at+cpin=?

at+cops=? +COPS: (2,"AT&T@","AT&T@","310410",2),,(0,1,2,3,4),(0,1,2) at+cops? +COPS: 0,0,"AT&T@",2

MCC: 310
MNC: 410

393

GSM

Diagnostics:

AT+CMEE=1 # Extended numeric codes
AT+CMEE=2 # Extended syntax codes
ATV1 # Verbose is on
ATV0 # Verbose is off

GSM Error Code List

SMS

at+cmgf=1

Transmit:

at+cmgs="+14795555255"
> message
<CTRL+Z>

Receive:

at+cmgl="ALL"

SMS Service center:

AT+CSCA?
> +13123149810

AT+CSCA="+13123149810"

T-Mobile SMSSC:

AT+CSCA="+12063130004"

SMS Call Forwarding

Check status of Voice, Data, Fax, SMS, etc. forwarding with:

*#21#

Enable SMS Call Forwarding:

*21*<number>*16#

Source: http://arstechnica.com/civis/viewtopic.php?t=214399

Other

Get ciphering settings

AT!GCIPHER?

output:

!GCIPHER:

Ciphering: 01

Integrity: 01

0 = ciphering disabled, integrity disabled

1 = ciphering enabled, integrity disabled

2 = ciphering enabled, integrity enabled

3 = ciphering disabled, integrity enabled

Authenticate the SIM by using a random number; uses a 32 hexadecimal digit random number as its salt

AT!AUTH=123A567B9012C4567D90123E56789012

output:

SIM response, Ciphering key

AT!AUTH: C1E1B5F4,647C1B4E68951D2B

AT operating mode state

AT&V

output:

&C: 1; &D: 2; &E: 1; &F: 0; &S: 0; &W: 0; E: 1; L: 1; M: 0; Q: 0; V: 1;

X: 0; Z: 0; \Q: 3; \S: 0; \V: 0; S0: 0; S3: 13; S4: 10; S5: 8; S6: 2;

S7: 45; S8: 2; S9: 6; S10: 14; S11: 95; S30: 0; S103: 1; S104: 1;

+FCLASS: 0; +ICF: 3,3; +IFC: 2,2; +IPR: 115200; +DR: 0; +DS: 0,0,2048,6;

+WS46: 12; +CBST: 0,0,1;

+CRLP: (61,61,48,6,0),(61,61,48,6,1),(240,240,52,6,2);

+CV120: 1,1,1,0,0,0; +CHSN: 0,0,0,0; +CSSN: 0,0; +CREG: 0; +CGREG: 0;

+CFUN:; +CSCS: "IRA"; +CSTA: 129; +CR: 0; +CRC: 0; +CMEE: 2; +CGDCONT: (1,"IP","Bro

adband","",0,0),(2,"IP","isp.cingular","",0,0),(16,"IP","isp.cingular","",0,0)

; +CGDSCONT: ; +CGTFT: ; +CGEQREQ: ; +CGEQMIN: ; +CGQREQ: ; +CGQMIN: ;

+CGEREP: 0,0; +CGDATA: "PPP"; +CGCLASS: "A"; +CGSMS: 1; +CSMS: 0;

+CMGF: 0; +CSCA: "+13123149810",145; +CSMP: ,,0,0; +CSDH: 0;

+CSCB: 0,"",""; +FDD: 0; +FAR: 0; +FCL: 0; +FIT: 0,0; +ES: ,,;

+ESA: 0,,,,0,0,255,; +CMOD: 0; +CVHU: 0; +CPIN: ��������,��������;

+CMEC: 0,0,0; +CGATT: 1; +CGACT: 0; +CPBS: "SM"; +CPMS: "SM","SM","SM";

+CNMI: 0,0,0,0,0; +CMMS: 0; +FTS: 0; +FRS: 0; +FTH: 3; +FRH: 3; +FTM: 96;

+FRM: 96; +CCUG: 0,0,0; +COPS: 0,0,""; +CUSD: 0; +CAOC: 1; +CCWA: 0;

+CCLK: ""; +CPOL: 0,2,"",0,0,0; +CPLS: 0; +CTZR: 0; +CTZU: 0; +CLIP: 0;

+COLP: 0; +CDIP: 0; +CLIR: 0; +CMUX: 0,0,5,31,10,3,30,10,2;

!CMUX: 0,0,5,31,10,3,30,10,2

AT!GSTATUS?

output:

!GSTATUS:

Current Time: 2110 Temperature: 32

Bootup Time: 1 Mode: LOW POWER MODE

System mode: GSM PS state: Not attached

WCDMA band: WCDMA800 GSM band: GSM900

WCDMA channel: 4384 GSM channel: 1

GMM (PS) state:NULL ---

MM (CS) state: NULL ---

WCDMA L1 State:L1M_DEEP_SLEEP RRC State: DISCONNECTED

RX level (dBm):-55 (Not updated)

AT^SYSINFO

outputs:

^SYSINFO: 2,3,0,5,1

– Service availability

• 0 = No service

• 1 = Limited service

• 2 = Service

• 3 = Limited regional service

• 4 = Power save mode or deep sleep mode

– Service domain

• 0 = No service

• 1 = Circuit-switched service only

• 2 = Packet-switched service only

• 3 = Circuit- and packet-switched service

– Roaming status indicator

• 0 = Not roaming

• 1 = Roaming

– System mode

• 0 = No service

• 3=GSM/GPRSmode

• 5 = WCDMA mode

– SIM status

• 0 = SIM is not available

• 1 = SIM is available

• 255 = No SIM, or the SIM has been PIN-locked (invalid PIN was

entered and must be reset)

# Get SIM card ICCID
AT!ICCID?

# output:
# !ICCID: 89014104278679147118

IMEI / MEID:

```shell
AT+CGSN
# output: 356685010564597

MEID is 56 bits long (14 hex digits). It consists of three fields, including an 8-bit regional code (RR), a 24-bit manufacturer code and a 24-bit manufacturer-assigned serial number. The check digit (CD) is not considered part of the MEID.

The MEID was created to replace ESNs, whose original form was exhausted in November 2008.

See also,

  1. http://www.cdg.org/devices/meid/meid_euimid_calculator.asp
  2. ~/Projects/scratch/gsm/meid-to-pesn.py

IMSI:

AT+CIMI
# output: 310410867914711

References

file:///Users/jeff/local/src/smstools3/doc/at-commands.html http://www.forensicswiki.org/wiki/AT_Commands http://www.developershome.com/sms/atCommandsIntro.asp https://en.wikipedia.org/wiki/Unstructured_Supplementary_Service_Data http://www.3g-modem-wiki.com/page/common+AT-commands http://m2m.com/thread/1020 http://www.tutorialspoint.com/gsm/gsm_addressing.htm https://en.wikipedia.org/wiki/International_mobile_subscriber_identity https://en.wikipedia.org/wiki/MSISDN https://en.m.wikibooks.org/wiki/AT%26T_Mobility_FAQ#What_is_locking.3F

Data Call

Initialize:

AT+CPIN?
+CPIN: Ready

The SIM is unlocked and ready to use.

AT+CREG?
+CREG: 0,1,6405,06F44F45

Registered in the home network.

Get network info:

AT+COPS?
  +COPS: 0,0,"AT&T@",2

Check signal quality:

AT+CSQ
  +CSQ: 25,99

GPRS Attach:

AT+CGATT=1
  OK

Even if the GPRS Attach is successful, it doesn’t mean that the data call has been established.In GPRS, a Packet Data Protocol (PDP) defines the data session. The PDP context establishes the data path between the device and the GGSN (Gateway GPRS Support Node). GGSN acts like a gateway between the device and rest of the world. So the should establish a PDP context before it can send/receive data on the internet.

The GGSN is identified through Access Point Name (APN). Each carrier will have their own APNs and are usually available on the internet. The device can define multiple PDP contexts that are uniquely stored in context ids.

AT+CGDCONT?
+CGDCONT: 1,"IP","wap.cingular","",0,0
+CGDCONT: 2,"IP","wap.cingular","",0,0
+CGDCONT: 16,"IP","isp.cingular","",0,0
AT+CGDCONT=1,”IP”,"wap.cingular"
  OK

Activate the PDP context:

AT+CGACT=1,1

Once the PDP Context is activated successfully, the device can send/receive data on the internet. To check if there were any issues with the PDP activation, send the AT+CEER command. Check the error code and take next steps.

Deactivate the PDP context:

AT+CGACT=0,1

To detach from the GPRS network:

AT+CGATT=0

Detaching from the GPRS network will conserve network resources.

References

http://m2msupport.net/m2msupport/data-call-at-commands-to-set-up-gprsedgeumtslte-data-call/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.