July 13, 2023

Garmin 66i, USB, and Linux - 2023

September 19, 2023

Hopefully I know enough now to reduce this to a simple procedure: For instructions on how to deal with the fit file, see this:

September 14, 2023

This is always a guessing game. I just got the thing to show up as /dev/sde1. Here is what seemed to work: One USB recognizes it, two icons appear on my desktop.
One is a 32G device (which is my removable SD card) -- this is not what I want.
The other is "GARMIN". This is where the GPX files and such are. Everything is in the "Garmin" directory. Look in the Activities directory for the ".fit" files and in the GPX directory for waypoints.

July 13, 2023

I just returned from a hike. I saved the "track" and now would like to connect up a USB cable and copy the file from the Garmin to my linux desktop.

I power up the Garmin, let it fully boot, then using a cable plug it into my linux machine.

The Garmin beeps and displays a USB logo on the screen. My linux logs show the following:

Jul 13 11:15:40 trona kernel: usb 1-2: new high-speed USB device number 2 using xhci_hcd
Jul 13 11:15:40 trona kernel: usb 1-2: Device not responding to setup address.
Jul 13 11:15:50 trona kernel: xhci_hcd 0000:03:00.0: Abort failed to stop command ring: -110
Jul 13 11:15:50 trona kernel: xhci_hcd 0000:03:00.0: Host halt failed, -110
So the Garmin is very ill behaved on the USB bus. What is amusing is that it used to work just fine and present itself as a mass storage device -- exactly what a person would want and expect.

Problems with Garmin

Two things aggravate this whole business. One is that you just never know when software updates get pushed to your device. If you have your smart phone set up running the Garmin software and your put your phone and the Garmin in your pack, they may decide to talk to each other and install a software update with no participation on your part. Is this good? It is in the sense that you don't have to do anything. It is bad in the sense that you just never know when new bugs and behaviors are going to show up. Garmin doesn't have a terrific record for bug free updates.

The second problem is a "cloud" mindset. They seem to expect you to bounce anything like a GPS track through their cloud based software.

Check the Garmin USB setup

I unplug the cable. The Garmin is now powered off! I power it back on and let it boot up. The game with this power off seems to be that the unit thinks that once you plug in a USB cable you want to power it without using the internal battery, and by default when you unplug it, it does not return to battery use.

I go to "main menu" and select "Setup". Under "System" you can find "Interface". This is set to MTP. There are no other selections that offer anything like USB mass storage, only things like NMEA serial.

Two ideas

One is to try plugging the unit in without first powering it on.
The other is to try changing the setting to NMEA serial and see what happens
The other is to try different cables
What I did was to try a different USB port on my linux machine, and I got:
Jul 13 11:44:16 trona kernel: usb 4-1.2: new high-speed USB device number 3 using ehci-pci
Jul 13 11:44:17 trona kernel: usb 4-1.2: device not accepting address 3, error -71
Jul 13 11:44:36 trona kernel: usb 4-1.2: new high-speed USB device number 5 using ehci-pci
Jul 13 11:44:36 trona kernel: usb 4-1.2: New USB device found, idVendor=091e, idProduct=4cd4, bcdDevice= 0.01
Jul 13 11:44:36 trona kernel: usb 4-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=5
Jul 13 11:44:36 trona kernel: usb 4-1.2: Product: GPSMAP 66i
Jul 13 11:44:36 trona kernel: usb 4-1.2: Manufacturer: Garmin
Jul 13 11:44:36 trona kernel: usb 4-1.2: SerialNumber: 0000c8502654
Jul 13 11:44:36 trona mtp-probe[83781]: checking bus 4, device 5: "/sys/devices/pci0000:00/0000:00:1a.0/usb4/4-1/4-1.2"
Jul 13 11:44:36 trona mtp-probe[83781]: bus: 4, device: 5 was not an MTP device
Jul 13 11:44:36 trona kernel: usb-storage 4-1.2:1.0: USB Mass Storage device detected
Jul 13 11:44:36 trona kernel: scsi host10: usb-storage 4-1.2:1.0
Jul 13 11:44:36 trona kernel: usbcore: registered new interface driver usb-storage
Jul 13 11:44:36 trona kernel: usbcore: registered new interface driver uas
Jul 13 11:44:36 trona mtp-probe[83792]: checking bus 4, device 5: "/sys/devices/pci0000:00/0000:00:1a.0/usb4/4-1/4-1.2"
Jul 13 11:44:36 trona systemd[1642]: Started dbus-:[email protected].
Jul 13 11:44:36 trona mtp-probe[83792]: bus: 4, device: 5 was not an MTP device
Jul 13 11:44:38 trona kernel: usb 4-1.2: USB disconnect, device number 5
Jul 13 11:44:44 trona kernel: usb 4-1.2: new high-speed USB device number 6 using ehci-pci
Jul 13 11:44:44 trona kernel: usb 4-1.2: New USB device found, idVendor=091e, idProduct=2cd4, bcdDevice= 5.09
Jul 13 11:44:44 trona kernel: usb 4-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=5
Jul 13 11:44:44 trona kernel: usb 4-1.2: SerialNumber: 0000c8502654
Jul 13 11:44:44 trona kernel: usb-storage 4-1.2:1.0: USB Mass Storage device detected
Jul 13 11:44:44 trona kernel: scsi host10: usb-storage 4-1.2:1.0
Jul 13 11:44:44 trona mtp-probe[83819]: checking bus 4, device 6: "/sys/devices/pci0000:00/0000:00:1a.0/usb4/4-1/4-1.2"
Jul 13 11:44:44 trona mtp-probe[83819]: bus: 4, device: 6 was not an MTP device
Jul 13 11:44:44 trona mtp-probe[83821]: checking bus 4, device 6: "/sys/devices/pci0000:00/0000:00:1a.0/usb4/4-1/4-1.2"
Jul 13 11:44:44 trona mtp-probe[83821]: bus: 4, device: 6 was not an MTP device
Jul 13 11:44:44 trona Thunar[83820]: thunar-volman: Unsupported USB device type "usb".
Jul 13 11:44:44 trona Thunar[83828]: thunar-volman: Unsupported USB device type "usb-storage".
Jul 13 11:44:45 trona kernel: scsi 10:0:0:0: Direct-Access     Garmin   GARMIN Flash     1.00 PQ: 0 ANSI: 5
Jul 13 11:44:45 trona kernel: scsi 10:0:0:1: Direct-Access     Garmin   GARMIN Card      1.00 PQ: 0 ANSI: 5
Jul 13 11:44:45 trona kernel: sd 10:0:0:0: Attached scsi generic sg4 type 0
Jul 13 11:44:45 trona kernel: sd 10:0:0:1: Attached scsi generic sg5 type 0
Jul 13 11:44:45 trona kernel: sd 10:0:0:0: Power-on or device reset occurred
Jul 13 11:44:45 trona kernel: sd 10:0:0:0: [sdd] 30351360 512-byte logical blocks: (15.5 GB/14.5 GiB)
Jul 13 11:44:45 trona kernel: sd 10:0:0:0: [sdd] Write Protect is off
Jul 13 11:44:45 trona kernel: sd 10:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jul 13 11:44:45 trona kernel: sd 10:0:0:1: [sde] 62333952 512-byte logical blocks: (31.9 GB/29.7 GiB)
Jul 13 11:44:45 trona kernel: sd 10:0:0:1: [sde] Write Protect is off
Jul 13 11:44:45 trona kernel: sd 10:0:0:1: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Jul 13 11:44:45 trona kernel: sde: sde1
Jul 13 11:44:45 trona kernel: sdd:
Jul 13 11:44:45 trona kernel: sd 10:0:0:1: [sde] Attached SCSI removable disk
Jul 13 11:44:45 trona kernel: sd 10:0:0:0: [sdd] Attached SCSI removable disk
Well! A lot of thrashing around, but we seem to have what we want now. I blame the GPS-66i for faulty USB issues since the USB port I first used has worked just fine with countless other devices.

