Supported Hardware
Package Content
Server Install
Client Install
Gateway Install
Tech Info
PDU format
Bugs / Todo
Related Links

Jump to Vim Home Page

SMSLink GSM Module Driver Description

Since each GSM module had a slightly different behaviour (case-sensitive AT command parser) or feature set (support for text and/or PDU mode), I soon had to include some form of driver in the server module to handle all this diversity.

Through this page, you'll learn how to tweak existing device definitions to fine-tune support for already supported hardware, or to create new entries to extend that support to new brands or models.

Should you play with this and find a way to improve support for some model, or devise a new entry, please contribute your work back to the community. Mail me the changes to the driver, and I'll include them in upcoming releases of the program. Please remember that I don't have the means to test all available hardware under the sun. You can make a difference here: any input from you helps and is always welcome.

The driver file

Here is a copy of the driver file (/etc/gsmcaps) as provided with the SMSLink package.

# /etc/gsmcaps
# (c) Les Ateliers du Heron, 2000 for Scitex Europe, S.A.
# This file is part of the SMSLink project. It contains GSM modules
# capacity matrices (aka "driver flags").
# Should you need to create your own entries, please base them on the
# server/gsmdev.h file in the source tree, and should it work, please
# contribute your new entry back to me for inclusion in the next release.
# Entry format:
# MOD:value:datefmt:ok_string:line_sep:name
# where MOD is a unique model identifier (max 15 char), and value is built
# by adding the binary flags found in gsmdev.h. datefmt is a string describing
# the date format used in incoming text-mode SMS (3 char. max., a combination
# of the letters 'dmy' -- capital Y means 4-digit year). ok_string defines
# the "OK" string returned by the modem, with line delimiters. The last field
# (name) is there for the user's sake and will be ignored by the program.
# Use the MOD field in your /etc/gsmdevices.
A008:4142:ymd:\nOK\n:\n:Motorola A008
DI27:2986:ymd:\nOK\n:\n:Ericsson DI27 IR modem
EF151S:298:ymd:\nOK\n:\n:Ericsson F151s Business
EF251M:810:ymd:\nOK\n:\n:Ericsson F251m
EMU:303:ymd:\r\nOK\r\n:\r\n:Ostrich GSM/modem emulator
FA1:259:dmy:\r\nOK\r\n:\r\n:Falcom A1
FA2:259:ymd:\r\nOK\r\n:\r\n:Falcom A2
FA2D:287:ymd:\nOK\n:\n:Falcom A2D
FA2D3:303:ymd:\r\nOK\r\n:\r\n:Falcom A2D3
FATW:363:ymd:\nOK\n:\n:Falcom Twist
GENSM2:271:ymd:\r\nOK\r\n:\r\n:Wavecom GEN SM-2
GM12:1578:ymd:\r\nOK\r\n:\r\n:Ericsson GM12/GM22
NO30:291:ymd:\r\nOK\r\n:\r\n:Nokia 30
PCFF900:175:ymd:\nOK\n:\n:Option FirstFone GSM 900 PCcard
RMU:811:ymd:\r\nOK\r\n:\r\n:RMU Ultralite CX
SM20:299:ymd:\r\nOK\r\n:\r\n:Siemens M20
SS25:106:ymd:\nOK\n:\n:Siemens S25/S35
T65:3370:ymd:\nOK\n:\n:Ericsson T65
TC35T:363:ymd:\r\nOK\r\n:\r\n:Siemens TC35 Terminal
WMO1:259:dmy:\nOK\n:\n:Wavecom WMO1
WMO2:287:ymd:\nOK\n:\n:Wavecom WMO2
WMOD2A:287:ymd:\nOK\n:\n:Wavecom WMOD2 Single-band
WMOD2B:303:ymd:\nOK\n:\n:Wavecom WMOD2 Dual-band

Capabilities Matrix

The following grid shows which features and behaviour oddities were seen on which device model. A '?' next to the flag means that this has not been verified but is based on an "educated guess". Caveat Emptor.

The flags shown in this grid are defined in the ./server/gsmdev.h header file.

