Using Gammu with an old phone

There are plenty of tools for using your mobile with linux – but sometimes older phones have limited support. Mine is one of them. I can send and get text messages, but I don’t get automatic notifications of when a text message shows up… and that was the big thing that I wanted. And when it pulls SMS messages from the phone, it pulls them all in one big text file.

This is not good.

Luckily, this is linux, so I was able to bash (ha!) something together on the command line. It’s a combination of bash scripts and a C program that work together. I’m sure there’s a better, more elegant way to do all this… but this works, and you’re welcome to it.

The bash script to show new messages I’m especially happy with – not only does it display the unread messages, but you can reply to them right in your terminal window. Yay!

Please note that lines 116, 120, and 122 of the C code need edited for your appropriate pathnames before compiling. It should be ANSI C compatible with no unusual dependencies. The bash scripts need editing for pathnames as well.

You will also need to run hcitool inq to get the bluetooth address of your phone.

I’ve got the code up at pastebin – here’s the C program, the daemon is here (bash), and the script to show messages is here.

If you improve on them, do let me know!