I am trying to access a Garmin Nuvi 270 from a Raspberry Pi. From my limited experience I can not figure out what I should use as the input device. I have had success with an MTK based GPS logger using /dev/ttyACM0 as the input.

When I plug the Garmin in, I do not see a new tty device. I see a sda & sdb device but have not been able to access them as drives since they do not have partitions. I have also seen a bsg device. I am not sure what that is. I have looked around the Garmin settings and did not see anything about USB mode settings.

I have done some research and most of what I have seen revolves around the garmin_gps module. As far as I can tell, it is not being loaded. Even when I loaded it myself, it did not have an impact. It is currently blacklisted in /etc/modprobe.d/raspi-blacklist.conf.

I have no experience with modules and device detection but it appears that I am either missing a module that needs to be loaded to access the Garmin as a serial/USB device or the fact that it is being loaded as disk is blocking it from being loaded as a serial/USB device.

Not sure what you need to see so I tried adding a lot of details. I hope I added the correct details and not too much of wrong details.

Here are a couple of my attempts after attaching the device.

pi@raspberrypi ~ $ gpsbabel -t -w -r -i garmin -f usb: -o gpx -F ~/temp.gpx
Found no Garmin USB devices.

pi@raspberrypi ~ $ sudo gpsbabel -t -w -r -i garmin -f /dev/bus/usb/001/004 -o gpx -F ~/temp.gpx
[ERROR] SERIAL: tcgetattr error: Inappropriate ioctl for device
[ERROR] Cannot open serial port '/dev/bus/usb/001/004'
GARMIN:Can't init /dev/bus/usb/001/004



What follows is some details. I captured some output from dmesg, listing devices, lsmod and lsusb before and after.


pi@raspberrypi ~ $ uname -a
Linux raspberrypi 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l GNU/Linux


pi@raspberrypi ~ $ lsmod
Module                  Size  Used by
snd_bcm2835            15846  0
snd_pcm                77560  1 snd_bcm2835
snd_seq                53329  0
snd_timer              19998  2 snd_pcm,snd_seq
snd_seq_device          6438  1 snd_seq
snd                    58447  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
snd_page_alloc          5145  1 snd_pcm
leds_gpio               2235  0
led_class               3562  1 leds_gpio


pi@raspberrypi ~ $ sudo find /dev | sort > ~/dev_1.txt
pi@raspberrypi ~ $ lsmod > ~/mod_1.txt
pi@raspberrypi ~ $ lsusb > ~/usb_1.txt
pi@raspberrypi ~ $ dmesg > ~/msg_1.txt


pi@raspberrypi ~ $ watch 'dmesg | tail -20'
[   24.411531] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SS
[  227.353318] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
[  227.454495] usb 1-1.2: New USB device found, idVendor=091e, idProduct=2294
[  227.454527] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=5
[  227.454544] usb 1-1.2: SerialNumber: 0000cd9c6cb6
[  229.714329] scsi0 : usb-storage 1-1.2:1.0
[  230.714583] scsi 0:0:0:0: Direct-Access     Garmin   nuvi Flash       1.00 PQ: 0 ANSI: 5
[  230.718099] scsi 0:0:0:1: Direct-Access     Garmin   nuvi SD Card     1.00 PQ: 0 ANSI: 5
[  230.718488] sd 0:0:0:0: [sda] 6147840 512-byte logical blocks: (3.14 GB/2.93 GiB)
[  230.719470] sd 0:0:0:0: [sda] Write Protect is off
[  230.719501] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[  230.720724] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  230.727711] sd 0:0:0:1: [sdb] Attached SCSI removable disk
[  230.744693]  sda:
[  230.750604] sd 0:0:0:0: [sda] Attached SCSI removable disk


pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 091e:2294 Garmin International


pi@raspberrypi ~ $ dmesg > ~/msg_2.txt
pi@raspberrypi ~ $ sudo find /dev | sort > ~/dev_2.txt
pi@raspberrypi ~ $ lsmod > ~/mod_2.txt
pi@raspberrypi ~ $ lsusb > ~/usb_2.txt


