SIM908 – AT commands

If you have our development board with SIM908 or something else, you have to know AT commands for GSM/GPRS/GPS module.

Repetition again.

You have to connect UART from SIM908 module to your microcontroller (Tx module – Rx microcontroller, Rx – module – Tx microcontroller). You can use USB-UART convertor.

A lot of AT commands is same for SIM900 and another SIM types.

Communication: The module doesn’t send end character (e.g. ) and number of bytes. It’s a problem. I found three solutions.

The first of them: timeout. In endless loop, where the code waits on recieve char is condition. If is set flag of timer, the loop ends. This solution is very easy, but it has one disadvantage. If The modul send message after timeout, the message will not recieve – microcontroller will not wait for recieving message.

Next solution is waiting for rnOKrn – almost all messages end this AT command, but not all. Disadvantage is clear. Module can send other end string (typically rnERRORrn) or doesn’t send any.

The last of them is recieving characters in interrupt. It’s similar as the first solution. Advantage this solution is that the microcontroller can do other function.

If you want to communicate with module, you have to keep several conditions. 99% instructions has to be sent with = rn. In next part of article will be written as rn.

1.) Test of communication: This command try as first. You test a working module.

Send command: ATrn

Recieve message: ATrnrnOKrn

2.) PIN code: This command tests if the SIM card is without PIN code.

Send command: AT+CPIN?rn

Recieve message: AT+CPIN?rnrn+CPIN: READYrnrnOKrn

3.) Registration to the mobile network.

Send command: AT+CREG?rn

Recieve message: AT+CREG?rnrn+CREG: x,yrnrnOKrn

This value x means if the module is registrated in mobile network, home network or not.

Y value means technology (GSM, UTRAN, HSDPA and another).

Expected recieve message: AT+CREG?rnrn+CREG: 1,1rnrnOKrn

If message is AT+CREG?rnrn+CREG: 0,1rnrnOKrn, send AT+CREG=1rn command. This AT command enable access to mobile network (important during first setting)

4.) Signal measurement:

Send command: AT+CSQ?rn

Recieve message: AT+CSQrnrn+CSQ: xx,yrnrnOKrn

xx is signal and y is bit error during transmission.

E.g. value 2 means -109 dBm, value 10 is -93dBm is sufficient for communication with BTS, value 15 is -83 dBm is good and value 20 and higher (-73dBm) is signal excellent.

There are main AT command which used for test connection to the mobile network or communications or signal measurement.

After registration to the mobile network, you can send SMS.
Type of message:

AT+CMGF?rn

If the recieve message is AT+CMGF?rn+CMGF: 1rnrnOKrn, format of SMS is TEXT (it’s easy for next work). If the receive message is +CMGF: 0 format of message is PDU.

AT+CMGF=1rn

change format of SMS to TEXT type.

Sending SMS perform the following sequence of AT commands:

AT+CMGS=”PhoneNumber”rn

After recieve character > send

Messagern0x1Arn

0x1A is character for sending message. It is Ctrl+Z sequency.

The message can be it:

AT+CMGS=”+420XXXyyyyyy”

> Test SMS. https://chiptron.cz

Except this message: rn+CMGS: 10rnOKrn, where value 10 is number of sent SMS.

Reading unread message:

AT+CMGL=”REC UNREAD”rn

If you change REC UNREAD for ALL, it cause list of all SMS or REC READ list of read SMS.

Delete all messages:

AT+CMGDA=”DEL ALL”rn

Turn off module:

AT+CPOWD=1rn

Urgent turn off module:

AT+CPOWD=0rn

If you want to use GPS part of SIM908 module, you have to turn on GPS part:

AT+CGPSPWR=1rn

recieve message: AT+CGPSPWR=1rnrnOKrn
after, you have to do reset of module (cold start)

AT+CGPSRST=0rn

recieve message: AT+CGPSRST=0rnrnOKrn

Read data from GPS. You can perform with several NMEA message. Frequently is used GGA.

AT+CGPSINF=2rn

NMEA message GGA may like this:

$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47

Turn off GPS part:

AT+CGPSPWR=0rn

Přijat? zpr?va: AT+CGPSPWR=0rnrnOKrn

Sources:
Datasheet, Reference Manual another information about SIM908
http://m2msupport.net/m2msupport/software-and-at-commands-for-m2m-modules/
List of AT commands: http://m2msupport.net/m2msupport/atcreg-network-registration/

Share the article:
Show your
Maker soul!
Buy a T-Shirt
Coffee for Chiptron
Give a boost to the next article

Related Articles

I had to create development board with SIM908 – GPS&GSM&GPRS module for diploma thesis. The board is designed as top side. It’s easier than top and bottom sides. On the board are pin headers which are connected to the SIM908…

TOP 10 the most read articles and news – 2015. Viewcounts articles and news are composed with chiptron.cz/en. News: ODROID-XU4 Bus Analyzer (USB – CAN a USB – LIN) – STM32F103 Miniscope v2 – STM32F042, STM32F103, STM32F303, AT91SAM7S64 STM32F746 Discovery…

Nowadays we can develop a device which will measure all parameters of air – temperature, humidity and also we can buy CO2 sensor and measure the quality of air. The value of CO2 sensor is really important for us, because…

Maybe you read about a new board by STMicroelectronics and Arduino.org – Arduino STAR OTTO Arduino compatible board with STM32F469 microcontroller. In this article I describe you how to set your laptop, arduino IDE and how to upload your code…

BigClown offers a lot interesting modules which you can use, but I missed WiFi connectivity – you can order module for IoT network like LoRa and Sigfox. On the other side, this missing interface makes sense. WiFi connectivity is not…