Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] Garmin Etrex and gpsbabel: connection fails  (Read 10969 times)

Offline der_bud

  • User
  • Posts: 1.090
  • member
[EN] Garmin Etrex and gpsbabel: connection fails
« on: 2014/09/28, 13:40:08 »
Hi, does anybody know how to make gpsbabel (or others like viking or qlandkartegt) work together with a Garmin Etrex Vista HCx device? I tried nearly every advice I found for example
here Fixing USB permissions for Garmins in GPSBabel#Debian
or here Debianforum - garmin etrex vista hcx mit qlandkarte verbinden
or here Ubuntuwiki - Garmin eTrex Serie

The module garmin_gps is blacklisted and not loaded, in /etc/udev/rules.d/51-garmin.conf I tried (one after another with rebooting in between) each of the following three lines I found in web
Code: [Select]
#SUBSYSTEMS=="usb", ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", MODE="0666", GROUP="plugdev"                                                                       

#SUBSYSTEM!="usb_device", GOTO="garmin_rules_end" ACTION!="add", GOTO="garmin_rules_end" ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", MODE="0660", GROUP="plugdev" LABEL="garmin_rules_end"                                                                                                                                             

#SYSFS{idVendor}="091e", SYSFS{idProduct}="0003", MODE="0666", GROUP="plugdev"
My user is (beside others) member of the groups lp, dialout plugdev.

Symptoms:
I plug the device into the usb slot of my Thinkpad T60, and switch it on. Journalctl -f shows then:
Code: [Select]
Sep 28 13:03:43 sidtp kernel: usb 1-2: new full-speed USB device number 2 using uhci_hcd
Sep 28 13:03:43 sidtp systemd-udevd[184]: Network interface NamePolicy= disabled on kernel commandline, ignoring.
Sep 28 13:03:43 sidtp kernel: usb 1-2: New USB device found, idVendor=091e, idProduct=0003
Sep 28 13:03:43 sidtp kernel: usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Sep 28 13:03:43 sidtp mtp-probe[2478]: checking bus 1, device 2: "/sys/devices/pci0000:00/0000:00:1d.0/usb1/1-2"
Sep 28 13:03:44 sidtp mtp-probe[2478]: bus: 1, device: 2 was not an MTP device
and
Code: [Select]
lsusb
Bus 001 Device 002: ID 091e:0003 Garmin International GPS (various models)

But when I (no matter if root or user) issue via gui
Code: [Select]
gpsbabel -t -i garmin -f usb: -o gpx -F /home/martin/test.gpx
Claim interfaced failed: could not claim interface 0: Operation not permitted
Error running gpsbabel: Process exited unsucessfully with code 1

More verbose in terminal
Code: [Select]
gpsbabel -D9 -t -i garmin -f usb: -o gpx -F TP.gpx
GPSBabel Version: 1.5.0
TX [12]:00 00 00 00 05 00 00 00 00 00 00 00 ............(SESREQ  )
TX [12]:00 00 00 00 05 00 00 00 00 00 00 00 ............(SESREQ  )
TX [12]:00 00 00 00 05 00 00 00 00 00 00 00 ............(SESREQ  )
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)
RX (intr) [-110]:(CMDDAT  Abort)                                                                                                                                       
RX (intr) [-110]:(CMDDAT  Abort)                                                                                                                                       
Could not start session in a reasonable number of tries.

So the gpsbabel gui as well as viking and qlandkartegt do not upload or download gpx data to/from that Etrex. (If I leave out udev rules and do the same as above with /dev/ttyUSB0 instead of 'usb:' it's the same).

Any ideas?

Code: [Select]
System:    Host: sidtp Kernel: 3.16-3.towo-siduction-amd64 x86_64 (64 bit) Desktop: KDE 4.14.1
           Distro: siduction 13.2.0 December - kde - (201312310241)
Machine:   System: LENOVO product: 2008UGU v: ThinkPad T60
           Mobo: LENOVO model: 2008UGU Bios: LENOVO v: 79ETE7WW (2.27 ) date: 03/21/2011
CPU:       Dual core Intel Core2 T5600 (-MCP-) speed/max: 1000/1833 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] RV515/M52 [Mobility Radeon X1300]
           Display Server: X.Org 1.16.1 drivers: ati,radeon (unloaded: fbdev,vesa) Resolution: 1400x1050@60.02hz
           GLX Renderer: Gallium 0.4 on ATI RV515 GLX Version: 2.1 Mesa 10.2.6
Network:   Card: Qualcomm Atheros AR5418 Wireless Network Adapter [AR5008E 802.11(a)bgn] (PCI-Express)
           driver: ath9k
Drives:    HDD Total Size: 570.1GB (19.0% used) ID-1: model: Samsung_SSD_840
           ID-2: model: SAMSUNG_HM321HI
