# Connecting Garmin GPS via serial (gpsman)?



## forkandwait (Nov 23, 2013)

Hi all,

I would like to run gpsman to connect to my new Garmin Etrex20. Conventionally, gpsman would like to connect to /dev/cua, but modern GPS's plug via USB ports. I am not sure where to even start with this -- I have no experience working with serial ports or doing anything with USB ports besides just automagically running my mouse or keyboard or whatever. Could someone point me in the right direction?  I would like to know what to replace /dev/cua with in the configuration to begin with, I guess.

Thanks!


----------



## wblock@ (Nov 23, 2013)

Real serial devices show up on /dev/cuau0, while serial to USB converters show up as /dev/cuaU0.  A Garmin car GPS unit here switches mode when connected to USB and just shows up as a storage device, but that's likely different from the hiking units.

So the first step is to plug it in and see what device entries are created.


----------



## forkandwait (Nov 24, 2013)

On the Linux forums, they require a special Garmin driver, if that is interesting.  I think it might not be worth trying to get it working very long, but if anyone has ideas, I am interested:

When I plug in, it creates /dev/da0 (mountable as an msdos filesystem) and /dev/da1 (not mountable as a simple msdos filesystem).  

Here is the dmesg output right after I plug in:

```
usb_alloc_device: set address 3 failed (USB_ERR_STALLED, ignored)
usbd_setup_device_desc: getting device descriptor at addr 3 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_STALLED, ignored)
usbd_setup_device_desc: getting device descriptor at addr 3 failed, USB_ERR_STALLED
usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_STALLED, ignored)
usbd_setup_device_desc: getting device descriptor at addr 3 failed, USB_ERR_STALLED
ugen0.3: <Unknown> at usbus0 (disconnected)
uhub_reattach_port: could not allocate new device
ugen0.3: <vendor 0x091e> at usbus0
umass0: <vendor 0x091e product 0x2519, class 0/0, rev 1.10/5.09, addr 3> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x4000
umass0:4:0:-1: Attached to scbus4
da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
da0: <Garmin GARMIN Flash 1.00> Removable Direct Access SCSI-5 device 
da0: 1.000MB/s transfers
da0: 1908MB (3907584 512 byte sectors: 255H 63S/T 243C)
da1 at umass-sim0 bus 0 scbus4 target 0 lun 1
da1: <Garmin GARMIN Card 1.00> Removable Direct Access SCSI-5 device 
da1: 1.000MB/s transfers
da1: Attempt to query device size failed: NOT READY, Medium not present
```


----------



## kpa (Nov 24, 2013)

That's very common with any USB device that is a 3G modem or anything similar, in this case a serial port. When the device is first plugged in it shows up as a mass storage device that contains the windows drivers for the device. After the drivers are installed that device switches to its true operating mode because the drivers can do the special mode change operation on the device. On FreeBSD that special operation is supported on some devices, see usb_quirk(4) and the example in it. You'll need to experiment with usbconfig(8) and the quirks listed in usb_quirk(4), it may be that the device starts working as a normal serial port after finding the right quirk. If not, post the details of the device on the freebsd-usb mailing list and a developer may be able to assist you.


----------

