How to install and configure latest Gammu (1.29) in Ubuntu 10.04

I think you already know (enough) about Gammu, so I won’t tell a lot about it. Gammu is a software which has some abilities to control your phone through computer. It provides some useful functions for handling Message. That’s why it widely used and well-known as the backend for simple SMS Gateway System.

Few weeks ago, I got a project to build a LAN Monitoring System. The system is really simple, it’s do an automatic check for LAN and then send SMS notification if there any problem occurs. It combines Gammu (for SMS backend), MySQL (for data storage), and PHP (as the frontend of the System).

It’s easy to install and configure Gammu under my development environment. I use standar Ubuntu 10.04, with the default installed kernel, 2.6.32 and MySQL as Backend for data storage. *You need Apache PHP MySQL on your development environment.

Okay, no more talks, let’s do it !!

Install Latest Stable Version of Gammu

1. Add Gammu’s Official PPA

sudo add-apt-repository ppa:nijel/ppa
sudo apt-get update

2. Install Latest Gammu

sudo apt-get install gammu gammu-smsd libgammu7 libgsmsd7

Configure Gammu 1.29

In this tutorial, I use Sony Ericsson w660i (k530i mods) which is connected to computer through an USB Cable. You can use any kind of phone or modem, as long as it supported by Gammu.

1. Create new Gammu Configuration file (gammurc)

cd ~
gedit .gammurc

add the following configurations:

device = /dev/ttyACM0
connection = at115200

Parameters value may different for each computer, phone model, and connection type. Check your device node by seeing it in dmesg log (After plugging in your phone type dmesg in terminal). Maybe it shown something like this :

Check Device Node

Phone registered as ttyACM0 (access it in /dev/ttyACM0)

Save the file. Now, you should test the configuration. Type this command in the terminal:

gammu --identify

if Gammu detect your phone, it should be like the image shown below:

Gammu Identifying Phone

Gammu detects your phone

2. Create new SMSD Configuration file (gammu-smsdrc)

gedit .gammu-smsdrc

Add these parameters:

device = /dev/ttyACM0
connection = at115200

service = sql
driver = native_mysql
LogFile = syslog
user = root #mysql user
password = root #mysql password
pc = localhost
database = smsd #database name

You can use any DB Server you desired. We need to create some tables that are required by Gammu Service. Simply run this MySQL.Gammu.tables on your database (check this link for original one). Now you can test your configuration by running this command :

gammu-smsd -c .gammu-smsdrc

It will show nothing if your configuration is correct. Check if your inbox already moved into database by opening table ‘inbox’ (in the database you use).

Gammu Inbox

Sometimes you may got errors after running gammu-smsd command. Gammu-smsd will tell you the detail, so you can fix it easily. These are errors I got while trying to setup Gammu :

  1. Error getting SMS (Unknown error.:27)
    This is Gammu 1.26’s bugs. It’s already fixed in 1.29. Update your Gammu.
  2. Version of installed (1.26.1) is different to version of Gammu (1.29.0)
    You forget to update the following packages : gammu-smsd libgammu7 libgsmsd7
    Remember to update those packages too each time you update your Gammu.
  3. unknown smsd service type: “sql”
    Gammu 1.26 doesn’t recognized service type “sql”. So update your Gammu to 1.29 to fix this problem
  4. DataBase structures are from higher Gammu version
    This mean, the version of the Gammu is not compatible with current gammu database structure. Increase/ Decrease the value of field ‘version‘ in the ‘gammu‘ table. You may use phpMyAdmin or (mysql command prompt) to do it.
    Edit Gammu Version
  5. MySQL is Deprecated, bla bla bla..
    You should use ‘service=sql’ and the correct driver ‘driver=native_mysql’ in the Gammu SMSD Config file.

Some notes:

  • After running gammu SMS Daemon, your phone inbox will be moved (‘backed up’) into MySQL Database (inbox table) automatically. Your phone inbox may empty.
  • Your phone may still can be used as normal phone while Gammu SMS Daemon running, but it really freakin slow! *in my case*

29 thoughts on “How to install and configure latest Gammu (1.29) in Ubuntu 10.04

  1. Ternyata memang benar mas, modem nya karena lagi di pakai sama mobile partner jadinya nggak bisa.. setelah saya uninstall mobile partnernya dan konfigurasi ulang lagi (agak stress juga) akhirnya bisa juga terbaca modem nya..

    karena versi bawaan dari ubuntu ini gammu 1.26, saya mencoba install secara manual 1.29. Tapi setelah di install menggunakan make dan make install (agak kurang juga saya mas) file settingannya (gammurc dan gammu-smsdrc) nya dimana ya mas ? soalnya saya coba cari dengan perintah find nggak ada..

    Mohon solusinya..
    Terima kasih.

    • Agak stress ya, hahahaha 🙂

      Kalau file gammurc / gammu-smsdrc bisa diletakkan dimana saja, yang penting waktu menjalankan daemon (gammu-smsd) dikasih parameter lokasi file config (parameter -c). Misalnya dalam artikel saya, lokasi file saya letakkan di direktori /home/user/.gammurc
      gammu-smsd -c ~/.gammurc

      * fyi, ~ itu sama dengan /home/user

      Btw, Itu install manualnya berhasil? Kenapa tidak dari PPA saja, kan lebih mudah. 🙂

      • Terima kasih atas respon nya mas..

        Nah, itu dia mas.. saya sudah coba add PPA seperti yang ada di tutorial blog ini, tapi tetap menginstall versi 1.26 nya, bagaimana itu ya mas ?

        trus, kalau mau meng uninnstall gammu yang sudah di install secara manual ini bagaimana juga ? soalnya agak bingung karena nggak ada (/etc/init.d/gammu stop) nya..
        hahah ;d

        moohon pencerannya mas.

        Terima kasih.

        • Kalau masih versi 1.26, kemungkinan abis tambah PPA belum diupdate repository-nya. Coba apt-get update atau reload pakai synaptic.
          Cek di synaptic, kolom available version-nya itu 1.26 atau 1.33. Saya lihat di PPA versi terakhir untuk Ubuntu 10.04 (Lucid) adalah 1.33.

          Kalo mau uninstall, dihapus aja file/folder instalasinya, termasuk file2 binary yang terinstall otomatis. Misalnya /bin/gammu atau /usr/sbin/gammu, dsb.

  2. Pingback: Langit itu luas kawan … | How to install and configure latest Gammu (1.29) in Ubuntu 10.04
  3. Hi, maybe you can help me.

    I installed gammu on CentOS 5.9, but when I write gammu-smsd –daemon get this

    SQL service was not compiled in!

    and nothing happens in my database (sms)

    service = SQL
    driver = native_mysql

    how can I get the sms’s in my database?

    please help!

Leave a Reply to MV Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s