Tutorial for SIMCOM M2M Modules


Simcom offers a range of M2M modules. All the modules offers a rich set of AT command interface for developing IP-based applications. This tutorial is intended for developers building M2M applciations with Simcom modules. With the online AT command tester tool, this tutorial explains how to to test different AT interfaces available on Simcom modules.

Contents

AT Command Tester

AT command tester is a free online software tool that is used to test AT commands and other module features such as data call, voice call, HTTP, FTP, TCP/IP, GPS, Email and other functionalities of M2M modules.

How to connect to module?

Please check that the drivers for the module are installed on your system. The module is then connected to the PC through a USB or serial connector interface. The module is typically on the hardware development kit (HDK) or on the host platform.

Port Configuration
AT Command Tester uses Java-based serial drivers to interface to the modem. Users can connect to the modem serial port. It is assumed that modem is connected to the PC and ATc commands can be sent to the modem serial port.

Command Mode

In the ‘Command Mode;’ users can send single AT commands and get the responses. The dropdown  lists 3GPP AT commands, description and examples for each AT command.

Script Mode

Users can send batch of AT commands under the ‘Script Mode’ tab. They can also save and load the script from the local machine. Users can develop their own scripts for specific set of tasks such as call setup , send SMS, HTTP access etc. Users can also include descriptive comments in their script.

Diagnostics

Users can perform basic troubleshooting of the modem diagnostics under the ‘Diagnostics’ tab. Here the AT Command Tester tool sends the required AT commands and provides descriptive output about the state of the modem.


//Get the manufacturer info
AT+CGMI< SIMCOM_Ltd

OK
Manufacturer : SIMCOM_Ltd

//Get the Model number
AT+CGMM

SIMCOM_SIM900

OK
Model Number : SIMCOM_SIM900

//Get the Simcom hardware revision
AT+CGMR

Revision:1137B03SIM900M64_ST_MMS

OK
Revision : Revision:1137B03SIM900M64_ST_MMS

//Get Simcom module capability
AT+GCAP

+GCAP:+FCLASS,+CGSM

OK
Device supports following features:Fax,GSM,

//Read the profiles stored in Simcom module
AT&V

ACTIVE PROFILE:
E1 Q0 V1 X4 &C1 &D1 +IFC= 0,0 +FCLASS0
S00:0 S03:13 S04:10 S05:8 S07:60 S08:2 S10:15
STORED PROFILE 0:
E1 Q0 V1 X4 &C1 &D1 +IFC= 0,0 +FCLASS0
S00:0 S03:13 S04:10 S05:8 S07:60 S08:2 S10:15
STORED PROFILE 1:
E1 Q0 V1 X4 &C1 &D1 +IFC= 0,0 +FCLASS0
S00:0 S03:13 S04:10 S05:8 S07:60 S08:2 S10:15
OK

//Get the battery status
AT+CBC
?
+CBC: 0,46,3740

OK

//Get the Simcom module port speed
AT+IPR?

+IPR: 115200

OK
Serial port speed is set to 115200.

//Get the device functionlity
AT+CFUN?

+CFUN: 1

OK
Device has Full functionality.

//Module activity status
AT+CPAS

+CPAS: 0

OK
Device is Ready.

//Serial port flow control on host device and modem side.
AT+IFC?

+IFC: 0,0

OK
No flow control on Terminal Equipment(TE) side ie Host Device.
No flow control on Terminal Adapter(TA) side ie Modem.

//Clock
AT+CCLK?
?
+CCLK: “00/01/01,00:21:58+00”

OK

//Simcom module serial number
AT+CGSN

012896001430633

OK

//Read Simcom phone book
AT+CPBR=1,99

+CME ERROR: 21
Unable to read phonebook entries.

//Character set used by the Simcom module
AT+CSCS?

+CSCS: “IRA”

OK
Character set used by Terminal Equipment is “IRA”

//Alarms
AT+CALA?

+CALA: “16:00:00”,2,1,2,3,4,5

OK

//Simcom module mute control
AT+CMUT?

+CMUT: 0

OK
Mute of Off

//Simcom module indicator type
The following indicators types are supported by the device,
AT+CIND=?

+CIND: (“battchg”,(0-5)),(“signal”,(0-4)),(“service”,(0-1)),(“message”,(0-1)),(“call”,(0-1)),(“roam”,(0-1)),(“smsfull”,(0-1))

OK

The indicator values are,
AT+CIND?

+CIND: 1,4,1,0,0,1,0

