Friday, April 11, 2008

Connect to GSM Modem - send raw AT commands


#!/usr/bin/perl
use Device::Modem;

my $modem = new Device::Modem( port => '/dev/modem');
if($modem->connect(baudrate => 9600)) {
print "connected \n";
} else {
print "connect to modem is failed $! \n";
}

$modem->atsend('AT+CMGL="STO UNSENT"' . Device::Modem::CR);
print $modem->answer();


I just connect to modem and send AT+CMGL (Read SMS message, in this case STO UNSENT [message in unsent folder])

1 comment:

izzudin_aq said...

Om Zack, wah sekarang blognya dah diupdate lagi euyyy...rajin2 yaa postingnya...huehuehuehue.