22 February, 2008

Ericsson W25 Sending and receiving SMS

The firmware of the W25 doesn't support the handling of the SMS, but the bult in 3G modem does. So let's dig a bit into it and use this possibility. (In order to do this you need to have access to the command line of the W25).

To control the modem of the W25 there are two commands to use:
  1. msctl - this is a high level handling with predefined command

  2. mctl - this is a low level command, which you can use to send AT command to the modem

Try out:

msctl rscp - this will give you the actual strength of your reception

msctl issue ATI - this will give you information about the modem included in your device.

Now if we would like to know, which AT commands we can use, we have to download the AT command book from the Sierra Wireless site: AT command reference. If this download will not work, just search the Sierre Wireless site for the AT command reference.

When looking into this document, you will find a lot of interesting command, but you will soon realize that the command related to SMS sending are just marked supported or not supported in chapter 2, but there is no description. We have to download the 3gpp standards 27.005 and 27.007 to see the detailed syntax. If the link here doesn't work, you can find them on the http://www.3gpp.com/ site.

Now we have everything to handle SMS.

Reading SMS

To read SMS, first we switch the SMS mode to text:

mctl issue at+cmgf=1

then we list the unread SMS:

mctl issue at+cmgl

or the already read messages:

mctl issue at+cmgl='"rec read"'

Sending SMS

Sending SMS is a bit more complicated becuase we have to include a new line in the AT command, and I could not manage to do it with mctl. But we should not panic, we have the chat command on the system which is exacty designed to send AT commands to modems. So lets put together the appropriate chat script:

"" ATZ
OK AT+cmgf=1
OK AT+cmgs="\T"
> \U^Z

We start with ATZ to reset the modem settings, then set the text mode, then use the command at+cmgs to send the message. The \T is one of the parameters to chat, we use this for the phone number, \U is the other, we use it for the message itself. We are ready, but for making it easier to use, we write a script to send SMS in one step:

usage() {
echo "Usage: $0 'phone number' 'message'"
echo "Sends the SMS message"

if [ $# -ne 2 ]; then
exit 1
chat -T "$1" -U "$2" -f /root/testchat -v /dev/modemctl

exit 0

If you have spaces in the message then you should surround it between quotes (").

There is only one problem with this, that the W25 is collecting some statistical data every minute so if we send the SMS exactly at the same time, the two modem commands may mix together. To avoid this you may extend the script, whith a small part which checks the actual time and if it is beetween 55 and 05 seconds then just waits for some more seconds.

Of course it would be nicer to have this on a WEB interface, with handling all kind of unicode characters, but as Shrek said in relation to the Dragon, don't worry, it is on my list :-)

02 February, 2008

External WEB server on Ericsson W25

After you have implemented the DynDNS for your W25 the next thing would be to have an external WEB server.

As the W25 has a built in WEB server, it is only one line to start a web server. The command you should use is httpd.

To start an external web server serving pages from the "web" directory of the connected Flash drive, issue the following command:

httpd -i ppp0 -h /mnt/C2F8-E4F2/web

This will start the web server from on the ppp0 interface, with the home directory being /mnt/C2F8-E4F2/web. The index file should be index.html.

For all possible options to httpd issue httpd --help. To see the possibilities in the configuration file, go to the Busybox homepage and look at the examle coinfigutration file provided in the source for httpd.

01 February, 2008

New Firmware released for Ericsson W25 (1.3 R9D)

Half year after the last publicly released SW version from 21st January there is a new SW version available on the official website.

According my previous readings the 1.3 SW version solves some security issues, a memory leak in the WLAN driver and some minor issues.

When I will get a better internet connection, I will download the new package and update this post with the exact details.