SM5100B GSM/GPRS modem – useful AT commands

Latest version of this document can be found under source control here on github.

1) Reboot modem


+SIND: 1

+SIND: 10,”SM”,1,”FD”,1,”LD”,1,”MC”,1,”RC”,1,”ME”,1

+SIND: 11

+SIND: 3

+SIND: 4


2) save settings (whatever can be saved) to non-volatile memory


3) display error text instead of error code


4) enable local echo


5) date time (which will be incorrect)

check date time:


+CCLK: “14/03/15,00:12:18”


set date time:
total 17 chars formatted as – “yy/mm/dd, hh:mm:ss”


minicom trace

6) check misc status flags


+CIND: 0,19,1,0,1,0,0,0


The format is:

+CIND: <battery>, <signal level>, <service>, <sounder>, <message>, <call>,
<roam>, <smsfull>

<Descr> description
– battery Voltage of battery
– signal Strength of signal (0-31)
– service Availability of network (0-1) (value=1 means registered to network)
– sounder Stillness (0-1) (1=mute)
– message Whether receive short messages (0-1)
– call Existence of a call (0-1)
– roam Net status (0-1) (1=roam status)
– smsfull Short message memory storage has become full(1), or memory locations are available(0)

7) display sms in plain text



8) read sms at specified index (0 is invalid)

+CMGR: “REC READ”,0,”+14088494245″,”13/07/26,23:34:24+00″
Hello cellular prowl

+CMGR: “REC UNREAD”,0,”+14088494245″,”13/07/26,23:36:40+00″
Meow meow purrrr


9) delete sms at specified index (1 in this case)



+CMS ERROR: Invalid memory index

The format is:


<index>: index num of chosen memory <mem1>,which should be less than the maximum num item of <mem1>

<DelFlag> description
– 0 Delete an message according to index
– 1 Delete all readed messages
– 2 Delete all readed or sent messages
– 3 Delete all readed or sent or unsent messages
– 4 Delete all messages

10) list all sms

+CMGL: 2,0,”REC READ”,”+14088494245″,”13/07/26,23:36:40+00″
Meow meow purrrr


11) make a call


12) hang up a call (ringing or received)


13) answer a call


14) send sms


> hello kitty▒
+CMGS: 1


NOTE: That funny character above is ctrl+z; sending ctrl+z is equivalent to sending a single byte with the hex value: 0x1a


RaspberryPi with SM5100b GSM GPRS cellular shield


I am going to try porting my PC python script for interfacing to the SM5100b directly to the RPi instead of converting it to an Arduino program.

UPDATE: Wow… it was easier than I thought it would be. I was able to quickly get to the same level of functionality as that previous post in less than an hour. Here is the push message posted to Prowl app using the cellular shield by a python script running on the Raspberry Pi.

Updates project files should show up on my github soon.


Giving Arduino a second UART over I2C by stacking another Arduino on top

Now that I have the Cellular modem working with the PC over serial I am trying to get the same thing implemented on an Arduino. Since the modem uses the serial interface I will not be able to use that to debug my program via a serial terminal running on my PC.

I tried using the SoftSerial (or the NewSoftSerial) library but ran into data corruptions even at the low speeds, so I decided to look for other ways to get another hardware UART on the Arduino. For a while I was contemplating getting a Mega Pro from Sparkfun but its price was a turnoff. In the end I realized that I could just stack another Arduino on my Diavolino (both interfaced to each other over I2C as master slave) and after trimming the UART rx/tx shield pins be able to separate out the two UARTs.

The other issue is that the UART pins of the Cellular modem are not 5V tolerant. This had not affected me till now since I was using the Adafruit FTDI friend at 3.3V logic levels when connecting to the PC serial port. So I could not get another 5V Diavolino. In the end I decied to get a 3.3V Arduino Pro and stack that on top of my 5V Diavolino.

Overall the connections will look something like the following diagram:

arduino extra serial port plan

Note that when I drew this I was planning on using another Diavolino at 3.3V but decided against it since it seemed like more work because I would need to get the 3.3V regulator on my own and also somehow get an 8MHz AVR chip for it. In hind sight this may not have been a good idea since the Arduino Pro seems to be connecting both the Vcc pins in the header to 3.3V. The Diavolino instead has them separated which seems more sensible to me.

Another thing I forgot to show in the diagram above are the pull up registers for the I2C lines (SDA & SCL) between the two Arduino boards. I am hoping that connecting those to 3.3v would work for the 5v arduino, but I am not sure.

State Machine based serial interface to SM5100b shield in Python

Ever since I got TCP data rx/tx working on the SparkFun SM5100b GSM/GPRS shield I have been prepping for the next step which is to get HTTP GET requests working. The problem I seem to be having here is that the HTTP server disconnects the TCP connection immediately after sending the response to the GET request, and I am not able to transfer the TCP data received using the AT command after the TCP connection has been disconnected.

Yesterday I finally got a state machine based serial interface written in Python working. The input to the Python script is a state machine description written in a YAML file.

Dummy Shimmy

Here is the script:

And here is a very simple YAML state machine file for the boot up sequence:

Coding up something equivalent for the Arduino will be a pain.

Finally, transfers over TCP are working with the SM5100B!!

Thanks to some help from a blog post about GPRS with the SM5100B Arduino GSM Shield by Hadley Rich I was finally able to get the TCP connection working. I will add more details on this when I get time.

Here is a screen shot of the shield transmitting the byte character “B” followed by CR and LF to a Perl TCP server running on my PC, and then receiving one copy of the message “[9212]AsYouWish” in return for each byte.

Sparkfun GSM/GPRS SM5100b shield on a Diavolino

I have decided to return the SM5100B evaluation board since I am instead using the SM5100B cellular shield. This is because I was not really going to use any of the interface pins of the SM5100B module broken out on the eval board. One useful thing about the shield (that I wasn’t expecting) is that it is able to reset the cellular module using the on board reset button similar to the eval board.


The Diavolino board here is running without any AVR 328 mega chip plugged into it, and has the 2.5mm x 5.5mm power barrel socket for the 5V 3A regulated power supply from EvilMadScience.

Diavolino hosting a GSM/GPRS shield

Meanwhile although I can receive TCP data on the SM5100B modem over GPRS I still haven’t been able to successfully confirm transmission of data.