Get the track

I now see two icons on my linux desktop: GARMIN and 32G volume. I suspect the second (32G volume) is the removable card I installed in my 66i. I click on the first icon, which makes linux mount that device (as /run/media/tom/GARMIN/)
Then I do this:
cd /run/media/tom/GARMIN/Garmin/Activities
ls -l
.....
-rw-r--r-- 1 tom tom  38648 May 18 10:36 '2023-05-18 17.36.33.fit'
-rw-r--r-- 1 tom tom  48980 Jul 12 20:26 '2023-07-13 03.26.05.fit'
cp 2023-07-13\ 03.26.05.fit /home/tom/carrie.fit
I unmount the volume, unplug the USB cable and am left with the file "carrie.fit" on my linux machine.

Dealing with FIT files became a story of its own. You can use gpsbabel to convert to csv or gpx format, but using defaults will not extract all of the available information. I made a project of writing my own program to dump and extract the file.

Another day pulling files off the device

Now I know to plug the cable only into the USB ports at the bottom of my desktop computer. With the 66i turned off, I connect the cable, plug it in, and wait. After maybe 20 seconds, two icons appear on my machine: GARMIN and "32 GB Volume". The first is the 66i itself, the second is the card I installed in the unit. Once I click on them to mount them up, I see:
Filesystem               1K-blocks       Used  Available Use% Mounted on
/dev/sdd                  15160292    8285868    6874424  55% /run/media/tom/GARMIN
/dev/sde1                 31154688    3169280   27985408  11% /run/media/tom/3263-3362
So the 66i itself has about 16G of internal storage that is currently 55 percent used. It is not clear (to me anyway) if the device will switch to storing files on the removable card if the internal storage fills up.
cd /run/media/tom/GARMIN/
cd Garmin
ls
0980305535.gma  Courses        D7753040A.img  Device.fit  fs_image.ver          gmapbmap.img  gmapdem.sum    gmapprom.img  gmaptz.sum  PointCache  Settings     TempFIT
Activities      CustomMaps     D7753040A.unl  EDM         GarminDevice.xml      gmapbmap.sum  gmapdem.unl    gmapprom.sum  GPS         Profiles    Sports       Text
Apps            CustomSymbols  Debug          ExtData     Garmintriangletm.ico  gmapdem.gma   gmapprom1.sum  gmapprom.unl  GPX         RemoteSW    SQL          Vehicle
CIQDevData      D7753040A.gma  Debugging      Filters     GGZ                   gmapdem.img   gmapprom.gma   gmaptz.img    NewFiles    RINEX       startup.txt  WIFI
As near as I can tell, the only things I am really interested in here are the Activities and GPS directories, so ...
mkdir /u1/Projects/Garmin/Files
cd /u1/Projects/Garmin/Files
make pull
At this time, the Makefile is as follows. I could perhaps use rsync, but this is very fast and I don't mind copying over the top of the existing files each time.
pull:
	cp -var /run/media/tom/GARMIN/Garmin/Activities .
	cp -var /run/media/tom/GARMIN/Garmin/GPX .

Have any comments? Questions? Drop me a line!

Tom's backpacking pages / [email protected]