SMS Gateway, OpenWRT from TP-Link TL-WR1043ND and Pro-Link PHS-100
Cheap SMS Gateway
OpenWRT, TP-Link TL-WR1043ND and Pro-Link PHS-100
By using OpenWRT, TP-Link TL-WR1043ND and Pro-Link PHS-100 I wanted to make a small, cheap and use full SMS gateway. So in conditions when I am abroad I can send/receive messages to my friends in my home country. I chose this device as it consumes less power, as it works on 12v and is < 1A DC device, it can be placed any where or could be mounted on wall. I have also ported OpenWRT so it can be used as simple x86 machine/server. I was able to compile Pro-Link PHS-100 and 300 drivers onto it and smstools. The whole procedure for the setup is defined below.
Installing Prolink PHS-100 on OpenWRT
root@OpenWrt:/# dmesg[ 12.140000] USB Mass Storage support registered. [ 12.270000] USB Serial support registered for GSM modem (1-port)
[ 12.270000] usbcore: registered new interface driver option [  ; 12.280000] option: v0.7.2:USB Driver for GSM modems [ 13.140000] scsi 0:0:0:0: CD-ROM PROLINK HSDPA Modem 2.31 PQ: 0 ANSI: 0
Which means the TPLINK has detected something interesting on it’s USB Port, now the modem is in USB Flash storage mode which means you can read/write to its flash port but can’t use it as GSM Modem. The device when ever turns on or plugged in, it will always be in storage mode. You need a utility to switch its mode to GSM Modem.
# Option iCON 210 # PROLiNK PHS100 (various looks) # Hyundai Mobile MB-810 # # One report of switching with DetachStorageOnly. Needs at least # a second to settle before binding to usbserial # # Contributor: wahlm, Peter Kraker, Pakdhetimin Sekum DefaultVendor= 0x1e0e DefaultProduct= 0xf000 TargetVendor= 0x1e0e TargetProduct= 0x9000 TargetClass= 0xff MessageEndpoint=0x1 MessageContent="555342431234567800000000000006bd000000020000000000000000000000" ResponseEndpoint=0x1 #NeedResponse=1
root@OpenWrt:# usb_modeswitch -c /etc/usb_switch.conf
If it runs without any error you should see,root@OpenWrt:/tmp/spool/sms/outgoing# ls /dev/tty*/dev/tty /dev/ttyS0 /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB3/dev/ttyUSB* (0,1,2) all devices has relation with Prolink PSH-100.
One of these three ports is the one you need, to find execute the following, but before this you need to download and compilehttp://smstools3.kekekasvi.com for MIPS.
Compile it for MIPS architecture
vi smstools3/src/Makefileset CC='path to your mips-gcc compiler'
create a file in /etc/smsd.confdevices = GSM1logfile = /var/log/smsd.logloglevel = 7[GSM1]device = /dev/ttyUSB2incoming = no# Service Center Addresssmsc = +923455000010send_delay = 10baudrate = 19200report_device_details = yesrtscts = no
smsd -C COM1
http://kerneltrap.org/node/55573, read this blog, it has very useful information.
ssh into and run smsd -c /etc/smsd.conf &
/var/spool/sms/outgoing, /var/spool/sms/incoming, /var/spool/sms/checked
vi /var/spool/sms/outgoing/send.smsTo: +923xxxxxxxText of the SMS.
In order to automate the process you need to run the 'usb_modeswitch' and /usr/sbin/smsd -C /etc/smsd.conf on each reboot or run it through /etc/rc.local.