saving and restoring GPS data for U-blox chip quicker startup

Vasco Névoa vasco.nevoa at sapo.pt
Sat Aug 30 02:00:27 CEST 2008


Hi all.

I don't know how far anyone has gone in this subject, so I took the 
liberty to experiment.
I'd like to see the freerunner's GPS do the same any other GPS device 
does: save the almanac/ephemeris data to storage upon shutdown and 
restore it upon powerup. I don't know much about GPS, but I imagine this 
would accelerate the startup, and it wouldn't hurt much if the device 
has changed geographical location in between (like after a plane trip, 
for example.)

So, I took the protocol datasheet 
(http://www.u-blox.com/customersupport/gps.g3/ANTARIS_Protocol_Specification(GPS.G3-X-03002).chm) 
and tried to coerce the chip into vomiting the stored information (we 
should take care to do it after working for at least 2 or 3 minutes with 
a good reception level).

Basically:

# Listen to the GPS port. Don't use gpspipe or any other "complicated" 
stuff because of internal filtering cutting the binary messages. U-blox 
binary protocol messages start with 0xB5 0x62.
root at om-gta02:~# hexdump /dev/ttySAC1 | grep 62b5
# If you're suspicious of this, take a look at the direct output of "cat 
/dev/ttySAC1" and you'll be convinced when you see the ASCII output 
temporarily replaced by binary garbage. :)

# Ask the u-blox chip for it's stored gps data, by sending the AID-DATA 
poll message (equivalent to sending AID-INI + AID-HUI + AID-EPH + 
AID-ALM, we could send each one alone if desirable):
root at om-gta02:~# ./ubxgen.py 0B 10 00 00  > AID-DATA.ubx
root at om-gta02:~# cat AID-DATA.ubx > /dev/ttySAC1

# out pours the requested data...
(down at the end of this message)

Now, this is just a start for a "proof of concept", and I think it has 
potential. The output is already in the same format it takes for input, 
and is separated into 4 different message categories, allowing us to 
modify some of the data if needed.

So, what would be needed for this feature to be implemented?
1 - some process capable of writing and reading "ublox-binary" at 
/dev/ttySAC1;
2 - a simple hook into the UI gps on/off button script, forcing process 
(1) to ask for info and store it on file upon gps shutdown, and to 
rewrite that info into the chip on startup.

Who's working on this? I'd happily beta-test it.

My data (not really relevant, and probably incomplete because of the grep)
00004c0 3030 2c38 3030 302c 2a30 4236 0a0d 62b5
0000500 0000 0000 4ba0 62b5 020b 0048 ffff ffff
0000550 0007 0000 d55d 62b5 310b 0008 0001 0000
0000560 0000 0000 f745 62b5 310b 0008 0002 0000
0000570 0000 0000 ff46 62b5 310b 0008 0003 0000
0000580 0000 0000 0747 62b5 310b 0008 0004 0000
0000590 0000 0000 0f48 62b5 310b 0008 0005 0000
00005a0 0000 0000 1749 62b5 310b 0008 0006 0000
00005b0 0000 0000 1f4a 62b5 310b 0008 0007 0000
00005c0 0000 0000 274b 62b5 310b 0008 0008 0000
00005d0 0000 0000 2f4c 62b5 310b 0008 0009 0000
00005e0 0000 0000 374d 62b5 310b 0008 000a 0000
00005f0 0000 0000 3f4e 62b5 310b 0008 000b 0000
0000600 0000 0000 474f 62b5 310b 0008 000c 0000
0000610 0000 0000 4f50 62b5 310b 0008 000d 0000
0000620 0000 0000 5751 62b5 310b 0008 000e 0000
0000630 0000 0000 5f52 62b5 310b 0008 000f 0000
0000640 0000 0000 6753 62b5 310b 0008 0010 0000
0000650 0000 0000 6f54 62b5 310b 0008 0011 0000
0000660 0000 0000 7755 62b5 310b 0008 0012 0000
0000670 0000 0000 7f56 62b5 310b 0008 0013 0000
0000680 0000 0000 8757 62b5 310b 0008 0014 0000
0000690 0000 0000 8f58 62b5 310b 0008 0015 0000
00006a0 0000 0000 9759 62b5 310b 0008 0016 0000
00006b0 0000 0000 9f5a 62b5 310b 0008 0017 0000
00006c0 0000 0000 a75b 62b5 310b 0008 0018 0000
00006d0 0000 0000 af5c 62b5 310b 0008 0019 0000
00006e0 0000 0000 b75d 62b5 310b 0008 001a 0000
00006f0 0000 0000 bf5e 62b5 310b 0008 001b 0000
0000700 0000 0000 c75f 62b5 310b 0068 001c 0000
0000770 f5a2 004d 8a90 62b5 310b 0008 001d 0000
0000780 0000 0000 d761 62b5 310b 0008 001e 0000
0000790 0000 0000 df62 62b5 310b 0008 001f 0000
00007a0 0000 0000 e763 62b5 310b 0008 0020 0000
00007b0 0000 0000 ef64 62b5 300b 0008 0001 0000
00007c0 0000 0000 ec44 62b5 300b 0008 0002 0000
00007d0 0000 0000 f445 62b5 300b 0008 0003 0000
00007e0 0000 0000 fc46 62b5 300b 0008 0004 0000
00007f0 0000 0000 0447 62b5 300b 0008 0005 0000
0000800 0000 0000 0c48 62b5 300b 0008 0006 0000
0000810 0000 0000 1449 62b5 300b 0008 0007 0000
0000820 0000 0000 1c4a 62b5 300b 0028 0008 0000
0000850 0001 ffea 7fa6 62b5 300b 0028 0009 0000
0000880 0034 0001 312f 62b5 300b 0028 000a 0000
00008b0 000f ffff dc57 62b5 300b 0028 000b 0000
00008e0 001b 0002 6f29 62b5 300b 0028 000c 0000
0000910 001b ffd1 0a32 62b5 300b 0028 000d 0000
0000940 000f 0023 5e7a 62b5 300b 0028 000e 0000
0000970 0032 ffe2 4ccb 62b5 300b 0028 000f 0000
00009a0 ffda ffe9 f7a8 62b5 300b 0028 0010 0000
00009d0 ffed 000e 7eba 62b5 300b 0028 0011 0000
0000a00 0004 0005 40f0 62b5 300b 0028 0012 0000
0000a30 0039 ffed 0192 62b5 300b 0028 0013 0000
0000a60 0014 0004 c1c7 62b5 300b 0028 0014 0000
0000a90 001e 000d 676b 62b5 300b 0028 0015 0000
0000ac0 001c 0006 faab 62b5 300b 0028 0016 0000
0000af0 0016 001b 5ac3 62b5 300b 0028 0017 0000
0000b20 0015 0030 03bb 62b5 300b 0028 0018 0000
0000b50 003d 000f 0c1c 62b5 300b 0008 0019 0000
0000b60 0000 0000 ac5c 62b5 300b 0008 001a 0000
0000b70 0000 0000 b45d 62b5 300b 0008 001b 0000
0000b80 0000 0000 bc5e 62b5 300b 0008 001c 0000
0000b90 0000 0000 c45f 62b5 300b 0008 001d 0000
0000ba0 0000 0000 cc60 62b5 300b 0028 001e 0000
0000bd0 002c 000c 0571 62b5 300b 0028 001f 0000
0000c00 0019 fffc 7397 62b5 300b 0028 0020 0000

Happy hacking! :)




More information about the community mailing list