Skip to content

Scan Port Modem, Install Gammu, dan Install Kalkun di Ubuntu 10.4

18 January 2011

Menginstall gammu dan gammu-smsd

$ sudo apt-get install gammu gammu-smsd

Menscan modem yang terpasang di USB:
1. install wvdial

$ sudo apt-get install wvdial

2. Pasang modem dan liat parameternya

$ sudo wvdialconf /etc/wvdial.conf

hasilnya sbb:

$ sudo wvdialconf /etc/wvdial.conf
coder@coder-desktop:~$ sudo wvdialconf /etc/wvdial.conf
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

ttyS0: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
ttyS0: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
ttyS0: ATQ0 V1 E1 -- and failed too at 115200, giving up.
Modem Port Scan: S1   S2   S3   
WvModem: Cannot get information for serial port.
ttyUSB0: ATQ0 V1 E1 -- K
ttyUSB0: failed with 2400 baud, next try: 9600 baud
ttyUSB0: ATQ0 V1 E1 -- ATQ0 V1 E1
ttyUSB0: failed with 9600 baud, next try: 115200 baud
ttyUSB0: ATQ0 V1 E1 -- OK
ttyUSB0: ATQ0 V1 E1 Z -- failed with 115200 baud, next try: 9600 baud
ttyUSB0: ATQ0 V1 E1 Z -- OK
ttyUSB0: ATQ0 V1 E1 S0=0 -- O
ttyUSB0: ATQ0 V1 E1 &C1 -- OK
ttyUSB0: ATQ0 V1 E1 &C1 &D2 -- O
ttyUSB0: ATQ0 V1 E1 &C1 +FCLASS=0 -- ATQ0 V1 E1 &FCASS=0
ttyUSB0: Modem Identifier: ATI -- MC39i
ttyUSB0: Speed 19200: AT -- OK
ttyUSB0: Speed 38400: AT -- AT
ttyUSB0: Speed 38400: AT -- OK
ttyUSB0: Speed 57600: AT -- OK
ttyUSB0: Speed 115200: AT -- OK
ttyUSB0: Speed 230400: AT -- Speed 230400: AT -- Speed 230400: AT -- Max speed is 115200; that should be safe.
ttyUSB0: ATQ0 V1 E1 &C1 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 115200; init "ATQ0 V1 E1 &C1"

atau

$ tail -f /var/log/messages
Jan 16 21:38:45 coder-desktop kernel: [11269.053977] pl2303 5-2:1.0: pl2303 converter detected
Jan 16 21:38:45 coder-desktop kernel: [11269.068209] usb 5-2: pl2303 converter now attached to ttyUSB0

3. mengkonfigurasi gammu

$ gammu-config

berdasarkan data yang didapat dari wvdialconf sebelumnya masukan nilai berikut:

port: /dev/ttyUSB0
connection: at115200

4. gammu identify

$ gammu identify

hasilnya

Manufacturer         : Siemens
Model                : unknown (MC39i)
Firmware             : REVISION 02.00
IMEI                 : 357249016596845
Product code         : MC39i
SIM IMSI             : 510101562739369

5. mencoba menggunakan gammu dengan cara mengirim sms

gammu --sendsms TEXT 085295882xxx

isi dengan text yang anda inginkan, setelah selesai ctrl+d jika berhasil maka akan terkirim ke no hp 085295882xxx.

Untuk menggunakan gammu di aplikasi berbasis web kita bisa mencoba Kalkun, asli buatan Indonesia
untuk menginstall kalkun
1. Pertama, menambahkan PPA Azhari Harahap (author of Kalkun) ke repository

$ sudo nano /etc/apt/sources.list

kemudian tambahkan baris berikut

deb http://ppa.launchpad.net/back2arie/ppa/ubuntu lucid main
deb-src http://ppa.launchpad.net/back2arie/ppa/ubuntu lucid main

2. Kemudian perivikasi paket dan update repository

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B3830FF1
$ sudo apt-get update

3. install kalkun

$ sudo apt-get install kalkun

4. Menginstall mysql-server, jika belum ada. Atau bisa menggunakan database lainnya, mysql hanya optional dan sebuah contoh saja

$ sudo apt-get install mysql-server
$ mysql -u root -p
mysql> CREATE DATABASE kalkun;
mysql> GRANT ALL PRIVILEGES ON kalkun.* TO 'username'@'localhost' IDENTIFIED BY 'password';
mysql> FLUSH PRIVILEGES;

5. Membuat file log

$ sudo touch /etc/smsdlog

6. edit gammu-smsdrc

$ sudo nano /etc/gammu-smsdrc

hasilnya seperti ini

# Configuration file for Gammu SMS Daemon

# Gammu library configuration, see gammurc(5)
[gammu]
# Please configure this!
port = /dev/ttyUSB0       #yang ini disesesuaikan dengan hasil diatas
connection = at115200     #yang ini disesesuaikan dengan hasil diatas
# Debugging
#logformat = textall

# SMSD configuration, see gammu-smsdrc(5)
[smsd]
service = files
logfile = syslog
# Increase for debugging information
debuglevel = 0      #jika anda ingin debug jadikan 255

# Paths where messages are stored
inboxpath = /var/spool/gammu/inbox/
outboxpath = /var/spool/gammu/outbox/
sentsmspath = /var/spool/gammu/sent/
errorsmspath = /var/spool/gammu/error/

7. configurasi php untuk koneksi ke database

$ sudo nano /var/www/kalkun/system/application/config/database.php

hasilnya sbb:

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "username"; // change this
$db['default']['password'] = "password"; // change this
$db['default']['database'] = "kalkun";
$db['default']['dbdriver'] = "mysql";

8. Di browser masuk ke http://localhost/kalkun kemudian ikut petunjuknya

reference:
http://back2arie.wordpress.com/tag/kalkun/

From → Linux

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

%d bloggers like this: