I’ve been messing around with Gnokii, an open source program that communicates with mobile phone (mostly Nokia). Upon installing the Gnokii from source, I can fire up SMSD a daemon that listens for incoming messages from the phone and display them on the computer screen or save into a database program such as MySQL.

To make things more exciting, I slightly patch the SMSD source code to process PHP script when a message arrives. You can download my complete patched Gnokii here. First, compile the Gnokii from source. After that change destination into smsd folder and run again the usual configure, make and make install.

Example how to execute SMSD:

# ./smsd -m file -i 5 -a /usr/local/bin/php -e /tmp/test.php

test.php:
print_r($argv);

Format
$argv[0] = PHP_PATH
$argv[1] = PHP_EXEC_FILE
$argv[2] = incoming number
$argv[3] = incoming message

As for the mobile phone, I use Nokia 6070 which being sold at forum.lowyat.net around RM265.

Nokia 6070

Nokia 6070 POP-Port

I also got the CA-42 Nokia cable from Lowyat Plaza for RM35

CA-42 Box

CA-42 USB

The complete Gnokii installation instruction can be found at Gnokii Wiki.

With this successfully installed, I can use the SMS, for example, to check on my server health or other cool stuff.

tagged as

    Related Topics
  • No related posts