Sending SMS Messages from InterMapper

Stephan Habenicht sends this summary of how he uses SMS messages as a notifier from his InterMapper server. It's also a nice example of creating a command-line notifier.

You'll need:

  • InterMapper ;)
  • An old cellphone with a serial connection to the InterMapper machine. This could be via cable or even Bluetooth. Please don't forget the power supply. Unfortunately most of the cellphones are not able to connect to power and a serial cable simultaneously. As far as I know only the Nokias are able to do this. But I am successfully using a Sony Ericsson T610 with Bluetooth.
  • Gammu. This seems to be a real powerful open source application to control cellphones. They are a little focused on Nokias and Siemens but it works also with other models. As mentioned above I use Sony Ericsson T610. There are versions of Gammu for Linux, MacOS X and Windows. I have only used Gammu under Windows Server 2003 and XP.

This is how it works:

  • Connect phone and InterMapper machine
  • Put the gammu files in the InterMapper "Tools" directory
  • Edit the gammurc with your correct values like comport, phonetype and if necessary atcommand. It's all documented in the gammurc and quite easy.
  • There's a small .bat file called sms.bat with one single line:

    echo %1 | gammu --sndsms TEXT 017212345678

  • In InterMapper create a commandline notifier.

  • In the "Command:" field type: sms.bat "${MESSAGE}"
  • Press "Edit Messages..."
  • Edit the message you want to send. I have had a problem with space or linebreaks, so I avoid them. This will be something like this:
  • You can enter whatever text you like. Most SMS providers will have a limitation of the number of characters.

That's it. Now you will be able to be contacted directly from the InterMapper server even when your Internet connection or your mail server goes down. Or maybe get a message when you have no email client available.