Spesifikasi Minimum :
Processor : Intel P4 1.8GHZ
RAM : 256MB
Hardisk : 80GB
Modem atau handphone kompabilitynya bisa di cek di sini
Kebutuhan Paket Software :
$ sudo tasksel install lamp-server
user : root passwd : root
$ sudo apt-get install php5-cli
$ sudo apt-get install phpmyadmin
user : root pass : root
$ sudo vim /etc/apt/sources.list.d/gammu.list
deb http://repo.ugm.ac.id/ppa.launchpad.net/gammu lucid main
$ wget ftp://repo.ugm.ac.id/ekstra/.ugos_tools/key_gammu
$ apt-key add key_gammu
$ sudo apt-get update $ sudo apt-get install gammu gammu-smsd
$ dmesg | grep tty [12321.308078] usb 5-3: GSM modem (1-port) converter now attached to ttyUSB0 [12321.308275] usb 5-3: GSM modem (1-port) converter now attached to ttyUSB1
$ sudo gammu-config
port = /dev/ttyUSB0 # disesuaikan connection = at115200 # disesuaikan synchronizetime = yes logfile = /var/log/gammulog logformat = textall use_locking = # isi yes jika ingin resource modem di kunci
[gammu] port = /dev/ttyUSB0 # change this connection = at115200 # change this [smsd] PIN = '' service = sql driver = native_mysql DeliveryReport = sms logfile = /var/log/smsdlog debuglevel = 1 # change to 255 if you want to debug User = root # change this password = root # change this pc = localhost database = kalkun runonreceive = /var/www/kalkun/scripts/daemon.sh
$ sudo /etc/init.d/gammu-smsd stop
$ sudo gammu --identify Device : /dev/ttyUSB0 Manufacturer : huawei Model : E220 (E220) Firmware : 11.117.10.02.00 IMEI : 351827014879XXX SIM IMSI : 510012541759XXX
$ sudo gammu --sendsms text 0857257XXXXX Enter the message text and press Ctrl+D: test server If you want break, press Ctrl+C... Sending SMS 1/1....waiting for network answer..OK, message reference=3
$ sudo gammu --getussd *888# Press Ctrl+C to break... USSD received Status : No action needed Service reply : “Sisa Pulsa Anda Rp.4950. Penggunaan pulsa di periode ini Rp.11150. Aktif s.d. 14/05/2011. Cari t4 menarik dsekitarmu dgn TelkomselLacak. Hub *123*55#”
$ sudo /etc/init.d/gammu-smsd start
Kalkun merupakan open source berbasis web SMS (Short Message Service) manajemen, itu menggunakan gammu-smsd (bagian dari keluarga gammu) sebagai mesin SMS gateway untuk menyampaikan dan mengambil pesan dari telepon / modem.
$ wget -c http://nchc.dl.sourceforge.net/project/kalkun/kalkun/X.X/kalkun_X.X.zip
$ sudo mkdir /var/www/kalkun $ sudo mv kalkun_X.X.zip /var/www/kalkun $ cd /var/www/kalkun/ $ sudo unzip kalkun_X.X.zip
$ mysql -u root -p mysql> CREATE DATABASE kalkun; mysql> quit
$db['default']['hostname'] = "localhost"; $db['default']['username'] = "root"; // change this $db['default']['password'] = "root"; // change this $db['default']['database'] = "kalkun"; // change this $db['default']['dbdriver'] = "mysql";
$ sudo gunzip /usr/share/doc/gammu/examples/sql/mysql.sql.gz
$ mysql kalkun -u root -p < /usr/share/doc/gammu/examples/sql/mysql.sql
#!/bin/sh # Configure this (use absolute path) PHP=/usr/bin/php # php cli path DAEMON=/var/www/kalkun/scripts/daemon.php # daemon.php path # Execute $PHP $DAEMON ~
$url = "http://localhost/kalkun";
$ sudo rm -rf /var/www/kalkun/install
Untuk menjalankan daemon setiap kali komputer restart, ketik perintah berikut ;
$ sudo update-rc.d gammu-smsd defaults
Agar log tidak membengkak, Berikut tahapan untuk mengatasi hal tersebut, sebaiknya anda menggunakan hak akses superuser atau root :
$ sudo vim /etc/logrotate.d/smsdlog
/var/log/smsdlog {
daily
missingok
rotate 7
compress
delaycompress
create 640 root root
endscript
}
$ sudo su
# crontab -e
50 6 * * * /etc/init.d/gammu-smsd restart
Jika dilihat kembali pesan error-nya : Database structures version: 11, SMSD current version: 12, maka sebaiknya lakukan perintah dibawah ini pada database server yang digunakan dalam hal ini adalah MySQL.
$ mysql -u root -p mysql> UPDATE `kalkun`.`gammu` SET `Version` = '12' WHERE `gammu`.`Version` =11; mysql> quit
Connect/Disconnect di Kalkun hanya perkiraan dari waktu terakhir gammu-smsd mengupdate aktifitas dengan waktu sekarang. Defaultnya adalah 10 menit, bisa diganti di file /var/www/kalkun/application/config/kalkun_settings.php,
$config['modem_tolerant'] = ’10′;
Beberapa mungkin yang bisa di konfig;
$config['sms_bomber'] = FALSE; $config['enable_emoticons'] = FALSE; $config['sms_advertise'] = FALSE; $config['sms_advertise_message'] = "This is ads message";
Ketika melakukan perintah dmesg dan tidak menemukan modem terknoneksi, berikut langkah solusinya (ex. Modem Huawei e1550) ;
$ sudo apt-get install usb-modeswitch
$ sudo vim /etc/udev/rules.d/15-huawei-155x.rules
SUBSYSTEM=="usb",
ATTRS{idProduct}=="1446",
ATTRS{idVendor}=="12d1",
RUN+="/lib/udev/modem-modeswitch --vendor 0x$attr{idVendor} --product 0x$attr{idProduct} --type option-zerocd"
$ sudo lsusb -v | less Bus 005 Device 004: ID 12d1:1446 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x12d1 Huawei Technologies Co., Ltd. idProduct 0x1446 E220 HSDPA Modem / E270 HSDPA/HSUPA Modem bcdDevice 0.00 iManufacturer 2 HUAWEI Technology iProduct 1 HUAWEI Mobile iSerial 0 bNumConfigurations 1
Kasus ini terjadi jika Anda memindah modem ke port USB yang lain. Maka service tidak akan berjalan, karena config masih mendeteksi lokasi port USB sebelumnya.
$ sudo wvdialconf $ cat /etc/wvdial.conf [Dialer Defaults] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = Analog Modem ; Phone = <Target Phone Number> ISDN = 0 ; Password = <Your Password> New PPPD = yes ; Username = <Your Login Name> Modem = /dev/ttyUSB1 Baud = 9600
Untuk mengidentifikasi error pada web Kalkun, aktifkan log debugging pada config Kalkun seperti cara berikut ;
$sudo vim kalkun/application/config/config.php
Ubah baris log_treshold menjadi seprti berikut
$config['log_threshold'] = 4;
Akses menggunakan browser dengan alamat berikut ;
http://localhost/index.php/daemon/message_routine