Showing posts with label GPS. Show all posts
Showing posts with label GPS. Show all posts

January 04, 2016

Extracting Data from a Holux M-1000C GPS Data Logger using Ubuntu

Photo Credit: Jagro - commons.wikimedia.org
When I'm traveling in the back-country I like to carry a GPS data-logger in a pocket, and forget about it.  The Holux M-1000C (or any of its cousins http://www.dx.com/s/holux+gps+data+logger) just logs GPS coordinates, time, speed, and how many satellites it sees, as often as you want it to.  Every second? Every meter? Whatever resolution you like.  With enough storage capacity to keep 200,000 points before stopping (or overwriting the oldest data) it has enough space to be on all day, every day, for many, many days.  I set it to log a data-point every 10 meters. That's sufficient resolution that I can see on a map where I've been hiking or driving, but not so frequent than you waste space with all the extra data (IMHO).  The down side is, it still needs power.  It has a small lithium-ion battery, like a cell phone, and has enough juice to last ~24 hours.  It means I usually have to charge it in the Suburban every couple of days to make sure it doesn't die.

Once I get back home, I use mtkbabel on Ubuntu to download the coordinates to the computer, and potentially overlay the data in Google Maps.  The problem with that is, I forget the exact syntax every time, and re-learn it a couple of times a year.  So, this blog post is really a way for me to document to myself how to do this next time.

Here is the command to download the data, after it is plugged in with the right USB cable.

user@hostname:~$ mtkbabel -s 38400 -f `date +'%F-%H%M%S'` -t -w -p /dev/ttyACM0
Packet checksum error: expected 0x77, computed 0x5C
MTK Test OK
MTK Firmware: Version: 1, Release: AXN_1.30-B_1.3_C01, Model ID: 005C
Log format: (8000107D) UTC,LATITUDE,LONGITUDE,HEIGHT,SPEED,HEADING,NSAT
Size in bytes of each log record: 27 + (0 * sats_in_view)
Logging TIME interval:       0.00 s
Logging DISTANCE interval:  10.00 m
Logging SPEED limit:         0.00 km/h
Recording method on memory full: (1) OVERLAP
Log status: (000100000010) AUTOLOG_ON,OVERLAP_WHEN_FULL,ENABLE_LOG
Next write address: 1529206 (0x00175576)
Number of records: 58211
Memory health status (failed sectors mask): FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
>> Retrieving 4194304 (0x00400000) bytes of log data from device...
Saved log data:   0.00%
Saved log data:   0.05%
Saved log data:   0.10%
Saved log data:   0.15%
 <.......snip.......>
Saved log data:  37.40%
Saved log data:  37.45%
WARNING: Sector header at offset 0x00180000 is non-written data
Saved log data:  37.50%
Total record count: 58211
user@hostname:~$ 

Here is the command to purge the data logger of data, so you dont download the same data multiple times:

user@hostname:~$ mtkbabel -s 38400 -E -p /dev/ttyACM0
Packet checksum error: expected 0x3C, computed 0x64
MTK Test OK
MTK Firmware: Version: 1, Release: AXN_1.30-B_1.3_C01, Model ID: 005C
>> Erasing log memory...
Log format: (8000107D) UTC,LATITUDE,LONGITUDE,HEIGHT,SPEED,HEADING,NSAT
Size in bytes of each log record: 27 + (0 * sats_in_view)
Logging TIME interval:       0.00 s
Logging DISTANCE interval:  10.00 m
Logging SPEED limit:         0.00 km/h
Recording method on memory full: (1) OVERLAP
Log status: (000100000000) AUTOLOG_OFF,OVERLAP_WHEN_FULL,ENABLE_LOG
Next write address: 512 (0x00000200)
Number of records: 0
Memory health status (failed sectors mask): FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
user@hostname:~$ 

Here is the man page (the manual) for the command I'm using:

NAME

mtkbabel − Tool for managing GPS data loggers based on the MTK chip

SYNOPSIS

mtkbabel [−abcdEfhilmopRrstvw]

DESCRIPTION

mtkbabel is a command line program to operate GPS data loggers based on the MediaTek MTK chip. It was tested on the i-Blue 747 and on the Holux M-241, it should work also with other GPS devices based on the same chip.

The main features are: 
- Command line interface 
- Save data log in GPX and raw binary format 
- If required retrieve all the data, also the old one being overlapped 
- Change logging criteria: time, distance, speed 
- Change log format 
- START/STOP logging 
- Set OVERLAP or STOP method on memory full 
- Erase the internal memory

USAGE

In order to use mtkbabel, please follow these instructions:

1. Attach the GPS data logger device to your computer via USB.