(table drawing by

1: Some AT commands accept both a text parameter or a numerical (binary) one to the same effect. An example would be the "AT+CMGL" command (list stored SMS messages), that expects a parameter telling it which kind of messages to list. If you want all of them, this could be "ALL" or 0 (both mean the same). Some devices expect a text parameter when they are in text mode (AT+CMGF=1) and a numerical one when they are in PDU mode (AT+CMGF=0). Most don't care.
2: Even though the GSM 03.40 specification is very clear about how a PDU string should be created, some devices will allow you to prepend an extra field to it (the Service Center Address, or SCA). If this is the case, when you don't want to use it, you have to prepend a "00" value indicating zero-length for that field. Standards, standards !
3: Some devices have a case-sensitive AT commands parser. Even though, from what I heard from a Gnokii developper, the original Hayes specs called only for capitalized AT commands, the WM02 is the first "real-world" example I see of a case-sensitive modem. Well, all commands were changed to uppercase.
4: Another funny behaviour. The SM20, when sent the AT+CMGS command (send message) expects its parameters to come in two parts (instead of all of them in the same shot). For instance, in text mode, you first send the AT command, the destination GSM number, and the carriage return char., then the modem replies with a ">" prompt. You can then type the message and close with the usual "^Z" char. A similar technique is used in PDU mode.
5: The "AT+CSDH=1" command normally resquests the module to provide full text headers when replying to "AT+CMGL" and "AT+CMGR" commands. Of course, since this is only meaningfull (and supported) in text mode, this parameter is "not applicable" for those models that only support PDU mode (EF151S or SS25, for instance). Still, some models that do support text mode (only the PCFF900 for now) don't accept the "AT+CSDH=1" command (only accept a value of "0") -- but they might give us the full message header info nevertheless.
6: The Ericsson GM-12 and GM-22 models have the strange peculiarity that you need to specifically ask the device to store incoming messages in a special location (which ?, the SIM card ?) in order for them to be available to the 'AT+CMGL="ALL"' command. This is done by using the 'AT+CPMS="ME","ME"' command. Thanks to Andrew Worsley for the fix.
7: The Motorola A008 / 6288 (a mobile / PDA combo) doesn't support the AT+CREG command.

Date format in incoming SMS

When sent the AT+CMGL="REC UNREAD" command, the GSM module (if it has received new messages since the last check) will answer something like the following (here, on a GenSM-2):

+CMGL: 1,"REC UNREAD","+32497123456",,"00/06/22,15:30:50+04",145,19
Test #2 from zenobe


Note: GSM number edited in above output to protect the innocent !

As you will notice in the output, the 5th field is a timestamp (its official name is <scts>, meaning "Service Center Timestamp"). If we want to successfully parse it and store it in our inbox file in a different format, we need to know the date format used.

Typically, this will be either dd/mm/yy or yy/mm/dd (but other combination might arise). Hence the third field in the driver file. This field is maximum 3 char. long, a combination of 'm', 'd', and 'y'. You can also capitalize the 'Y', denoting a year with century (4-digits year).

"Modem Okay" string and line separator character(s)

The new (as of version 0.54b) "fast modem response" mode improves the modem dialog response time by implementing an early exit from the serial port reading loop as soon as a "catch phrase" is detected in the input stream. For most modem commands, that catch phrase is none other than the ubiquitous "OK". Of course, since this technique represent some form of "inband signalling", we want to make sure that the catch phrase has as little chance as possible of occuring in the normal text messages sent by the modem. Hence the need to enclose the "OK" string between a pair of line delimiters.

Here is a summary of the date format, "modem okay" string and line separation character(s) used by each model:

Model Date format Modem_Okay Line Separator
A008 ymd \nOK\n \n
DI27 ymd \nOK\n \n
EF151S ymd ? \nOK\n (?) \n (?)
EF251M ymd \nOK\n \n
EMU ymd \r\nOK\r\n \r\n
FA1 dmy \r\nOK\r\n \r\n
FA2 ymd \r\nOK\r\n \r\n
FA2D ymd \nOK\n \n
FA2D3 ymd \r\nOK\r\n \r\n
FATW ymd \nOK\n \n
GENSM2 ymd \r\nOK\r\n \r\n
GM12 ymd \r\nOK\r\n \r\n
NO30 ymd \r\nOK\r\n \r\n
PCFF900 ymd \nOK\n (?) \n (?)
RMU ymd \r\nOK\r\n \r\n
SM20 ymd \r\nOK\r\n \r\n
SS25 ymd \nOK\n (?) \n (?)
T65 ymd \nOK\n \n
TC35T ymd \r\nOK\r\n \r\n
WMO1 dmy ? \nOK\n (?) \n (?)
WMO2 ymd \nOK\n (?) \n (?)
WMOD2A ymd \nOK\n (?) \n (?)
WMOD2B ymd \nOK\n \n

Brand and model name

This last field is provided for the administrator's convenience and will be ignored by the program.

Last Modified: September 29th, 2006.
philipa STRUDEL scarlet PUNKT be
SourceForge Logo