Unable to Connect to Garmin eTrex Using Usb to Serial

Bug #666633 reported by Ian Barton
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
linux-kernel-headers (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: gpsbabel

I am not sure exactly where this bug is located. Here is a summary of the problem:

I am trying to connect mu Garmin eTrex via a usb to serial connector and download tracks. The usb to serial uses a well known chip set and is corrected detected:

Oct 22 07:44:16 scamper kernel: [ 1068.953367] usb 5-1: pl2303 converter now attached to ttyUSB0
Oct 22 07:48:57 scamper kernel: [ 1350.542746] usb 5-1: USB disconnect, address 7
Oct 22 07:48:57 scamper kernel: [ 1350.543003] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
Oct 22 07:48:57 scamper kernel: [ 1350.543038] pl2303 5-1:1.0: device disconnected
Oct 22 07:49:31 scamper kernel: [ 1384.472677] usb 5-1: new full speed USB device using uhci_hcd and address 8
Oct 22 07:49:31 scamper kernel: [ 1384.633321] pl2303 5-1:1.0: pl2303 converter detected
Oct 22 07:49:31 scamper kernel: [ 1384.646366] usb 5-1: pl2303 converter now attached to ttyUSB0

Now I try to download the waypoints using gpsbabel:

sudo gpsbabel -i garmin -f /dev/ttyUSB0 -o gpx -F waypoints.gpx

This doesn't return any errors, but just hangs waiting for data until I hit ctlr-C. I have tried setting the interface on the Garmin to "Garmin" and "NMEA". I have also tried using gpsd, but still not managed to connect to the eTrex.. I have also tried connecting using gpsd with the same results.

Now if I try on the same computer running Maverick using Windows XP running under Virtual Box, I can connect to the eTrex. If I install Lucid on the computer, I can connect to the eTrex with no problem. I get similar results on another computer runing Maverick. So this seems to point to a problem with the usb to serial driver, or the kernel.

Ian.

Revision history for this message
Ian Barton (ian-manor-farm) wrote :

I don't think that this is a gpsbabel bug. Versions of gpsbabel that shipped with Lucid show the same bug. Unfortunately, syslog and messages don't provide any information. I suspect that it is either a bug in the usb to serial driver or the kernel. If anyone can tell me how I can provide more debug information, I'll happily do it.

Note changed package to linux-kernel-headers as there doesn't seem to be a pacakge I can find either for the kernel of kernel drivers.

affects: gpsbabel (Ubuntu) → linux-kernel-headers (Ubuntu)
Revision history for this message
Rob Walker (rob-tenfoot) wrote :

I've just run into the same issue since upgrading to maverick and I've got a
workaround - run the following command before gpsbabel:

  stty -F /dev/ttyUSB0 clocal

strace showed me that it was stuck in the open() call on /dev/ttyUSB0 and I
could reproduce the same behaviour with python, so it's not just a gpsbabel
issue - This hangs in the same way:

  python -c 'print open("/dev/ttyUSB0", "rw")'

googling around for "serial usb open hangs" gave me the following page:

http://forum.nginx.org/read.php?30,135400,135554

Taking the hint from Alan Cox about carrier detect, I disabled it with:

  stty -F /dev/ttyUSB0 clocal

And gpsbabel started working again! Should gpsbabel be setting this via
termios ?

I'm using a DIY cable, so have only got RX, TX and GND connected - I haven't
tied off DCD, DTR, RTS, CTS etc. Maybe something in the kernel got a bit
stricter about the defaults for flow control... (although I still see the
problem if I install the 2.6.32 kernel from lucid, so maybe its somewhere else)

Revision history for this message
Ian Barton (ian-manor-farm) wrote :

I can confirm that python can't open the port and that disabling carrier detect allows python to open the port. However, gpsbabel still has problems:

gpsbabel -w -i garmin -f /dev/ttyUSB0 -x track,start=20101120000001 -o gpx -F /home/ian/Private/Dropbox/gps_tracks/test_waypoints.gpx
[ERROR] GPS_Packet_Read: Timeout. No data received.
GARMIN:Can't init /dev/ttyUSB0

Error running gpsbabel: Process exited unsucessfully with code 1

Revision history for this message
Ian Barton (ian-manor-farm) wrote :

The latest round of updates seems to have fixed the problem. I can now download stuff from my eTrex.

Revision history for this message
AnGus (ozsolarwind) wrote :

Just upgraded to Ubuntu 11.04 and encountered the same problem, however,

  stty -F /dev/ttyUSB0 clocal

fixed it for me

Revision history for this message
hannesvr (hannesvanroosbroeck) wrote :

Using Ubuntu 11.04 (2.6.38-9-generic-pae) with Garmin Etrex H and serial to usb cable from kawamall.

  stty -F /dev/ttyUSB0 clocal

fixed it for me

Revision history for this message
ppellet (ppellet) wrote :

Using Ubuntu 11.10 with Garmin Etrex Legend and serial to usb cable.

     stty -F /dev/ttyUSB0 clocal

fixed it for me.

Now, I can use: GPSman v.6.4.1 and QGis v.1.4.0 'Enceladus'.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.