2. Now you have to switch the GPS device (at least the i-Blue 747) into LOG or NAV mode, otherwise the device will not be powered on, and no connection will be possible. Beware that in NAV mode the device goes into sleep mode if not connected to any Bluetooth device.

3. In order to use mtkbabel you have to either be root (not recommended) and/or you must have read/write permissions for the USB device file, usually /dev/ttyUSB0. This device usually has permissions ’crw-rw---- 1 root dialout’, so you can either add your user to the dialout group (in this example) by doing

$ adduser USERNAME dialout

or (not recommended) make the device world-readable/-writable by doing:

$ chmod 666 /dev/ttyUSB0

Another option is to write a udev rules file to change the owner and permissions of /dev/ttyUSB0 according to your requirements.

4. You can now run mtkbabel. For example, if you want to download the track log and the list of waypoints you captured on the device, run:

$ mtkbabel -s 115200 -l off -f foo -w -t

The default speed of 115200 baud should work in most cases and you can omit it, for the Holux M-241 you must use 38400 instead. This will turn off the autolog function, which is always turned on when you switch on the device. The track log will be in the file foo_trk.gpx, the waypoints in the file foo_wpt.gpx (both in GPX format). The file foo.bin will contain the binary log file. Downloading the data from the GPS device can take several minutes, depending on how much data has to be transferred.

In order to delete all data from the GPS device, run:

$ mtkbabel -s 115200 -E

OPTIONS

−a

Read all the log memory (overlapped data).

−b filename.bin

Do not read data from a GPS device, but rather read a previously saved .bin file. Ignore −f option.

−c

Create a GPX file with both tracks and waypoints.

−d debug_level

Debug level: 0..7.

−E

Erase data log memory.

−f

Base name for saved files (.bin and .gpx). If you, for example, use -f gpslog, mtkbabel will create files which are called gpslog.gpx, gpslog_trk.gpx, gpslog_wpt.gpx and gpslog.bin.

−h

Show a help text and exit.

−i

Ignore some error conditions and try to extract as much data as possible from GPS.

−l {on|off}

Turn logging ON/OFF.

−m {stop|overlap}

Set STOP/OVERLAP recording method on memory full.

−o log_format

Enable or disable log fields (FIELD1,−FIELD2,...), available fields: UTC, VALID, LATITUDE, LONGITUDE, HEIGHT, SPEED, HEADING, DSTA, DAGE, PDOP, HDOP, VDOP, NSAT, SID, ELEVATION, AZIMUTH, SNR, RCR, MILLISECOND, DISTANCE.

−p port

Communication port, default: /dev/ttyUSB0.

−R

Recover from disabled log: erase data and reset recording criteria.

−r time:distance:speed

Set logging criteria (zero to disable): every 1-999 seconds, every 10-9999 meters, over 10-999 km/h.

−s speed

Serial port speed, default 115200 baud.

−t

Create a GPX file with tracks.

−v

Show version information and exit.

−w

Create a GPX file with waypoints.

BUGS

Please report any bugs to Niccolo Rigacci <niccolo [AT] rigacci.org>.

LICENCE

mtkbabel is covered by the GNU General Public License (GPL), version 2 or later.

AUTHORS

Niccolo Rigacci <niccolo [AT] rigacci.org>

