Howdy Niccolo,

I am currently working on the i-gotU logger and getting it to work without the Windows Desktop application. I also asked Mobile Action in January for help but got no response to date.

I have attached my test python code to date. Currently, I am able to interact with the device and have confirmed with PortMon that the communication from my code matches that of the Desktop application. I have only tested the software in Windows XP with the win32 and serial addons. No idea as to Linux, yet. I am currently looking at the raw data from the device but have yet to figure out its structure.

I doubt the desktop program will work easily in Linux w/ Wine as the program uses a MS Access database to store all settings and gps data. This database is typically found in the Window user's Application Data directory...

C:\Documents and Settings\USERNAME\Application Data\MobileAction\GPSTracer\Tracer.mdb

The database uses the password 'mytracer' (without the quotes).

I am looking for help in decoding the raw data as I don't have much time available.

If you are looking to use NMEA or SiRF's binary protocol, don't bother. Though the device may use a SiRFStar III chipset, it will not talk in the same manner as other SiRF devices. I spent over a week trying to see what would make the device respond in an identical manner to their software before realizing that the communication is time dependent.

-bborie
--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
[EMAIL PROTECTED]
###############################################################################
# $Id: r2v.py
#
# Purpose:  test code to connect to and dump Mobile Action's i-gotU devices
#             device used for this is GT-100
# Author:   dustymugs, [EMAIL PROTECTED]
#
###############################################################################
#
###############################################################################
# Copyright (c) 2008, dustymugs <[EMAIL PROTECTED]>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software foundation, Inc., 
# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
###############################################################################

import serial, time, sys
from dhc import hex2char as h2c, char2hex as c2h, hexString

def csNMEA(STR):
        cs = 0
        for c in STR:
                if c == '$':
                        continue
                if c == '*':
                        break

                cs = cs ^ ord(c)
        return cs

def csSiRF(STR):
        cs = 0
        for c in STR:
                cs = cs + ord(c)
        return cs & 32767

def buildSiRF(payload):
        sq = h2c('A0') + h2c('A2')
        eq = h2c('B0') + h2c('B3')
        pl = ("%X" % len(payload))
        cs = csSiRF(payload)

        return sq + pl + payload + ("%X" % cs) + eq

def flush(r, count = 1):
        i = 0
        while i < count:
                r.flushOutput();r.flushInput()
                i = i + 1

def removeDataHeader(STR):
        if not STR.startswith(DATAHEADER):
                return STR
        return STR[3:]

NULL = chr(0)
BUFFERSIZE = 8192
DATAHEADER = hexString('93 10 00', ' ')
VALIDMSG = hexString('93 00 00', ' ')
ERRORMSG = hexString('93 FF FE', ' ')

f = open('test.ig', 'w')

s = serial.Serial()

s.port = 'com8'
s.baudrate = 115200
s.bytesize = 8
s.parity = 'N'
s.stopbits = 1
s.timeout = 2
s.queuesize = BUFFERSIZE

# open serial port
s.open()

# clean
time.sleep(1)
flush(s)

# connect
s.write(hexString('93 01 01 03 00 00 00 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('00 00 00 00 00 00 00 68', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'

flush(s)

# config dump ???
# i-gotU Desktop does this
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('00 00 00 00 00 00 00 4A', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
s.read(s.inWaiting())

flush(s)

# ???
# i-gotU Desktop does this
s.write(hexString('93 0A 00 00 00 00 00 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
# generates a 13 byte response
# 93 00 0A 04 02 00 00 01 24 00 01 11 00
s.write(hexString('00 00 00 00 00 00 00 63', ' '))
time.sleep(0.05)
#print "****%s++++" % s.read(s.inWaiting())
s.read(s.inWaiting())

flush(s)

"""
dumps start with header 93 10 00
removing header makes dump 4096B
"""

"""

00 00 00 00 00 00 00 4A
10 00 00 00 00 00 00 3A
20 00 00 00 00 00 00 2A
30 00 00 00 00 00 00 1A
40 00 00 00 00 00 00 0A
50 00 00 00 00 00 00 FA
60 00 00 00 00 00 00 EA
70 00 00 00 00 00 00 DA
80 00 00 00 00 00 00 CA
90 00 00 00 00 00 00 BA
A0 00 00 00 00 00 00 AA
B0 00 00 00 00 00 00 9A
C0 00 00 00 00 00 00 8A
D0 00 00 00 00 00 00 7A
E0 00 00 00 00 00 00 6A
F0 00 00 00 00 00 00 5A
... and then what?

"""

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('F2 00 00 00 00 00 00 3A', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)


"""

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('10 00 00 00 00 00 00 3A', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('20 00 00 00 00 00 00 2A', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('30 00 00 00 00 00 00 1A', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('40 00 00 00 00 00 00 0A', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('50 00 00 00 00 00 00 FA', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('60 00 00 00 00 00 00 EA', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('70 00 00 00 00 00 00 DA', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('80 00 00 00 00 00 00 CA', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('90 00 00 00 00 00 00 BA', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

# data dump ???
s.write(hexString('93 05 07 10 00 04 03 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('A0 00 00 00 00 00 00 AA', ' '))
time.sleep(0.5)
#print "****%s++++" % s.read(s.inWaiting())
f.write(removeDataHeader(s.read(s.inWaiting())))

flush(s)

"""

# disconnect
s.write(hexString('93 01 01 00 00 00 00 00', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'
s.write(hexString('00 00 00 00 00 00 00 6B', ' '))
time.sleep(0.05)
if s.read(3) == VALIDMSG:
        print 'valid'

# check that buffer has nothing at end
#time.sleep(1)
#print "****%s++++" % s.read(s.inWaiting())

s.close()

f.close()
_______________________________________________
talk mailing list
[email protected]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk

Reply via email to