pi@raspberrypi ~ $ diff ~/dev_1.txt ~/dev_2.txt
30a31,35
> /dev/block/8:0
> /dev/block/8:16
> /dev/bsg
> /dev/bsg/0:0:0:0
> /dev/bsg/0:0:0:1
37a43
> /dev/bus/usb/001/004
60a67
> /dev/char/189:3
64a72,73
> /dev/char/252:0
> /dev/char/252:1
157a167,173
> /dev/disk/by-id/usb-Garmin_nuvi_Flash_0000cd9c6cb6-0:0
> /dev/disk/by-id/usb-Garmin_nuvi_SD_Card_0000cd9c6cb6-0:1
> /dev/disk/by-label
> /dev/disk/by-label/GARMIN
> /dev/disk/by-path
> /dev/disk/by-path/platform-bcm2708_usb-usb-0:1.2:1.0-scsi-0:0:0:0
> /dev/disk/by-path/platform-bcm2708_usb-usb-0:1.2:1.0-scsi-0:0:0:1
158a175
> /dev/disk/by-uuid/438D-E7CD
213a231,232
> /dev/sda
> /dev/sdb


pi@raspberrypi ~ $ diff ~/mod_1.txt ~/mod_2.txt


pi@raspberrypi ~ $ diff ~/usb_1.txt ~/usb_2.txt
3a4
> Bus 001 Device 004: ID 091e:2294 Garmin International


pi@raspberrypi ~ $ sudo fdisk -l

Disk /dev/mmcblk0: 16.1 GB, 16130244608 bytes
4 heads, 16 sectors/track, 492256 cylinders, total 31504384 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00014d34

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      122879       57344    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          122880    31504383    15690752   83  Linux

Disk /dev/sda: 3147 MB, 3147694080 bytes
97 heads, 62 sectors/track, 1022 cylinders, total 6147840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System


pi@raspberrypi ~ $ ls /dev/tty*
/dev/tty    /dev/tty14  /dev/tty20  /dev/tty27  /dev/tty33  /dev/tty4   /dev/tty46  /dev/tty52  /dev/tty59  /dev/tty8
/dev/tty0   /dev/tty15  /dev/tty21  /dev/tty28  /dev/tty34  /dev/tty40  /dev/tty47  /dev/tty53  /dev/tty6   /dev/tty9
/dev/tty1   /dev/tty16  /dev/tty22  /dev/tty29  /dev/tty35  /dev/tty41  /dev/tty48  /dev/tty54  /dev/tty60  /dev/ttyAMA0
/dev/tty10  /dev/tty17  /dev/tty23  /dev/tty3   /dev/tty36  /dev/tty42  /dev/tty49  /dev/tty55  /dev/tty61  /dev/ttyprintk
/dev/tty11  /dev/tty18  /dev/tty24  /dev/tty30  /dev/tty37  /dev/tty43  /dev/tty5   /dev/tty56  /dev/tty62
/dev/tty12  /dev/tty19  /dev/tty25  /dev/tty31  /dev/tty38  /dev/tty44  /dev/tty50  /dev/tty57  /dev/tty63
/dev/tty13  /dev/tty2   /dev/tty26  /dev/tty32  /dev/tty39  /dev/tty45  /dev/tty51  /dev/tty58  /dev/tty7



I then installed the garmin_gps module and tried again. I only included some of the differences but the results are the same.


pi@raspberrypi ~ $ sudo modprobe -v garmin_gps
insmod /lib/modules/3.6.11+/kernel/drivers/usb/serial/usbserial.ko
insmod /lib/modules/3.6.11+/kernel/drivers/usb/serial/garmin_gps.ko


pi@raspberrypi ~ $ watch 'dmesg | tail -20'
[ 8192.322520] usbcore: registered new interface driver usbserial
[ 8192.322639] usbcore: registered new interface driver usbserial_generic
[ 8192.322741] USB Serial support registered for generic
[ 8192.322760] usbserial: USB Serial Driver core
[ 8192.328489] usbcore: registered new interface driver garmin_gps
[ 8192.328606] USB Serial support registered for Garmin GPS usb/tty
[ 8297.314080] usb 1-1.2: new full-speed USB device number 7 using dwc_otg
[ 8297.415365] usb 1-1.2: New USB device found, idVendor=091e, idProduct=2294
[ 8297.415396] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=5
[ 8297.415413] usb 1-1.2: SerialNumber: 0000cd9c6cb6
[ 8299.696840] scsi2 : usb-storage 1-1.2:1.0
[ 8300.695581] scsi 2:0:0:0: Direct-Access     Garmin   nuvi Flash       1.00 PQ: 0 ANSI: 5
[ 8300.700228] scsi 2:0:0:1: Direct-Access     Garmin   nuvi SD Card     1.00 PQ: 0 ANSI: 5
[ 8300.702030] sd 2:0:0:0: [sda] 6147840 512-byte logical blocks: (3.14 GB/2.93 GiB)
[ 8300.703255] sd 2:0:0:0: [sda] Write Protect is off
[ 8300.703291] sd 2:0:0:0: [sda] Mode Sense: 23 00 00 00
[ 8300.705934] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 8300.717373] sd 2:0:0:1: [sdb] Attached SCSI removable disk
[ 8300.729671]  sda:
[ 8300.735418] sd 2:0:0:0: [sda] Attached SCSI removable disk


