Exploring Gammu - An open source mobile phone communication library

A few weeks back, while working on Twinstrata project (as a shadow resource), I had some spare time and I wondered if I could provide an SMS notification (in addition to email notification) whenever Nagios detected that the services on the production cluster are down. Hence, I started searching different communication libraries and found Gammu, an open source mobile phone communication library. Below are the steps I took to install Gammu on Linux (CentOS 7) and generate SMS notifications to the development team through it. 

First, I had to find a spare mobile phone that could be used for this purpose and a SIM card. I had one Samsung GT-S3653W mobile phone which I wasn't using anymore ever since I bought the smartphone. One of the reasons why I chose Gammu instead of any other library (e.g Gnokki) was their database that indicated that GT-S3653 (http://wammu.eu/phones/samsung/5152/) was compatible with this library.

For installation, I downloaded Gammu (version 1.34.0) tar file and extracted it on a Linux machine. Since I didn't need much specific tuning, I installed them using "./configure", "make", and "sudo make install" commands. 

To test if my installation was correct, I used "gammu version" command, but it gave me an error "gammu: error while loading shared libraries: libGammu.so.7: cannot open shared object file: No such file or directory".

I resolved it using help I found through google. I first found my libGammu.so.7 file, and then added it in the ld.so.conf file in the /etc directory.





Next, I tested my Gammu installation, and copied a sample gammu configuration file (.gammurc) into the ~/.gammurc file and edited only two parameters (the other parameters were commented and I had no use for them) : 

device = /dev/ttyACM0
connection = AT







Then, I connected my Samsung phone through its usb cable to the Linux machine, checked if it's properly connected through "dmesg" and "lsusb" commands. 





To check, if the gammu identified my phone correctly, I used the "gammu --identify" command. It correctly identified my phone.




Finally, I sent a sample test SMS using the following command:
"$ echo <sample text sms to send> | gammu --sendsms TEXT <phone number>" 



Last, in the spirit of giving back to the community, I added an entry in the Gammu database (http://wammu.eu/phones/samsung/7142/) stating GT-S3653W was compatible with the Gammu library.



Comments