This manual page was written by Uwe Hermann <uwe [AT] hermann-uwe.de>. It is licensed under the terms of the GNU GPL (version 2 or later).

 ( copied from http://man.cx/mtkbabel(1) )

Here is the manufacturer's web site:
http://www.holux.com/JCore/en/products/products_content.jsp?pno=351

By the way... I bought the Holux M-1000C in 2011.

March 14, 2015

Old GPSes just keep on truckin'

Trimble Transpak II (c) 1993 P/N 19437-60 
I picked up a Trimble Transpak II and a Trimble Pathfinder a while back on eBay, and never did get around to sorting them out and getting them mounted in the Suburban.  I think it's time I took a stab at that again.  Maybe I should back up and explain how I got here.

First, the specifications:

Trimble Transpak II
Copyright 1993
v4.20 Firmware
6 L1 band (1575.42 MHz) receiver 
External Serial Data Port
Internal Antenna / External Antenna Port
9-32VDC 5W Power
P/N: 19437-60
Trimble Pathfinder Basic
Copyright 1990
v3.14 Firmware
6 L1 band (1575.42 MHz) receiver
External Serial Data Port
Internal Antenna / External Antenna Port
9-32VDC 5W Power
P/N: 14992-60


How many GPSes does a guy need?

It seems like all electronic communication or internet-ready devices are coming with built in GPSes these days.  On my last trip I had an iPad, a Playbook, a Blackberry, a Holux M-1000 data logger, and a Garmin dash-mounted GPS... all with built in GPS functionality. So why do I need another?  Well, maybe I don't, but I discovered most of the devices quickly lost functionality when I was out of cell/data range, and these old GPSes never had such a crutch.  They also dont have maps in them to get out of date, which is great - but navigating the roads with them isn't very handy.  What they are really good at is telling you when you're getting close to a pre-designated waypoint, OR tell you where you are within 10 feet.  Yes, these devices from the early 1990s, when the Seattle Grunge scene was at the top of the charts, and the first Iraq war, perform better now than when they initially hit the streets.  Why?  Well, at the time the US military, who control the GPS satellite constellation, were "fuzzing" the signal with a technique called Selective Availability; so it would wander and not be very accurate. They stopped doing so on May 2, 2000 - supposedly permanently.  These units are ruggedized, and look like they could be thrown out of a moving tank in the desert and keep on working. I'm not sure how waterproof they are, but they are at least water resistant.

For power, they take a lead acid rechargeable battery pack, 8 AA batteries (AA battery pack shown in the pictures above), or car-cigarette adapter for 12V power; but interestingly will take anywhere from 9-32V.  So, you can power these things off a 24V NATO power source, a 12V civilian vehicle, or... I don't know what would put out 32VDC..?

Another funny quirk came up; Y2K and planned obsolescence.  Both of these Trimble receivers are on the list on non-Y2K compliant devices, so why didn't they explode on January 1st 2000?  Evidently the GPS signal has at least three parts to it (I'm sure there are more than 3 but I haven't looked up the standard, if it's even published in sufficient detail) The coordinates are independent of time or date; they continue to be accurate down to 0.1 arc seconds (10 feet according to Brooke Clarke's web site - Thank you Brooke!) and I haven't noticed any issue with coordinate precision.  Then there's the time, which is accurate to the second, as far as I can tell.  However, the date is way off - I'm not sure when Trimble expected these units to last for in the field, but 2015 wasn't planned for.  On March 12th 2015 the date read July 27th 1995.  If anyone can explain this I'd really like to hear it.  I presume there's some math involved that can explain it and the date chosen isn't random.

So, why again?

Well, provided I can hard wire the power to it in the Suburban, and mount it in a tidy fashion on the dash, it will function as an interesting talking point, an excellent timepiece, and a backup GPS that will surely never fail.  It's lasted this long, it'll last through the apocalypse.

August 04, 2011

Buying the right GPS

It's been easily ten years since I bought my last GPS. The last time I bought a GPS, it was a handheld for route tracking, so I could overlay it on a topographic map and "see" where I'd been when I returned from wherever I was. At the time I didn't know much about the operation of a GPS, or what features I should be looking for. I do remember I was fleeced by the manufacturer by needing to buy proprietary cables and proprietary software to synchronize it to my computer, and remember vowing never to do that again.

This time my requirements are different. I'm going to assume that in my travels I have a laptop or other portable device to do the "heavy lifting", regarding holding the maps and showing the route or if I need to see an "overhead" view, so a handheld GPS with a screen wasn't needed. I opted for Bluetooth over USB for connectivity, to get rid of cord clutter in the car, as well as allow multiple devices to use the same GPS coordinates.

Those features alone didn't narrow down the list very much, so I started to look into the rest of the techno-babble the marketing teams were pumping out. The number of paralell channels kept coming up, and seemed rather amusing; there are ~31 GPS satellites orbiting the earth, so why would you need to track 66 of them, and use it as a selling feature? Well... according to the manufacturer, those 66 channels can always be coming "in" or "out" of sync with satellites as you move around, so while you'll never see more than (say) 10 birds overhead at the same time, it will always be acquiring the next one, and have spare channels to do it with.

That still didn't limit the number of GPSes I was choosing from, but I started to see trends regarding the number of channels, they seemed grouped into 12, 20, 32, 44 and 66 channel models. But why? Well, I discovered the "brains" of the GPS is a chipset, there are few companies in the world that make different chipsets, so the major brands all use the same handful of chips, repackaging them in their own branded fancy GPS units. You'll frequently see the SiRF and MediaTek (MTK) chipsets mentioned, but even those major vendors are always innovating and coming out with more recent chipsets with better features. So which one to choose? Guessing that the latest chipset would use the lowest power, have the most features, and after comparing specifications to make sure the latest chipset wasn't 'trimmed down', I picked the MTK MT3329 chipset. It was the most recently released chip, and seemed to have the best features (on paper.)

Going with that, I had a much smaller pool of GPS units to choose from, and the Holux M-1000C seemed to be the best price with the most features.


It should be here within a week, and after my next trip I'll need to post a proper review of how it actually performs on the road and in the bush.

-Stef