pi@raspberrypi ~ $ diff ~/dev_1.txt ~/dev_2.txt
30a31,35
> /dev/block/8:0
> /dev/block/8:16
> /dev/bsg
> /dev/bsg/3:0:0:0
> /dev/bsg/3:0:0:1
37a43
> /dev/bus/usb/001/008
60a67
> /dev/char/189:7
64a72,73
> /dev/char/252:0
> /dev/char/252:1
157a167,173
> /dev/disk/by-id/usb-Garmin_nuvi_Flash_0000cd9c6cb6-0:0
> /dev/disk/by-id/usb-Garmin_nuvi_SD_Card_0000cd9c6cb6-0:1
> /dev/disk/by-label
> /dev/disk/by-label/GARMIN
> /dev/disk/by-path
> /dev/disk/by-path/platform-bcm2708_usb-usb-0:1.2:1.0-scsi-0:0:0:0
> /dev/disk/by-path/platform-bcm2708_usb-usb-0:1.2:1.0-scsi-0:0:0:1
158a175
> /dev/disk/by-uuid/438D-E7CD
213a231,232
> /dev/sda
> /dev/sdb


pi@raspberrypi ~ $ ls /dev
autofs           full   loop7               ppp    ram3    shm      tty13  tty24  tty35  tty46  tty57    ttyprintk  vcs6
block            fuse   loop-control        ptmx   ram4    snd      tty14  tty25  tty36  tty47  tty58    uinput     vcs7
bsg              input  MAKEDEV             pts    ram5    sndstat  tty15  tty26  tty37  tty48  tty59    urandom    vcsa
btrfs-control    kmsg   mapper              ram0   ram6    stderr   tty16  tty27  tty38  tty49  tty6     vc-cma     vcsa1
bus              log    mem                 ram1   ram7    stdin    tty17  tty28  tty39  tty5   tty60    vchiq      vcsa2
cachefiles       loop0  mmcblk0             ram10  ram8    stdout   tty18  tty29  tty4   tty50  tty61    vc-mem     vcsa3
char             loop1  mmcblk0p1           ram11  ram9    tty      tty19  tty3   tty40  tty51  tty62    vcs        vcsa4
console          loop2  mmcblk0p2           ram12  random  tty0     tty2   tty30  tty41  tty52  tty63    vcs1       vcsa5
cpu_dma_latency  loop3  net                 ram13  raw     tty1     tty20  tty31  tty42  tty53  tty7     vcs2       vcsa6
disk             loop4  network_latency     ram14  root    tty10    tty21  tty32  tty43  tty54  tty8     vcs3       vcsa7
fb0              loop5  network_throughput  ram15  sda     tty11    tty22  tty33  tty44  tty55  tty9     vcs4       xconsole
fd               loop6  null                ram2   sdb     tty12    tty23  tty34  tty45  tty56  ttyAMA0  vcs5       zero



When I plug in my MTK based logger, I get the following messages:


pi@raspberrypi ~ $ watch 'dmesg | tail -20'
[ 7880.230904] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
[ 7880.333809] usb 1-1.2: New USB device found, idVendor=0e8d, idProduct=3329
[ 7880.333841] usb 1-1.2: New USB device strings: Mfr=3, Product=4, SerialNumber=0
[ 7880.333857] usb 1-1.2: Product: GPS Receiver
[ 7880.333870] usb 1-1.2: Manufacturer: MTK
[ 7880.402000] cdc_acm 1-1.2:1.1: ttyACM0: USB ACM device
[ 7880.405418] usbcore: registered new interface driver cdc_acm
[ 7880.405448] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters


Thanks, Wes.