Setting up an SMS Gateway on Ubuntu 10.04

How to do it? Below list the procedure.

Install the following packages,

root@ophiophagus:~# sudo apt-get install gammu gammu-smsd libgammu7 libgsmsd7

Attached the handset to your computer via USB, Serial etc. and on the other terminal, do the following,

root@ophiophagus:~# tail -f /var/log/syslog
May 22 21:37:30 ophiophagus kernel: [42750.936095] usb 7-1: new full speed USB device using uhci_hcd and address 11
May 22 21:37:30 ophiophagus kernel: [42751.166604] usb 7-1: configuration #1 chosen from 1 choice
May 22 21:37:30 ophiophagus kernel: [42751.223525] cdc_acm 7-1:1.1: ttyACM0: USB ACM device
May 22 21:37:30 ophiophagus kernel: [42751.227023] usb 7-1: bad CDC descriptors
May 22 21:37:30 ophiophagus kernel: [42751.230408] usb 7-1: bad CDC descriptors
May 22 21:37:30 ophiophagus modem-manager: (ttyACM0) opening serial device…
May 22 21:37:30 ophiophagus NetworkManager: SCPlugin-Ifupdown: devices added (path: /sys/devices/pci0000:00/0000:00:1d.1/usb7/7-1/7-1:1.11/net/usbpn0, iface: usbpn0)
May 22 21:37:30 ophiophagus NetworkManager: SCPlugin-Ifupdown: device added (path: /sys/devices/pci0000:00/0000:00:1d.1/usb7/7-1/7-1:1.11/net/usbpn0, iface: usbpn0): no ifupdown configuration found.
May 22 21:37:30 ophiophagus modem-manager: (ttyACM0): probe requested by plugin ‘Nokia’
May 22 21:37:31 ophiophagus modem-manager: (ttyACM0) closing serial device…
May 22 21:37:31 ophiophagus modem-manager: (Nokia): GSM modem /sys/devices/pci0000:00/0000:00:1d.1/usb7/7-1 claimed port ttyACM0
May 22 21:37:31 ophiophagus modem-manager: Added modem /sys/devices/pci0000:00/0000:00:1d.1/usb7/7-1
May 22 21:37:31 ophiophagus modem-manager: Exported modem /sys/devices/pci0000:00/0000:00:1d.1/usb7/7-1 as /org/freedesktop/ModemManager/Modems/12
May 22 21:37:31 ophiophagus NetworkManager: (ttyACM0): new GSM device (driver: ‘cdc_acm’)
May 22 21:37:31 ophiophagus NetworkManager: (ttyACM0): exported as /org/freedesktop/NetworkManager/Devices/15
May 22 21:37:31 ophiophagus NetworkManager: (ttyACM0): now managed
May 22 21:37:31 ophiophagus NetworkManager: (ttyACM0): device state change: 1 -> 2 (reason 2)
May 22 21:37:31 ophiophagus NetworkManager: (ttyACM0): deactivating device (reason: 2).
May 22 21:37:31 ophiophagus NetworkManager: (ttyACM0): device state change: 2 -> 3 (reason 0)

This will tell you to which device file the device is attached. In my case it was ttyACM0.

One need to create a file with the following configuration,

root@ophiophagus:~# vi .gammurc
[gammu]
port=/dev/ttyACM0
connection=at
name=Nokia

The other option to create this file is to use the `gammu-config` command to configure it.

SMS Gateway Gammu Config

Viola, you are done with the configuration. You can test by the following,

root@ophiophagus:~# gammu –identify
Manufacturer : Nokia
Model : unknown (ABCD)
Firmware : N012345678
IMEI : 012345678901234
SIM IMSI : 012345678901234
root@ophiophagus:~#

root@ophiophagus:~# echo “SMS Testing” | gammu –sendsms TEXT 1234567890
If you want break, press Ctrl+C…
Sending SMS 1/1….waiting for network answer..OK, message reference=168
root@ophiophagus:~#

The `gammu` manual lists a lot of options for it’s configuration.

The above does work with only some mobile. I had tried at least 3 mobiles before succeeding. You can check the whole mobile database on the following link,

http://wammu.eu/phones/

Important notice: Network manager has tendency to lock your GSM device once you start your GSM Internet connection. The device stays locked even after you disconnect so you must make sure that `enable mobile broadband` option is unchecked before you use Gammu. If this option is enabled you will get permission denied errors from Gammu.

The above procedure does not work with CDMA mobiles.

Courtesy:

Develop SMS Gateway with gammu , php, mysql on ubuntu 10.10

1 Comment »

  1. Terence Said,

    May 23, 2012 @ 6:36 pm

    Very informative and clear settings.

RSS feed for comments on this post · TrackBack URI

Leave a Comment