OK

//Simcom GPRS station class
AT+CGCLASS?

+CGCLASS: “B”

OK
The device supports station class “B”

//Check if Simcom module is connected to the network
AT+CGACT?

+CGACT: 1,0
+CGACT: 2,0
+CGACT: 3,0

OK
Device is NOT connected.

//Read the PDP context profile of Simcom module
AT+CGDCONT?

+CGDCONT: 1,”IP”,”bluevia.movistar.es”,”0.0.0.0″,0,0
+CGDCONT: 2,”IP”,”test5″,”0.0.0.0″,0,0
+CGDCONT: 3,”IP”,””,”0.0.0.0″,0,0

OK
Following connection profiles are available,

CID-> 1
PDP Type->IP
APN->bluevia.movistar.es
PDP Address->0.0.0.0
Data Compression->0
Header Compression->0

CID-> 2
PDP Type->IP
APN->test5
PDP Address->0.0.0.0
Data Compression->0
Header Compression->0

CID-> 3
PDP Type->IP
APN->
PDP Address->0.0.0.0
Data Compression->0
Header Compression->0

//Check if Simcom module is attached to the network
AT+CGATT?

+CGATT: 1

OK
Device is attached to the network

//Simcom module QoS (Quality of Service) profiles
AT+CGQREQ?

+CGQREQ: 1,0,0,0,0,0
+CGQREQ: 2,0,0,0,0,0
+CGQREQ: 3,0,0,3,0,0

OK
Following Quality of Service (QoS) profiles are available,

CID-> 1
Precedence->0
Delay->0
Reliability->0
Peak->0
Mean->0

CID-> 2
Precedence->0
Delay->0
Reliability->0
Peak->0
Mean->0

CID-> 3
Precedence->0
Delay->0
Reliability->3
Peak->0
Mean->0
To be implemented.. Stay Tuned!!!

//Bearer service configuration
AT+CBST?

+CBST: 7,0,1

OK
Speed -> 7
Bearer Service -> Data circuit asynchronous
Connection Element -> Non transparent

//RLP configuration
AT+CRLP?

+CRLP: 61,61,48,6,0,7

OK
Radio Link Protocol (RLP) Configuration paramaters:
IWF Window Dimension ->61
MS Window Dimension->61
Acknowledge Timer->48
Retransmission Attempts->6
Protocol Version->0

//Data or voice or fax mode
AT+FCLASS?

+FCLASS: 0

OK

//USSD configuration
AT+CUSD?

+CUSD: 0

OK

//Service reporting
AT+CR?

+CR: 0

OK
Service reporting control is disabled

//Error cause code
AT+CEER

+CEER: No Cause

OK

//Signal strength
AT+CSQ

+CSQ: 21,0

OK
Signal level is -71 dbm. Signal condition is excellent.The signal strength range is -53 dbm (Excellent) to -109 dbm (Marginal).

//Current operator
AT+COPS?

+COPS: 0,0,”AT&T”

OK
Device is currently on “AT&T” network.

//Registration status
AT+CREG?

+CREG: 0,5

OK
Device is registered and is roaming.

//List of avaialble operators
AT+COPS=?
Please wait as this could take sometime….

+COPS: (2,”AT&T”,”AT&T”,”310410″),,(0,1,4),(0,1,2)

OK
Available Networks:
Network Name->AT&T
Network ID->310410
Network Status->Current

Networks found

//Preferred operator list
AT+CPOL?

OK

//SMS message config – Text or PDU mode
AT+CMGF?

+CMGF: 1

OK
SMS message for is configured for Text mode

//SMS service center address
AT+CSCA?

+CSCA: “+34609092815”,145

OK
SMS service center address is “+34609092815”

//SMS support on the Simcom module
AT+CSMS?

+CSMS: 0,1,1,1

OK
Service-> GSM 27.005 Compatible
Mobile Terminated SMS -> Supported
Mobile Originated SMS -> Supported
Broadcast SMS messages -> Supported

//SIM status
AT+CPIN?

+CPIN: READY

OK
SIM is ready.

//Check if engineerign mode is on in Simcom module
AT+CENG?

+CENG: 0,0

OK
Engineering mode is OFF. To turn on Engg mode, set AT+CENG=1,1.

//Current band settign on Simcom module

AT+CBAND?

+CBAND: GSM850_MODE

OK

//Read the Simcom module ADC
AT+CADC?

+CADC: 1,3

OK
ADC read is successful. ADC value is 3