Info:      Processes: 144 Uptime: 8 min Memory: 443.5/3014.8MB Client: Shell (bash) inxi: 2.2.12
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

Offline michaa7

  • User
  • Posts: 2.396
Re: Garmin Etrex and gpsbabel: connection fails
« Reply #1 on: 2014/09/28, 15:07:04 »
Apart from what you found googeling I found tree other solutions (?):

1)
Quote
I have a different Garmin model that works with this software, and I'm
just guessing: mine has an option in the GPS's own menus to switch the
USB mode between mass storage and something else; I've been using the
first one and it works fine (I can also copy/move the *.gpx files as
with any USB drive)
http://sourceforge.net/p/qlandkartegt/mailman/message/30114930/

2)
Quote
echo "SYSFS{idVendor}==\"091e\", SYSFS{idProduct}==\"0003\", MODE=\"0666\"" | sudo tee /etc/udev/rules.d/51-garmin.rules
http://forum.ubuntuusers.de/topic/garmin-etrex-venture-hc-an-usb-port/

3)
Quote
What I usually do, as I seldom transfer data to/from the GPS, is setting
the USB device permissions manually every time I plug the device. For example:

# lsusb
Bus 005 Device 003: ID 091e:0003 Garmin International GPS (various models)

# dmesg
[ 1621.781686] usb 5-1: USB disconnect, device number 2
[ 1652.160316] usb 5-1: new full-speed USB device number 3 using ohci_hcd

# ls -lrt /dev/bus/usb/005/003
crw-rw-r-- 1 root root 189, 514 Nov 17 22:20 /dev/bus/usb/005/003

As your can see , the USB device doesn't have write permissions for anyone
but the root user and group. Just give your user or anybody write
permissions, and you should be OK:

(I use ACL) # setfacl -m u:username:rw /dev/bus/usb/005/003
# chmod 666 /dev/bus/usb/005/003

Next, if everythign else is right, you should be able to access the Garmin
GPS from QLGT for both download and upload data to it.

http://sourceforge.net/p/qlandkartegt/mailman/message/30114930/

I hope one of these findings *is* a solution.
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline der_bud

  • User
  • Posts: 1.090
  • member
Re: Garmin Etrex and gpsbabel: connection fails
« Reply #2 on: 2014/09/28, 19:12:07 »
Thx for your suggestions.
Re 1): The Etrex has an additional SD-Card that I can access with the method described (used for copying maps). But that does not help in accessing tracks, routes or waypoints in the internal memory.

Re 3): ls -lrt /dev/bus/usb/001/003
     crw-rw-rw- 1 root plugdev 189, 2 Sep 28 18:53 /dev/bus/usb/001/003
My user is member of plugdev, I alway tried to access as user and root, and my example gpsbabel-command is just for reading which should work.

Re 2): That udev rule already was amongst the ones I tries. But now i followed some of the links you gave in 1) and 2), and one lead me to a newer post at qlandkartegt, stating that rule was for pre-3.x kernels while newer need another syntax:
Newer kernels need a similar udev rules file, however with slightly different content.
You should enter:
ATTRS{idVendor}=="091e", ATTRS{idProduct}=="0003", MODE="0660", GROUP="plugdev"

I did that, to no avail. Meanwhile I know that I have no clue about syntax and writing of udev-rules. Searching the web I found the above one as well as one with ATTR (without S). And both versions I've seen with a 'SUBSYSTEM="usb"' or SUBSYTEMS=="usb" at the beginnig of the line. Tried all versions, no success :(
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

Offline michaa7

  • User
  • Posts: 2.396
Re: Garmin Etrex and gpsbabel: connection fails
« Reply #3 on: 2014/09/28, 19:42:47 »
Sorry I coudn't help.

BTW, did you take notice of my last PM, (not re Garmin, but re MB+bücher)?
Ok, you can't code, but you still might be able to write a bug report for Debian's sake

Offline der_bud

  • User
  • Posts: 1.090
  • member
[SOLVED] Garmin Etrex and gpsbabel: connection fails
« Reply #4 on: 2014/10/17, 10:11:26 »
Got it solved during LUG meeting with help of some mates who had that same problem earlier. The culprit was powermanagement settings that are effective when using tools like tlp or laptop-mode-tools. When usb-autosuspend is set, the garmin understands that powermanagement is available and switches of usb power after ~2s.
To solve that, the usb device has to be blacklisted in powermanagement settings, for example

  - with laptop-mode-tools in /etc/laptop-mode/conf.d/usb-autosuspend.conf  (1 ):
Code: [Select]
AUTOSUSPEND_USBID_BLACKLIST="091e:0003"

  - with TLP in /etc/default/tlp.conf (2 ):
Code: [Select]
USB_BLACKLIST="091e:0003"

Worked for me :).
« Last Edit: 2014/10/17, 10:57:55 by der_bud »
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.