GPS tracing using GTA02 u-blox ATR0635 module*

31
Mar 2011

Mostly an interesting indoor activity which when forced to move outdoors can be kept interesting with GTA02 with many apps one of them is NeronGPS. Besure to cache all the places in the memory so it will be handy for on the spot tracking.

Requirement (tested with)

Application: NeronGPS
Device:    ofcourse GTA02
Phone SW: QtMoko (v24)
Cache: SDcard (It can be configured in the nerongps.conf to point to flash memory)
SDCard that I use is SanDisk SDSDQ-4096-P36M
And a fix

As specified in /etc/fstab the vfat partition is needed for storing the below mentioned data

neo:~# ls /media/card/NeronGPS/
maps  poi  temp  traces

in mmcblk0p1 and mmcblk0p2 for swap one can do away with swap. Even the p1 partition can be done away with if the info is stored in NAND.

To format the SDcard  with GTA02 device in hand, follow the steps below

neo:~# fdisk /dev/mmcblk0
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x7928fdff.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

The number of cylinders for this disk is set to 121008.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes
4 heads, 16 sectors/track, 121008 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x7928fdff

        Device Boot      Start         End      Blocks   Id  System

Command (m for help):


Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)

Partition number (1-4): 1
First cylinder (1-121008, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121008, default 121008): +750M

lll'ly create other partitions to change the partition type use the respective hex code.

Command (m for help): p

Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes
4 heads, 16 sectors/track, 121008 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x7928fdff

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1               1       22889      732440   83  Linux
/dev/mmcblk0p2           22890       54140     1000032   83  Linux
/dev/mmcblk0p3           54141       77029      732448   83  Linux
/dev/mmcblk0p4           77030       92655      500032   83  Linux

Command (m for help):t


Partition number (1-4): 1
Hex code (type L to list codes): l

 0  Empty           1e  Hidden W95 FAT1 80  Old Minix       be  Solaris boot   
 1  FAT12           24  NEC DOS         81  Minix / old Lin bf  Solaris        
 2  XENIX root      39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 5  Extended        41  PPC PReP Boot   85  Linux extended  c7  Syrinx         
 6  FAT16           42  SFS             86  NTFS volume set da  Non-FS data    
 7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
 8  AIX             4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility   
 9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt         
 a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e1  DOS access     
 b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O        
 c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          e4  SpeedStor      
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs        
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  EFI GPT        
10  OPUS            55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor      
14  Hidden FAT16 <3 61  SpeedStor       a9  NetBSD          f4  SpeedStor      
16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary  
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fd  Linux raid auto
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fe  LANstep        
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid ff  BBT            
1c  Hidden W95 FAT3 75  PC/IX          
Hex code (type L to list codes): 6


Command (m for help): p

Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes
4 heads, 16 sectors/track, 121008 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x7928fdff

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1               1       22889      732440    6  FAT16
/dev/mmcblk0p2           22890       54140     1000032   83  Linux
/dev/mmcblk0p3           54141       77029      732448   83  Linux
/dev/mmcblk0p4           77030       92655      500032   83  Linux


Command (m for help): t
Partition number (1-4): 4
Hex code (type L to list codes): 82
Changed system type of partition 4 to 82 (Linux swap / Solaris)

Command (m for help):

Command (m for help): p

Disk /dev/mmcblk0: 3965 MB, 3965190144 bytes
4 heads, 16 sectors/track, 121008 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk identifier: 0x7928fdff

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1               1       22889      732440    6  FAT16
/dev/mmcblk0p2           22890       54140     1000032   83  Linux
/dev/mmcblk0p3           54141       77029      732448   83  Linux
/dev/mmcblk0p4           77030       92655      500032   82  Linux swap / Solaris

Command (m for help):


Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
neo:~#

Now restart the device so that the /dev will be populated with the created partitions. To format it with respective filesystem make use of mkfs for swap use mkswap

ls /dev/mmcblk0
mmcblk0    mmcblk0p1  mmcblk0p2  mmcblk0p3  mmcblk0p4

neo:~# mkfs.vfat -v /dev/mmcblk0p1
mkfs.vfat 3.0.1 (23 Nov 2008)
Auto-selecting FAT32 for large filesystem
/dev/mmcblk0p1 has 4 heads and 16 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 1464880 sectors;
file system has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 1428 sectors, and provides 182749 clusters.
Volume ID is 7acbe0fe, no volume label.
neo:~#

