SMS Gateway using Sierra Wireless USB Modem on Debian Wheezy
By Leo Gaggl
I have been planning to set up a SMS Gateway for sending and receiving SMS messages via a headless utility unit (Raspberry Pi) for a while. Since I had a leftover Sierra Wireless AirCard 880U from Telstra in Australia I wanted to re-purpose this unit with a spare SIM card. Unfortunately it was very hard to find any good setup manual for this particular combination and took some time to fiddle & debug. This is the working setup for future reference and hopefully it helps somebody.
Install dependencies
Note: install usb-modeswitch BEFORE connecting USB Modem
sudo apt-get install usb-modeswitch gsm-utils smstools gammu
Connect the USB Modem
Check if modem is recognised
lsub
Bus 003 Device 002: ID 1199:6855 Sierra Wireless, Inc.
Edit smstools config file
vim /etc/smsd.conf
Change the GSM1 entry
[GSM1]<br></br>init = ATE0;+CPMS="SM","SM"<br></br>device = /dev/ttyUSB2<br></br>incoming = yes<br></br>mode = new<br></br>baudrate = 115200<br></br>smsc = 61418706700<br></br>pin = ignore<br></br>#rtscts = yes<br></br>#cs_convert = yes<br></br>report = yes<br></br>sending_disabled = no<br></br>memory_start = 1<br></br>pre_init = yes<br></br>primary_memory = SM<br></br>secondary_memory = SM<br></br>secondary_memory_max = 40
Troubleshooting the modem
I installed gammu purely to have an easier way to test if the modem actually worked. You can use gammu-config to do a GUI config or create a config file manually
vim /etc/gammurc
[gammu]<br></br>port = /dev/ttyUSB2<br></br>connection = at115200
Testing
gammu-detect
; Configuration file generated by gammu-detect.
; Please check The Gammu Manual for more information.[gammu]
device = /dev/ttyUSB0
name = Phone on USB serial port Sierra_Wireless__Incorporated AirCard
connection = at[gammu1]
device = /dev/ttyUSB1
name = Phone on USB serial port Sierra_Wireless__Incorporated AirCard
connection = at[gammu2]
device = /dev/ttyUSB2
name = Phone on USB serial port Sierra_Wireless__Incorporated AirCard
connection = at
#send sms<br></br>sudo echo "sms test" | /usr/bin/gammu --sendsms TEXT +61XXXXXXXX<br></br>#check received sms<br></br>gammu getallsms
Add your own user account to dialout group if you want to send from your own account for testing (gammu)
sudo adduser $UNPRIVILEGEDUSER$ dialout
Next I will have some fun setting up PlaySMS to allow me to send SMS commands and create some inbound SMS workflows for family.
References
PlaySMS: http://playsms.org/
Gammu: http://wammu.eu/phones/sierra/2551/
smstools: http://smstools3.kekekasvi.com/index.php?p=configure