23 December

Try gregs-gsm-test.py for testing cell phone modules

You can readily purchase stand-alone GSM/GPRS modules that provide cellular network access for computer applications without the involvement of any traditional cell phone. This post briefly discussed these modules and puts forward by little tool for debugging or evaluating them.

I was looking at using such a module to let one of our robot vehicles literally phone home if it becomes lost. Several such modules are available, either as stand-alone cellular modems, or with additional computing integrated in the unit. One of the most full features is the Telit GM682-GPS that combines a cellular modem with GPRS (Internet access including a TCP stack), a GPS receiver, a microprocessor, and an embedded Python interpreter (this device also has many variants like the GM682-QUAD). Unfortunately, the GM682-GPS seems to have become hard to find.

Command protocol

These modules seem to almost universally use a protocol derived from the very simple one developed by the Hayes Microcomputer Products company for analog telephone modems, back in the 1980's. This "Hayes protocol" uses a set of short commands that each start with AT to control the modem. In fact, even in iPhone uses a variant this protocol to talk to its internal modem.

GSM modules for sending SMS or making cell phone calls. Telit 682, ADH9066 and SM5100B modules shown

GSM modules for sending SMS or making cell phone calls. Telit 682, ADH9066 and SM5100B modules shown (click to enlarge)

Unfortunately, although the generic command set for various modem devices follows a common template, each manufacturer is free to add extra commands or implement only a subset of the common core. As a result, each GSP modem I looked at really needed a distinct set of commands to work best.

Another annoying issue is that many of these models are GSM/GPRS only. Phone services and modems about that claim to be GPRS/3G/UMTS/HSDPA, as well as 3G, 4G, LTE and more alphabet soup, but these terms are often used imprecisely and inaccurately and, in fact, it's very hard to be sure if a company that supports HSDPA actually supports the simpler older 2G GSM protocol as well (e.g. Canada's Telus supports HSDPA but not GSM).

Alternatives and issues

The three I think are the best contenders for use in our systems as the Telit GM682-QUAD, the AHD ADH8066 and the LinkSprite SM5100B. These all do GSM 850/EGSM 900/DCS 1800/PCS 1900 and can send SMS messages, do GSM/GPRS, TCP/IP and voice.

For use in embedded systems, it should be noted that the power use by these modules can shoot up to a heft 2 Watts when data is being transmitted. The SM5100B, for example, can run just off powered only off a USB cable until to attach a good quality multi-band antenna, and the it will probably just shut down as it attempt to actually register on the network.

Importantly, the baud rate might need to be specified correctly; common values are 9600 and 115200. Also, the radio band to be used is critical and on at least one unit can only be set using a command that is not properly documented! Testing and adjusting these features was a bit tedious.

My program for evaluating a module: gregs-gsm-test.py

In attempting to evaluate these units, I also found many users on the net have trouble configuring them initially. The first time I touched one, it took a while before I figured out which sequences of commands was useful, and how to evaluate the unit. As a result, I created a small Python program (gregs-gsm-test.py) that uses the somewhat standard command vocabulary to determine the baud rate for a module, check out that it is working, and examine a few features.

In it's current state this program is overkill for just testing my modules, but it also
should be useful to others. New versions can be found here named
gregs-gsm-test.py and (maybe) updated occasionally.

The version number of the most recently released version can be found via this link.

Typical program output

python gregs-gsm-test.py -
2.2 Copyright Gregory Dudek (c) 2012.
gregs-gsm-test.py using /dev/tty.usbserial-A10137IB

Seek device ID (being thorough, so it will take a few seconds)
Spreadtrum Communication CO.,Ltd SM5100B-D

SIM card status READY

Signal strength (RSSI): 14
Setting message format for text style.

Network registration status
['+CREG:', '0,1']
Registration status: registered, home network

Currently selected operator:
REPLY: ['+COPS: 0,2,302720', '', 'OK']

Phone number stored on SIM:

IMEI number:
REPLY: ['35...deleted...5', '', 'OK']

International Mobile Subscriber Identity (IMSI) of SIM card:
REPLY: ['+CIMI: "30...deleted...9"', '', 'OK']
302 720
Canada Rogers
Mobile Subscription Identification Number: 50...deleted

SIM number:
REPLY: ['+CCID: "89...deleted ...49"', '', 'OK']

By Gregory Dudek at | Read (2) or Leave a comment |    
Re: Cell phone interfaces, GSM and GPRS modules, for stand-alone projects

Hi there

I'm wondering about your experience with the SM5100B-D and network compatibility.

Amidst all the "alphabet soup" I'm unclear whether Rogers GSM/HSPA/EDGE/... network is compatible with th SM5100B-D... do you know?

I *think* it should work, but it's possible that I need to explicitly get rogers to enable 2G on the account for the SIM I'm trying (it's a newer LTE sim)... that said, I'm *really* not sure and am even less sure that I'll find anyone at Rogers suppport that can answer the question.

Any ideas?


PS. the reason I ask is that I've been experimenting with an Arduino and seem to be able to do voice and SMS, but GPRS is eluding me.

My experience was that nobody in customer service at any carrier can provide a reliable answer to this kind of question (i.e. what kind of 2G service is actually provided, and what kinds of devices can and cannot be used). I was able to get usable service from Rogers, I think, but not from Telus. On the other hand, Rogers has a slew of annoying non-customer-oriented features that make them repugnant (like an afwul email-to-SMS gateway).

The lack of support of these devices on some carriers may be due to the fact that these devices use a particular (older) variant of 2G protocols that are not universally supported. Unfortunately, even the names of the protocols have been used in such a sloppy way, and so mixed with advertising hype, than nothing is clear (where the term "4G" is the most widely abused and now-meaningless of all).

I would welcome any finding you might have.
-- Greg ]

Posted by: sbfaulkner at May 12,2013 11:24
Re: Cell phone interfaces, GSM and GPRS modules, for stand-alone projects

Hi Gregory,
Very usefull tutorial. We forward your post to learn.linksprite.com. If you have any other new post about pcDuino(www.pcduino.com) or any other LinkSprite's(www.linksprite.com) products, please feel free to let us know. If you have a new post, could you please give us a backlink?

Posted by: anonymous at February 09,2014 04:33
Please send trackback to:/blog/257/tbping
There are no trackbacks.
Post your own response

Each comment is manually screened for the presence of appropriate and substantive content, due to a constant onslaught of comment-spam. This means there may be a delay before your comment appears.

(Some kind of name is required, will be visible)

Required, whatever you enter will be visible to other users.

(Optional, used for "mailto" link)

Your email address is not required, but if you insert it it will be displayed so people can contact you.

Answer this question correctly to demonstrate that you are not a dumb spambot.

The title for your comment.

Your comment goes here. All relevant comments are welcome, except for those that simply promote an irrelevant product or else are used to fraudulently inflate the link count to an irrelevant web page. They appear after moderation. Don't forget to also fill in the captcha below or your text will be rejected automatically!

You must answer this question to prove you are human
The governator said (when in a movie as T2): 'I'll be ... (pick a number): 1:tuckered, 2:broke, 3:back, 4:broken, 5:swartzneggered, 6:eaten, 7:you?

Answer this question correctly to demonstrate that you are not a dumb spambot.