neo:~# mkswap /dev/mmcblk0p4
Setting up swapspace version 1, size = 512028 kB
no label, UUID=49000a28-6fec-453e-91b7-b893be800a38
neo:~#

neo:~# swapon -a

Restart again and you are done.
The map tiles were cached using WLAN and latter on used for referencing.



To upload the traces to openstreetmap or googlemap use the http://www.gpsvisualizer.com/ to convert the gpx file to kml(xml files) and use the import option in the google map and for the openstreetmap use the gpx directly.

Some of the traces that I submitted are mentioned below

Google map and Openstreetmap

[u-30-sep-2011]

This was the longest ever tracing done using GTA02 device. It was doing its assingned work exquisitely. The only preparation was for the backup power that needed to be given for the device and for me the backup was provided by the N148 plus (yep thats a netbook enacting as a charging device). So all along from TVM to CBE, was able to keep the device up and running with the fix all the way to the place - openstreetmap[1] and google.map[2], just that N148 was being drained completely without any other way to replenish its energy requirement. Its good to deactivate the display always on option because it drains the power quickly and I happen to notice that only in the last phase of my journey and it helped to conserve certain amt of energy.
Some of the screenshots are from the return journey (CBE to TVC) which gives a clear picture of how things where in real time.
Usually I really don't give a heck about what all places comes in between my src and dest. I mosly look at the ETA and ETD at src and dest and take respective action i.e to board or deboard the train, but this time it was more exciting for me to watch the places and even trace the places that is being followed. COOL!!!. The only thing was that the cache saved with zoomed tiles(upto 11) so could only see limited places and frankly I wasn't expecting the result as desired even more the "other passenger" who agreed not to kick me out of my place just near the window seat so that I will always have a fix but if I moved it little bit inside of the compartment the fix was lost.
 
[1] http://www.openstreetmap.org/user/gnumen/traces/1110716
[2] http://maps.google.com/

proceed further for more traces in the google.map

The conversion of gpx to kml by http://www.gpsvisualizer.com/ (or) http://gpx2kml.com/ so as to submit it to google map was not happening because only 3M of data can be submitted but openstreet map simply accepted the gpx format. So did the following to reduce the gpx file size, so that gpsvisualizer can do its kml conversion(WTH, its another conversion from one xml format to another xml, this can programmed, will add it my ever increasing TODO list. Obviously accuracy is compromised with this kind of conversion )

gpsbabel -r -i gpx -f 20110929.gpx -x simplify,error=0.0001k -o gpx -F outss.gpx

ranjit@ranjit-laptop:~/gps-test$ ls -lh *
-rw-r--r-- 1 ranjit ranjit 2.6K 2011-10-01 12:45 1317453041-12988-117.213.3.231.kml
-rw-r--r-- 1 ranjit ranjit 676K 2011-10-01 14:34 1317459427-17871-117.199.8.229.kml
-rwxr-xr-x 1 ranjit ranjit 153K 2011-04-24 13:31 20110424_060018.gpx
-rwxr-xr-x 1 ranjit ranjit 4.0M 2011-09-29 18:13 20110929 (copy).gpx
-rwxr-xr-x 1 ranjit ranjit 4.0M 2011-09-29 18:13 20110929.gpx
-rwxr-xr-x 1 ranjit ranjit 407K 2011-10-01 13:07 20110929.gpx.gz
-rw-r--r-- 1 ranjit ranjit  446 2011-10-01 12:25 Google.Maps.Hacks.(2006).chm.torrent
-rw-r--r-- 1 ranjit ranjit 6.6K 2011-10-01 12:52 out.gpx
-rw-r--r-- 1 ranjit ranjit 2.5M 2011-10-01 14:02 outss.gpx
-rw-r--r-- 1 ranjit ranjit  31M 2011-10-01 10:57 sample.kml
ranjit@ranjit-laptop:~/gps-test$

after applying the cmd the file size drastically changes, so can be feed to gpsvisualizer.
 
GTA02 rocks
the journey showed location, samples, duration, speed, altitude, %fix

https://picasaweb.google.com/103271757295857837603/Gta02#5658174061791478930
https://picasaweb.google.com/103271757295857837603/Gta02#5658173998928218578

[/u-30-sep-2011]