//Check if the device is ready for call
AT+CCALR?

+CCALR: 1

OK
Device is ready for phone call.

//Check if SIM is inserted in Simcom module
AT+CSMINS?

+CSMINS: 0,1

OK
SIM is inserted.

//Get the name of the service provider
AT+CSPN?

+CSPN: “”, 1

OK
Service provider is “”

//Get the voicemail number
AT+CCVM?

+CCVM: “7873327788”,”voicemail name”

OK
Voicemail number is “7873327788”

//Get the ICCID number
AT+CCID

893407227XXXXXXXXX

OK
ICCID of the SIM is 893407227XXXXXXXXX

//Check if temperature detection is enabled
AT+CMTE?

+CMTE: 0,22

OK
Temperature detection is disabled

//Get the GPRS multiclass slot
AT+CGMSCLASS?

MULTISLOT CLASS: 10

OK
Device configured for GPRS multislot class of 10

//Get the list of emergency numbers programmed in the Simcom module

AT+CEMNL?

+CEMNL: 1,2,”112″,”911″

OK
Emergency numbers are :”112″,”911″,Mic gain values for for channels:

//Mic configuration
AT+CMIC?

+CMIC: (0,5),(2,7)

OK

//Check if headset is attached
AT+CEXTHS?

+CEXTHS: 0,0

OK
Headset is not attached

//get the voice rate coding
AT+SVR?

+SVR: 16

OK
Voice rate coding set to 16

//Simcom module Audio channel configuration
AT+CHF?

+CHF: 0,0

OK
Main audio handset channel

//This is current configuration TCP context
AT+CIPSCONT?

+CIPSCONT:1
+CIPCSGP:1
Gprs Config APN:CMNET
Gprs Config UserId:
Gprs Config Password:
+CLPORT:0,0
+CIPHEAD:0
+CIPSHOWTP:0
+CIPSRIP:0
+CIPATS:0,0
+CIPSPRT:1,0
+CIPQSEND:0
+CIPMODE:0
+CIPCCFG:5,2,1024,1
+CIPMUX:0
+CIPDPDP:1,10,3
+CIPRXGET:0
+CIPQRCLOSE:0
TCP connection is closed by remote server

+CIPUDPMODE:0

OK
//Multi or single IP configuration
AT+CIPMUX?

+CIPMUX: 0

OK
Device configured for multi IP connection

//TCP and UDP are configured to use following ports
AT+CLPORT?

TCP: 0
UDP: 0

OK

//TCP connection profile
AT+CSTT?

+CSTT: “CMNET”,””,””

OK
APN->”CMNET”
USER->””
PASSWORD->””

//Local IP address
AT+CIFSR

+CME ERROR: 3
IP not avaialble. Check if the PDP context has been activated
The connection status is:

//IP status
AT+CIPSTATUS

OK

STATE: IP INITIAL

//Primary and secondary DNS configuration
AT+CDNSCFG?

PrimaryDns: 0.0.0.0
SecondaryDns: 0.0.0.0

OK
Primary DNS IP address is 0.0.0.0
Secondary DNS IP address is 0.0.0.0

//IP Header configuration
AT+CIPHEAD?

+CIPHEAD: 0

OK
IP header is added, format is “+IPD,data length”

//Is the modules configured for server mode?
AT+CIPSERVER?

+CIPSERVER: 0

OK
Device is not configured in server mode

//Connection profile – Circuit-switch or GPRS
AT+CIPCSGP?

+CIPCSGP: 1,”CMNET”,””,””

OK

//Transparent or non-transparent IP conenction mode
AT+CIPMODE?

+CIPMODE: 0

OK
TCP conenction is configured for transparent mode

//TCP transfer configuration settings
AT+CIPCCFG?

+CIPCCFG: 5,2,1024,1

OK
TCP transfer configuration:
Number of retries->5
WaitTime->2
SendSize->1024
Escape Sequence->1
HTTP configuration parameters:

//Simcom HTTP connection configuration
AT+HTTPPARA?

+HTTPPARA:
CID: 1
URL:
UA: SIMCOM_MODULE
PROIP: 0.0.0.0
PROPORT: 0
REDIR: 0
BREAK: 0
BREAKEND: 0
TIMEOUT: 120
CONTENT:

OK

//Current HTTP context:

AT+HTTPSCONT?

+HTTPSCONT:1
CID:1
URL:
UA: SIMCOM_MODULE
PROIP: 0.0.0.0
PROPORT: 0
REDIR: 0
BREAK: 0
BREAKEND: 0

