.. title: eTrex 30, QLandkarteGT and Geocaching on GNU/Linux
.. date: 2015-02-23 16:57
.. tags: gps, garmin
.. slug: geocaches-on-etrex30
.. type: text

End of last year my trusty old Garmin eTrex Vista HCx 
landed hard on the asphalt once and failed to recognize any GPS
satellites afterwards.

.. image:: /images/etrex-hcx.jpg
   :alt: eTrex Vista HCx
   :align: center
   :name: eTrex Vista HCx

Searching relevant newsgroups it turned out that the exact failure
mode was observed by other people also already [#forum]_:
   
* No GPS reception
* Information screen shows GPS firmware as "0.0"
* Update of device firmware fails after 13%

.. teaser_end
  
On closer inspection it turned out that my device also suffered from
the same problem described in the forum, namely a small SMD part
("SO23") that disconnected from the main board.  After a failed
attempt with a heatgun I accepted the fact that I'll have to get a
replacement GPS device.

In the past I learned to like the Garmin device as it can use up to
date `OpenStreetMap data
<http://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/Download>`_.  As
far as I understand this is the result of serious reverse engineering
and nothing that Garmin officially supported, but it is one of the
most important criteria for selecting a standalone device for me.
With the high precision of the receiver and the usually low TTFF (time
to first fix) the device fulfills its job to my absolute satisfaction.
As a bonus, the device runs comfortably from AA rechargeable batteries
thath can be easily replaced.  This is a big plus for cycling and
hiking tours.

Another quick web search showed that the original Vista HCx is not on
sale anymore but has been replaced with the comparable eTrex 30 unit:

.. image:: /images/etrex-30.jpg
   :alt: eTrex 30
   :align: center

As the device seemed to be an easy drop-in replacement, I picked one
up on the way to our next hiking tour and indeed swapping in the old
µSD from my old device was enough to restore the functionality of my
beloved `"Radkarte" by Johannes Formann
<http://www.formann.de/radkarte/>`_.

So life was good until we decided to attempt our next caches on the
next walk.  The old eTrex comfortably talked to `QLandkarteGT
<http://www.qlandkarte.org/>`_ with the proprietary Garmin protocol
even on GNU/Linux and I expected this to work also for the new unit.
Unfortunately this turned out not to be the case and I had to look
closer to solve my new problem.

The eTrex Vista HCx and the eTrex 30 devices can be switched between a
proprietary Garmin and the standard USB mass storage protocol.  Using
the upload/download feature of QLandkarteGT needs the Garmin protocol
so I selected this in the device.  With this, the internal
QLandkarteGT Garmin driver (not the kernel ``garmin_gps`` driver that
is usually blacklisted) talks happily to the Vista HCx but fails to
discover the eTrex 30 using the ``whatGarmin`` device selection:

.. image:: /images/etrex30-error.png
   :alt: QLandkarte GT error
   :align: center

Again this turned out to be a known problem [#forum30]_ and it seems
that the Garmin drivers for QLandkarteGT have stalled in development.
It may be that the USB mass storage mode is considered "good enough"
to not bother in reverse engineering the proprietary protocol anymore.

Ok, so my usual workflow of opening the "LOC waypoint file" from
geocaching.com in QLandkarteGT and downloading it to the device does
not work anymore.  The forum posts indicated that through the USB mass
stroage protocol it should be enough to place GPS data into the
``garmin/GPX/`` folder on the SD card of the device.  It turned out
however that this does not work for the ``.loc`` files that can be
downloaded from the free geocaching account.  The Garmin device needs
a "GPX" file.  So what exactly is the difference and how can I convert
it?

Some trial and error shows that QLandkarteGT can export its geodata as
a ``.gpx`` file and automatically uses the correct XML schema for this
file extension.  So this leads to the following workflow:

#. Download .loc files from geocaching.com
#. Import them into QLandkarteGT by "add geodata"
#. Repeat previous items for all geocaches
#. Export all caches in one go to ``gc.gpx``
#. Copy this file to ``garmin/GPX/`` on the sd card

I'm sure that one can also use ``gpsbabel`` for the conversion step,
but this is left as an excercise for the reader.

.. [#forum] https://forum.geoclub.de/viewtopic.php?f=7&t=56098&start=20
.. [#forum30] http://forum.ubuntuusers.de/topic/qlandkartegt-und-garmin-etrex30/
