Jam Weasley : Fun Part
Sebelum mulai, baca dulu intronya disini
Sekarang ke bagian yang serunya, pertama gw setup device nya :
- Gw masukin SIM Card yang GPRS enabled-flatrate.
- Semua konfigurasi dilakukan lewat sms (petunjuk ada sebagian besar ada di manual book).
- Gw set dulu supaya nomer HP gw adalah nomer satu-satunya yang bis ganti-ganti settingan.
- Setelah devicenya GPS-Fixed (udah dapet data lokasi dari satelit) warna lampunya berubah yang tadinya kedap-kedip cepet jadi kedap-kedip tiap 4 detik. (GPS Fixed berarti gak ada masalah – OK )
- Gw coba call dari nomer gw, langsung otomatis ditutup ama devicenya (baguslah biar gw nggak keluar pulsa), trus nih device langsung ngasih data-data dia ke HP gw lewat sms (date-time, IMEI, latitude, longitude) – (SMS sending – OK)
- Ganti mode dari SMS ke GPRS – OK
- Set APN buat koneksi GPRS – OK
- Set server IP address dan server port buat upload semua data dari device – OK
Berhubung sementara ini gw nggak punya server dengan IP public, ya udah gw pake komputer gw yang kebetulan UNIX based sebagai server.
Jadi pertama gw buka dulu port dari router gw supaya ngelolosin semua paket dan langsung di forward ke komputer gw.
Gw coba aktifin fasilitas Auto Track dari device nya, jadi teorinya gw bisa receive data yang di send dari device di komputer gw tiap 30 detik.
Buat ngetrack paket yang masuk, di UNIX based server bisa menggunakan command nc / netcat. Jadi misalnya pengen ngeliat trafik di port 345, kalo di MAC OS X bisa pake :
#nc -l 345
untuk lebih jelasnya bisa liat disini : manual netcat.
Paket data sudah keterima dengan baik di server gw, paket dalam bentuk CSV (comma separated values). Dari GPSPassion sih :
The protocol used by TK102 is NMEA :
$GPRMC,aaaaaa,b,cccc.cc,d,eeeee.ee,f,ggg.g,hhh.h,jjjjjj,kkk.k,l*mmWhere:
* aaaaaa is the time of the fix UTC in hhmmss format
* b is the validity of the fix (“A” = valid, “V” = invalid)
* cccc.cc is the current latitude in ddmm.mm format
* d is the latitude hemisphere (“N” = northern, “S” = southern)
* eeeee.ee is the current longitude in dddmm.mm format
* f is the longitude hemisphere (“E” = eastern, “W” = western)
* ggg.g is the speed in knots
* hhh.h is the true course in degrees
* jjjjjj is the date in DDMMYY format
* kkk.k is the magnetic variation in degrees
* l is the direction of magnetic variation (“E” = east, “W” = west)
* mm is the checksumJust before GPRMC sentence there is the TK102 timestamp and the admin telephone number.
Device udah nyala, GPS satelites udah fixed, server udah up, packets udah diterima di server, tinggal sekarang ngumpulin paket-paket yang diterima trus dimasukin ke dalem database.
Ngejalanin script yang di post di GPSpassion : Script. Tapi bingung mo mulai dari mana, hehe.
Mentok di script php, nanti diterusin lagi deh.
[...] bingung mikirin gimana cara retrieve data gps location di server, invoice yang belum cair, bahasa yang hancur lebur dan pacar yang marah gara-gara lupa [...]
blog.rohandi.com » Mari memasak!
21 Oct 09 at 00:39