Here is a rough guide to getting your serial modem to work with a Raspberry PI.

Installation: RaspberryPI+
Operating system: Wheezy
Serial to USB device: Keyspan
Modem: Wavecom 203A

I want to be able to remotely reboot my ADSL modem and router while I am away from the house. At times the modem will attempt sync and if it takes too long it will stop trying. The router is DDWRT and I expect it to be solid however after an extended outage it fails to log in.

Solution: Control 2 relays from the GPIO ports that can power the modem and router. Th relays are N/C (not energised) and I turn them on for 5 seconds to drop the power and allow them to restart.

Operating system: Raspbian Wheezy and install smstools (apt-get install smstools)
USB driver: http://www.chrisdanielson.com/2012/04/10/linux-firmware-keyspan-usb-to-serial/ Follow the instructions, it works perfectly !

The device should be /dev/ttyUSB0

You can test the connectivity to the modem with "minicom"...the baudrate may be 9600, 19200 or higher, trial and error.
quick test " +++ ath0" and you should get OK back.

GPIO software: http://wiringpi.com/download-and-install/ Follow the instructions, it works.....

GPIO Pin Mapping: http://wiringpi.com/pins/ I am usuing GPIO1 (Pin12) and GPIO4(Pin16)

Eventhandler: I pass my script the filename of the incoming message

--------------------------------------------------------------------------------
#!/bin/sh
# This is an example how to use an eventhandler with smsd.
echo smsd reports an event:
echo type: $1
echo file: $2
echo id: $3

if [ $1 = RECEIVED ]; then
/var/spool/sms/incoming/test.sh $2
fi;
---------------------------------------------------------------------------------
You will need to make 1 change to smsd.conf as it wont start if using a script that relys on variables:

executable_check = no

----------------------------------------------------------------------------------

Here is my eventhandler script, very simple but it should give you an idea how ti works

------------------------------------------------------------------------------------
#|/bin/sh

# Define allowed numbers
pete_number=61409839xxx
carol_number=61403193xxx

#How long is the message received
message_length=`cat $1 | grep Length: | cut -d ":" -f2 | sed 's/^ *//g'`

# Who sent us the text, this is used to validate the allowed callers
from_number=`cat $1 | grep From: | cut -d ":" -f2 | sed 's/^ *//g'`

# Lets get the message
string=`cat $1 | tail -c $message_length`

# If the from_number doesnt match the 2 defined numbers, delete the GSM call file and exit
if [ "$pete_number" != $from_number ] && [ "$carol_number" != $from_number ];then
/bin/rm $1
exit 0
fi

# If the word "Modem" is received, turn on GPIO1 for 5 seconds and then turn off
if [ "$string" = "Modem" ]; then
/usr/local/bin/gpio mode 1 out
/usr/local/bin/gpio write 1 1
sleep 5
/usr/local/bin/gpio write 1 0

# Use the default SMSTOOLS "sendsms" script to send a reply
/var/spool/sms/incoming/sendsms $from_number "the modem has rebooted"
fi

# If the word "Router" is received, turn on GPIO4 for 5 seconds and then turn off

if [ "$string" = "Router" ]; then
/usr/local/bin/gpio mode 4 out
/usr/local/bin/gpio write 4 1
sleep 5
/usr/local/bin/gpio write 4 0

# Use the default SMSTOOLS "sendsms" script to send a reply
/var/spool/sms/incoming/sendsms $from_number "the router has rebooted"
fi

# Remove the GSM call file
/bin/rm $1

-----------------------------------------------------------------------

This is just some testing and the script shouldn't sit in the incoming directory but I'm still experimenting.

Good luck..Pete