OK

//FTP transfer mode
AT+FTPMODE?

+FTPMODE: 1

OK
FTP is configured for Passive mode.

//FTP port
AT+FTPPORT?

+FTPPORT: 21

OK
FTP port is 21

//FTP transfer type – binary or ascii
AT+FTPTYPE?

+FTPTYPE: “I”

OK
FTP transfer type is binary.

//FTP store option
AT+FTPPUTOPT?

+FTPPUTOPT: “STOR”

OK

//FTP server address
AT+FTPSERV?

+FTPSERV: “”

OK
FTP Server name is not set

//FTP user name
AT+FTPUN?

+FTPUN: “”

OK
FTP user name is not set

//FTP password
AT+FTPPW?

+FTPPW: “”

OK

//FTP GET file name
AT+FTPGETNAME?

+FTPGETNAME: “”

OK
FTP GET file name is not set

//FTP directory path
AT+FTPGETPATH?

+FTPGETPATH: “”

OK
FTP GET Path name is not set

//Current FTP application context:
AT+FTPSCONT?

+FTPSCONT:1
+FTPSERV: “”
+FTPPORT: 21
+FTPUN: “”
+FTPPW: “”
+FTPCID: 1
+FTPMODE: 1
+FTPTYPE: “I”
+FTPPUTOPT: “STOR”
+FTPREST: 0
+FTPGETNAME: “”
+FTPGETPATH: “”
+FTPPUTNAME: “”
+FTPPUTPATH: “”
+FTPTIMEOUT: 0
OK

//FTP State
AT+FTPSTATE

+FTPSTATE:0


OK
FTP in idle state.

Data Call

The ‘Data Call’ tab provides the interfaces to setup data call with the GSM network. ‘Get PDP Contexts’ button will list all the PDP context profiles stored on the SIM. Users can also add or update new PDP context profile. Users can then connect to the selected profile. AT Command Tester will first check whether the device is registered on the network. If so, it will attach and connect to the network with the selected PDP context credentials.

AT Command Sequence for setting up data call

//Checking registration status...
AT+CREG?

+CREG: 0,5

OK
Device is registered and is roaming.

//Checking if device is already connected…
AT+CGACT?

+CGACT: 1,0
+CGACT: 2,0
+CGACT: 3,0

OK
//Enable error reporting
AT+CMEE=1

OK

//Attaching to network…
AT+CGATT=1

OK

//Connecting to PDP profile 1..
AT+CGACT=1,1

OK
Connection is successful

//Get the IP address
AT+CGPADDR=1

+CGPADDR: 1,”10.102.157.245″


OK

Voice Call

AT Command Tester can also be used voice calls, both incoming and outgoing.


AT Command sequence for setting up voice call

//Checking registration status...
AT+CREG?

+CREG: 0,5

OK
Device is registered and is roaming.

//Dialing number 8586743398
ATD8586743398;


OK
Voice call successfull

SMS

AT Command Tester provides easy to use interface to send/receive SMS messages. SMS message format can be text mode or PDU mode.


AT Command sequence for SMS

//Checking registration status...
AT+CREG?

+CREG: 0,5

OK
Device is registered and is roaming.

//Send the SMS message
AT+CMGS=”7608841145″

> Test message from AT Command Tester

+CMGS: 19


OK
SMS Send successful

Phone Book

The phone book stored on the SIM can be edited/added/deleted through the ‘Phone  Book tab of the AT Command Tester.

Network Selection

Network selection feature allows the user to select the available network.

AT Command sequence for network selection

Finding Networks. Please wait..
//List the avaialble networks
AT+COPS=?

+COPS: (2,”AT&T”,”AT&T”,”310410″),,(0,1,4),(0,1,2)

OK
Available Networks:
Network Name->AT&T
Network ID->310410
Network Status->Current

Networks found

//Select the network
AT+COPS=4,2,”310410″

OK
Network selection sucessful.

Updating the list…

//List the networks
AT+COPS=?

+COPS: (2,”AT&T”,”AT&T”,”310410″),,(0,1,4),(0,1,2)

OK
Available Networks:
Network Name->AT&T
Network ID->310410
Network Status->Current


Networks found

 HTTP

The HTTP function is only implemented for the SIMCOM modules. Users can test HTTP Get and Post using the AT Command Tester.HTTP connection uses bearers that need to be setup. ‘APN’ is unique to each network. Usually you can do a Google search for a network’s APN. Once bearer is set-up, then a bearer connection needs to be set-up. After the bearer has a sucessful conenction, an HTTP connection can be established.

