Sms controller (via sms controlling) by
using modem serial wavecom fastrack M1306B being interfaced with
microcontroller of bascom scripts.
I
have learned sending sms by using
modem serial wavecom fastrack M1306B being interfaced with microcontroller of
bascom scripts.
just for fun, since I already learn how to
send sms by using modem serial
wavecom fastrack M1306B being interfaced with microcontroller of bascom
scripts.
.
In principle, sms delivery process is conducted by using communication serial,
both between pc and modem or could be between modem and microcontroller.
Basically, sms sending process is communication with AT command. AT command
used to send SMS as below:
At+cmgs
= 085743320xxx [enter]
Write
the messages will be sent, then press ctrl + z simultaneously (programming code
ascii for rl + z is #26). It should appear OK as the sign that sms already
sent.
Here
is the source code sending sms using bascom:
Print "AT+CMGS=";
Print "085729169629" '----
cellphone numbers : , replaceable
Waitms 700
'----- wait 700 ms
Print "DEVICE SHIFT, INDICATION OF THEFT
"; '----- sms content sent
Print Chr(26) '----- final code for sending
sms command
Wait 1
'----- wait 1 second
Above
code will send command
At+cmgs
= 085729169629 [enter]
Then,
DEVICE MOVE, INDICATION OF THEFT, and character ctrl + Z to modem. It means we
command modem to send sms contains DEVICE MOVE, INDICATION OF THEFT to
085729169629
The
complete source code as follows:
$regfile =
"m8def.dat"
'Mikrokontroler ATMega8
$crystal = 12000000 ‘
cristal dipergunakan 12 mhz
$baud = 9600 ‘baudrate 9600
'------- konfigurasi anti
maling
Config Int0 = Low Level
‘(konsep maling akan mengangkat alat sehingga limit switch akan belogika 0)
On Int0 Int_ext0
Enable Interrupts
Enable Int0
$hwstack = 20
$swstack = 8
$framesize = 8
Config Serialin = Buffered
, Size = 72
Waitms 500
print "AT"
'------ sistem interupsi
diaktifkan
Enable Interrupts
Waitms 500
'Tunggu modem stabil
'------ tes komunikasi
dengan modem
Do
Print "AT" : '
kirim text “AT” keodem
Getline Sret '
get data from modem
Loop Until Sret =
"OK" ' modem
harus send OK ke mikrokontroller
'------ tunggu 2 detik
Wait 2
'Print
"AT+CMGF=1";
'wait 1
Int_ext0:
Print "AT+CMGS=";
'----nomor HP tujuan : , bisa ganti yang
lain
Print "085729169629"
'----- tunggu 700 ms
Waitms 700
'----- isi sms yang dikirim
Print "DDEVICE MOVE, INDICATION OF THEFT";
'----- kode akhiran untuk perintah kirim sms
Print Chr(26)
'----- tunggu 1 detik
Wait 1
Return
Video
1 Sms controller (via sms
controlling) by using modem serial wavecom fastrack M1306B being interfaced
with microcontroller of bascom scripts.