Introduction

A few years ago I bought a Garmin eTrex Legend HCx. This article records my experiences with the device including terminology, procedures and Linux compatibility.

Terminology

Procedure: Firmware upgrade

  1. Insert the SD card
  2. Put the device into "USB storage" mode (System->Interface->USB storage)

  3. Attach the device to a Linux box and check of the GPS is seen as a new drive of the correct size.
  4. If it is then the firmware does not need to be upgraded.
  5. Attach the device to a real Windows system (not Wine)
  6. Perform a firmware upgrade.

Procedure: Granting access to the hardware

  1. Attach the device and run:

    lsusb | grep -i garmin 
    and note the vendor and product IDs (these are the four digit numbers on either side of the colon, respectively). In what follows, we'll assume those IDs are '091e' and '0003', respectively.
  2. Edit /etc/modprobe.d/blacklist.conf and if the following line is not already present then add it:

    blacklist garmin_gps 
  3. Edit /etc/udev/rules.d/51-garmin.rules to contain the following:

    SYSFS{idVendor}=="091e", SYSFS{idProduct}=="0003", GROUP:="plugdev", MODE:="660" 
  4. If you are not already in the 'plugdev' group, then edit /etc/group and add youself to it.
  5. Reboot (or log out and in again to have your login processes added to the supplementary groups and run:

    udevadm control --reload-rules 
    but honestly, it's easier just to reboot.)

Procedure: Installing MapSource

  1. Insert "Trip & Waypoint Manager" CD-ROM or mount its ISO image.

  2. Attach the GPS and put it in USB storage mode; wait until Linux has automatically mounted the device and you can browse it in a file browser.
  3. Run:

    winecfg 
    and set:
    1. the Windows version to 'Windows XP'
    2. the drive type to 'floppy' (failure to do this will result in the Wine seeing the drive, but MapSource software not seeing it when run on newer versions of Wine!) as illustrated here:

  4. Run:

    cd <mountpoint-of-cd-or-iso-image>
    wine Setup 
  5. At the "Trip & Waypoint Manager" window, click "Install Trip & Waypoint Manager". If the following error message appears:

    torchio$ wine Setup
    err:msi:copy_package_to_temp failed to copy package L"TWPT_ENU.msi"
    fixme:msi:MSI_OpenDatabaseW open failed r = 80030002 for L"TWPT_ENU.msi" 

    or

    wine: cannot find L"D:\\Setup.exe"

    then just exit and rerun:

    wine Setup 
  6. At the "Trip and Waypoint Manager v4 Setup" window, when prompted "Welcome ...", click "Next".
  7. At the "Trip and Waypoint Manager v4 License Agreement" window, when prompted "SOFTWARE LICENSE AGREEMENT", tick the "I accept the Software License Agreenent" checkbox, and click "Next".
  8. At the "Trip and Waypoint Manager v4 Setup" window, when prompted "Installing to the default location ...", set the installation directory to C:\Garmin (under Debian squeeze I found that drive C: could not be seen despite it having been correctly set up by winecfg earlier and I had to set the installation directory to it explicitly ... twice!) (Failure to set it to C:\Garmin will cause a lot of registry-based problems later) and click "Install".
  9. At the "Trip and Waypoint Manager v4 Setup" window, when prompted "Garmin Trip and Waypoint Manager v4 is successfully installed ...", click "Finish".
  10. At the "Trip & Waypoint Manager" window, when prompted "... Get Adobe Reader ...", move cursor back into the terminal window from where you launched wine and press CTRL-C.

  11. Under Debian squeeze, I found that the MapSource software was installed in ~/Garmin (which Wine called H:\Garmin) and the Trip and Waypoint Manager software (i.e. the basemap) was installed in ~/.wine/drive_c/Garmin (which Wine called C:\Garmin), despite the fact that I specified everything to be installed in C:\Garmin. To correct this I ran:

    mv ~/Garmin/* ~/.wine/drive_c/Garmin
    rmdir ~/Garmin 

    (MapSource.exe seemed to be able to find all its other components without problems after this move.)

  12. If you want to set up your window manager's or panel's menus to run MapSource then the command to run is:

    sh -c 'wine ~/.wine/drive_c/Garmin/MapSource' 

    and here is a little icon to use:

Procedure: Installing maps from http://openstreetmap.org packaged by Lambertus

  1. Ensure MapSource is not running.

  2. Visit http://garmin.na1400.info/routable.php and follow the instructions there.

  3. Continue only once you have the following files:
    • osm_routable_mapsource.exe
  4. Run:

    wine osm_routable_mapsource.exe 
  5. Start MapSource and verify that the new map appears in the pull-down menu of maps.

Procedure: Installing maps from other sources

  1. Different maps need to be installed in different ways.
  2. Regedit may be needed to load .reg files.
  3. If regedit refuses to load a .reg file by running:

    regedit <filename> 

    then it may be necessary to change the first line of .reg files from:

    ��Windows Registry Editor Version 5.00 

    to

    REGEDIT4 

    or to convert from Unicode to ASCII by cat-ing the file and then using the mouse to copy it and paste it into a new file or by running:

    iconv -f UNICODE -t ANSI_X3.4 <old-reg-file> -o <new-reg-file> 
  4. Unlock the maps from within MapSource.

Procedure: Pushing maps to the GPS

This procedure covers selecting which maps should go on the GPS, merging those maps into one file, transferring them to the GPS. It does not cover transferring waypoints, routes and tracks.

  1. Power on the GPS, connect it to the computer, and put the GPS in "USB storage" mode.
  2. Make sure the device is now mounted and browsable with your file browser.
  3. Run MapSource.

  4. Select the map tool (either from the 'Tools' menu or from the toolbar).
  5. Switch to a product (either from the 'View' menu or from the toolbar).
  6. Use the mouse to select from the grid of maps those maps you wish to download to the GPS.
  7. Repeat the last two steps for other products (e.g. to select south-east England and London).

  8. From MapSource's 'Transfer' menu, select 'Send to device ...'; the device should be listed (e.g. as D:\); click 'Send'; if it is not listed then run:

    winecfg 
    and make sure that the drive type is set to 'floppy'.
  9. Wait. (The merging of maps and the subsequent download are quite slow; the fewer map segments you select the faster it will be.)

Procedure: Pushing waypoints and routes to the GPS

  1. Power on the GPS, connect it to to the computer, make sure it is not in "USB storage" mode (and therefore not mounted).

  2. Run:

    gpsbabel -r -i gpx -f <gpx-file-containing-routes>.gpx -o garmin -F usb:
    gpsbabel -w -i gpx -f <gpx-file-containing-waypoints>.gpx -o garmin -F usb: 
  3. If this does not work then repeat as root.

Procedure: Pulling tracks from the GPS

  1. On the GPS, save any tracks (ideally, do this on the same day you made the track, then it will be named after that date).
  2. Put the GPS in USB mass storage mode, mount the device and copy over the GPX files (don't use gpsbabel to retrieve the tracks as, for some reason, the track will only contain 500 track points) and then unmount the device.
  3. Load each file into MapSource and delete any 1- or 2-point tracks (such as are created if the GPS starts recording tracks before it has acquired satellites).

  4. If any of the tracks have odd points in them (such as are created if the GPS starts recording tracks before it has acquired satellites) then right-click on the track, select 'Properties' and try to work out which point needs deleting, and then edit the GPX file and reload it).
  5. Run the command:

    gpsbabel  -i gpx -f inputfile1.gpx -f inputfile2.gpx -f inputfile3.gpx ... -x track,merge -o gpx -F mergedfile.gpx 

    Bash's {X..Y} syntax means you may be able to use something like this:

    gpsbabel -i gpx "-f donau-track-"{20110613..20110621}.gpx -x track,merge -o gpx -F mergedfile.gpx 
  6. Some sites restrict the size of GPX uploads so it may be necessary to run something like this:

    gpsbabel -i gpx -f mergedfile.gpx -x simplify,count=2000 -o gpx -F simplifiedfile.gpx 
  7. If you merge tracks or perform other operations using gpsbabel and try to load the resulting files into MapSource then you may encounter:



    then run:

    perl -0777 -pi -e 's@(?<=<trkseg>\n)<extensions>.*?</extensions>\n@@ms' file-1.gpx file-2.gpx ... 

    which will delete any <extensions> sections which are inside any <trkseg> sections. There is no need to delete <extensions> sections which are inside <trk> sections but not inside deeper <trkseg> sections.

What they didn't tell you

Review

Overall, I am extremely happy with this device and would recommend it to any cyclist, mountain hiker or city walker.

It does everything I need (I want to plan on- and off-road routes for cycling, off-road routes for hiking, get GPX data for my tracks, and use it when I get lost in a foreign city), it works reasonably well with Linux using Wine and gpsbabel, the display is bright and easy to read, a couple of its screens can be configured to display the information you prefer (e.g. on one screen I have a large compass/heading-arrow and current time and on another display I have time to next waypoint, distance to next waypoint, time to destination, distance to destination, current time, current speed, ...).

One bad point is that, if this is to be your first GPS, then the documentation is woefully inadequate!

One feature i miss, and I suspect this is something not available on any GPS, is a panel indicating the heading after the next way point; I can see what heading I should be on up until the next route point, but I cannot see what my heading should be after that. Yes, I can look at the map screen but, generally I'm looking at the configurable screens (to see speed, distance covered, current time, etc).

Andy Allan wrote a good review, which is at http://www.gravitystorm.co.uk/shine/gps-recommendations/.

See also

CategoryArticle

UsingEtrexWithLinux (last edited 2011-06-26 15:02:41 by AlexisHuxley)