AT Command sequence for Simcom HTTP

//Check if the device is registered
AT+CREG?

+CREG: 0,5

OK
Device is registered and is roaming.

//Query if the bearer has been setup
Querying bearer 1 .

AT+SAPBR=2,1

+SAPBR: 1,1,”10.104.136.88″

OK
Bearer 1 is Connected.IP address is “10.104.136.88”

Bearer 1 is Connected.

//Initializing HTTP service…
AT+HTTPINIT

OK

//Setting up HTTP parameters..
AT+HTTPPARA=”URL”,”https://www.m2msupport.net/m2msupport/http_get_test.php”

OK

//Set the CID
AT+HTTPPARA=”CID”,1

OK

//HTTP action is read
AT+HTTPACTION=0

OK

HTTP GET is sucessful

//Read the HTTP response
AT+HTTPREAD

+HTTPREAD:58
Sucessful HTTP GET test. Data received from m2msupport.net
OK

//Terminating HTTP session..
AT+HTTPTERM


OK

FTP

This allows users to test FTP Get and Put functions using the SIMCOM modules. File Transfer Protocol (FTP) is commonly used to send/receive files from a remote server. First a bearer connection needs to be established just as we did in the HTTP example. After a bearer has a successful IP connection, we can use the FTP AT commands as shown below.


AT Command sequence for Simcom FTP function

//Checking registration status...
AT+CREG?

+CREG: 0,5

OK
Device is registered and is roaming.

//Querying bearer 1 .
AT+SAPBR=2,1

+SAPBR: 1,1,”10.104.136.88″

OK
Bearer 1 is Connected.IP address is “10.104.136.88”

Bearer 1 is Connected.

//Setting up FTP parameters..
AT+FTPCID=1

OK

//Set up FTP server
AT+FTPSERV=”ftp.m2msupport.net”

OK

//FTP user name
AT+FTPUN=”xxxxx”

OK

//FTP password
AT+FTPPW=”xxxxx”

OK

//FTP file name
AT+FTPGETNAME=”ftptest.txt”

OK

//FTP directory
AT+FTPGETPATH=”/www/m2msupport/”

OK

//Execute FTP get
AT+FTPGET=1

OK

+FTPGET:1,1
FTP session sucessfully started

//Read the FTP data
AT+FTPGET=2,1024

+FTPGET:2,43
Sucessful FTP file get from m2msupport.net.
OK
AT+FTPGET=2,1024

+FTPGET:2,0


OK
FTP data transfer is complete

TCP/UDP

SIMCOM modules have in-built TCP/UDP stack. AT command tester provides interfaces to test M2M TCP/UDP functions of SIMCOM modules.The ‘APN’ is usually specific to the network. You can get the APN information stored in the device in the ‘Data Call’ tab.Once a successful TCP connection is establised, you can send data

AT Command sequence for Simcom TCP function

//Checking registration status...
AT+CREG?

+CREG: 0,5

OK
Device is registered and is roaming.

//Checking if device is already connected…
AT+CGACT?

+CGACT: 1,0
+CGACT: 2,0
+CGACT: 3,0

OK
AT+CMEE=1

OK

//Attaching to network…
AT+CGATT=1

OK

//Setting up APN for TCP connection…
AT+CSTT=”bluevia.movistar.es”

OK

//Bring up GPRS Connection…

AT+CIICR

OK

//Get the local IP address
AT+CIFSR

10.0.131.15

//Start TCP connection
AT+CIPSTART=”TCP”,”74.124.194.252″,”80″

OK

CONNECT OK
TCP connection success

Sending TCP data

//Send data. Below data is HTTP formatted.
AT+CIPSEND

>
GET /m2msupport/http_get_test.php HTTP/1.1
Host:www.m2msupport.net
Connection:keep-alive


SEND OK

//Response from remote server.
HTTP/1.1 200 OK
Date: Mon, 20 Jan 2014 19:44:37 GMT
Server: Apache/2.2.26 (Unix) mod_ssl/2.2.26 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
X-Powered-By: PHP/5.2.17
Keep-Alive: timeout=3, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

3a
Sucessful HTTP GET test. Data received from m2msupport.net
0


CLOSED
TCP connection is closed by remote server

Keywords: Module , M2M , GPRS , 3G , through AT commands,