Archive for February, 2011
Trouble at t’phone
Posted by michaelhamel in Linux, Ubuntu on February 7, 2011
I have been revising my file server/firewall/ZoneMinder system that I described in some of my first blog posts and it has all gone pretty smoothly. I bought a new motherboard and CPU, mostly to get gigabit Ethernet support, but in the hope that ZoneMinder would work better with my IP camera (another story for later post). The new board is an Asus G41-based M-ATX part with a 2.9GHz Pentium Dual-Core E6500 on it. The bump in CPU power from a 1.2GHz Pentium 3 is substantial. I was able to reuse the old HP box and power supply, and power consumption has only gone up from 45W to ~53W, which is pretty good. Its running Ubuntu Lucid Lynx (10.04) and installation and setup went very smoothly apart from some confusion with shorewall, whose default two-interface setup assumes that the local net is eth1 and the Internet is on eth0. I have it the other way around and you need to change all the config files.
This post, however, is about a new idea I wanted to try, which was to install my old Telecom CDMA phone in the server cupboard and use it to send and receive text messages to and from the server.
On the face of it this didn’t look difficult. There is a Linux/Windows/MacOS package called gnokii that does practically everything with a phone, provided that the phone supports Bluetooth or has a data cable, that you could possibly want. My Nokia 6165i has Bluetooth, so the first step was to buy a cheap Bluetooth adapter (Dick Smith, $20), plug it in, and fire up Bluetooth support:
sudo apt-get install bluez
Once I had that, I turned on the phone, told it to be discoverable on Bluetooth (down in Settings/Connectivity/Bluetooth/Bluetooth Settings) and told Bluetooth to look for it:
hcitool scan
Scanning …
00:12:D1:3F:00:8F Michael H 6165i
It found it! Now to get gnokii:
sudo apt-get install gnokii
The version of gnokii that comes with Ubuntu 10.04 is 0.6.28, which has its preferences in ~/.gnokiirc or /etc/gnokiirc. Later versions change this, but for the moment it was enough to edit the heavily commented /etc/gnokiirc and use the Bluetooth ID given by hcitool so that the following lines were active:
port = 00:12:d1:3f:00:8f
model = series40
connection = bluetooth
debug = on
Debug is useful if you run into problems, as I did…
gnokii –identify
should then talk to the phone, whereupon we run into our first problem. The phone needs to pair to the Bluetooth transceiver on the PC, and if we were running desktop Ubuntu a nice dialog would come up on the desktop as well as the phone, we enter the same PIN into each dialog and all would be well. But this is running on a file server and I can’t do that. Some Googling eventually found a solution, which is to use one of the bluez examples to get the PIN code handshake done:
sudo /usr/share/doc/bluez/examples/simple-agent hci0 00:12:d1:3f:00:8f
This prompts for the PIN code, you enter it, the phone prompts, you enter the same number, all is well.
Now sending a text message should be as simple as:
echo “This is a text message from the file server” | gnokii –sendsms number -r
But life isn’t that simple. It seems to work, but the text messages simply don’t go. It took a good deal of debugging, updating, and fiddling about before I discovered the simple truth:
gnokii doesn’t support CDMA phones. CDMA is an older technology and the commands to send text messages are there — but subtly different. The only thing that might have worked was using gnokii AT mode, which I could get at by changing model = series40 to model = AT in the preferences. But the answer to that is short and final:
PDU mode is not supported by the phone. This mobile supports only TEXT mode
while gnokii supports only PDU mode.
SMS Send failed (Unknown error – well better than nothing!!)
So there we are, it isn’t going to work. It wasn’t going to work for long anyway, as the old CDMA network is going to be turned off next year, so the next step is to buy a GSM Bluetooth phone and try again (ones with cracked but otherwise functional screens can be had very cheap on Trademe, I see…). I hope to extend this post with better news at some point in the future.