The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

GSM::SMS::Transport::Serial - Send and receive SMS messages via a GSM modem

DESCRIPTION

This class implements a serial transport. It uses Device::SerialPort to communicate to the modem. At the moment the modem that I recommend is the WAVECOM modem. The serial transport has also been tested for the M20 modem module from SIEMENS.

This module is in fact the root of the complete GSM::SMS package, as the project started as a simple perl script that talked to a Nokia6110 connected via a software modem ( as that model did not implement standard AT ) on a WINNT machine, using Win32::SerialPort and Activestate perl.

I first used the Nokia6110, then moved to the Falcom A1 GSM modem, then moved to the SIEMENS M20 and then moved to the WAVECOM series. Both M20 and WAVECOM work best, but I could crash the firmware in the M20 by sending some fake PDU messages. Therefore I only use the wavecom now.

METHODS

new - Constructor
  my $s = GSM::SMS::Transport::Serial->new(
    -name => 'serial',
    -originator => 'GSM::SMS',
    -match => '.*',
    -pin_code => '0000',
    -csca => '+32475161616',
    -serial_port => '/dev/ttyS0',
    -baud_rate => '9600',
    -memorylimit => '10'
  }
DESTROY - Destructor

The DESTRUCTOR is necessary for compatibility with Win32. It seems that the serial port needs to be closed explicitly before being able to reuse it in the same process.

send - Send a PDU encoded message
receive - Receive a PDU encoded message
  Will return a PDU string in $pduref from the modem IF we have 
  a message pending return:
     0 if PDU received
    -1 if no message pending
init - Initialise this transport layer
  No init file -> default initfile for transport
 
close - Close the init file
ping - A ping command
  .. just return an informative string on success
get_info - Give some info about this transport

ISSUES

The Device::SerialPort (Win32::SerialPort) puts a big load on your system (active polling).

The initialisation does not always work well and sometimes you have to initialize your modem manually using minicom or something like that. Win32 users can use terminal to connect to the modem and run these tests.

        >minicom -s
        AT
        AT+CPIN?
        AT+CPIN="nnn"
        AT+CSCA?
        AT+CSCA="+32475161616"

+CPIN puts the pin-code in the modem; Be carefull, only 3 tries and then you have to provide the PUK code etc ...

+CSCA sets the service center address

AUTHOR

Johan Van den Brande <johan@vandenbrande.com>