Arduino Forum

Using Arduino => Project Guidance => Topic started by: phinsil6 on Aug 08, 2011, 08:37 pm

Title: Arduino + Garmin Nuvi
Post by: phinsil6 on Aug 08, 2011, 08:37 pm
Hi, I would really like to interface my arduino directly to my Garmin Nuvi and read GPS data from it into my arduino.
Does anybody know if this feasible?  Maybe with a USB host shield from sparkfun?
Title: Re: Arduino + Garmin Nuvi
Post by: PaulS on Aug 08, 2011, 09:07 pm
Quote
Maybe with a USB host shield from sparkfun?

How are you at writing device drivers?
Title: Re: Arduino + Garmin Nuvi
Post by: phinsil6 on Aug 08, 2011, 09:13 pm
Uh not to great.  Is the garmin really that proprietary?  So basically there is no way to do this?
Title: Re: Arduino + Garmin Nuvi
Post by: tytower on Aug 08, 2011, 11:22 pm
I have not seen a post that says you can't do this ?
Why assume there is no way to do this
I don't know how to do it but I would like to see if it can be done
What on earth does your post mean PaulS- if you are insinuating it can't be done then please explain why not

I have an old garmin carcass with a gps module attached and I can certainly solder wires to it so I can at least explore it !
Title: Re: Arduino + Garmin Nuvi
Post by: PaulS on Aug 09, 2011, 12:30 pm
Quote
What on earth does your post mean PaulS- if you are insinuating it can't be done then please explain why not

I'm not saying that it can't be done. In fact, it is possible that it CAN be done.

The problem is that the Arduino is a USB slave, and the Garmin is also a USB slave. A slave can't make another slave do anything. Only a USB master (host) can make a slave do anything.

So, in order to even think about making the Arduino communicate with the Garmin, the Arduino needs a USB Host shield. Fortunately, Sparkfun sells one. Unfortunately, the shield only handles the hardware part. The software needed to make the hardware do something is called a device driver.

Writing device drivers is not the easiest thing to do. Fitting the required code in the Arduino's limited space, while still leaving room for a sketch to do something is another challenge.

But don't let my lack of accomplishments discourage you. Get a shield, and start writing a driver. Post it here when you get done. Lots of people will appreciate it.
Title: Re: Arduino + Garmin Nuvi
Post by: tytower on Oct 15, 2011, 11:15 pm
Thats good stuff PaulS .
So the Sparkfun USB Host board is the master and it is telling the slave devices what to do. I don't profess to understand that but I can start to research it from there . The Arduino though has the program which runs everything so I don't see how the host board is controlling things , its only converting the info coming in to a form the arduino can read onto  a serial connection isn't it ?

Quote
Writing device drivers is not the easiest thing to do. Fitting the required code in the Arduino's limited space, while still leaving room for a sketch to do something is another challenge.


So are you not  referring to the bootloader?

The sketch handles telling the slave device attached to the shield what to do and I think you mean the the instructions for the host shield take up a lot of program room is that so ?
Title: Re: Arduino + Garmin Nuvi
Post by: PaulS on Oct 16, 2011, 12:20 am
Quote
The Arduino though has the program which runs everything so I don't see how the host board is controlling things , its only converting the info coming in to a form the arduino can read onto  a serial connection isn't it ?

There are hardware and software issues involved with talking to a USB device. The USB Host shield manages the hardware side of things. The Arduino handles the software side. Serial is not involved.

Quote
So are you not  referring to the bootloader?

No.

Quote
The sketch handles telling the slave device attached to the shield what to do and I think you mean the the instructions for the host shield take up a lot of program room is that so ?

Yes. Sometimes. It depends, of course, on what you are talking to. Talking to a specific model from specific manufacturer, of GPS, for instance, is going to require less code than trying to determine what GPS is connected, what that GPS understands, and controlling ANY GPS.

Garmin might be helpful in supplying information about how to communicate with their GPS's. Magellan refuses to even disclose what time it is.
Title: Re: Arduino + Garmin Nuvi
Post by: sbright33 on Oct 17, 2011, 02:31 am
This works with many different GPS's.
http://www.circuitsathome.com/mcu/communicating-to-gps-receiver-using-usb-host-shield
Title: Re: Arduino + Garmin Nuvi
Post by: tytower on Oct 17, 2011, 09:07 am
Hmm thinking thinking
How to run usb-modeswitch from inside arduino IDE.

Saw this
Quote
mode switching tool for controlling "flip flop" USB devices

Several new USB devices have their proprietary Windows drivers onboard,
especially WAN dongles. When plugged in for the first time, they act
like a flash storage and start installing the driver from there. If
the driver is already installed, the storage device vanishes and
a new device, such as an USB modem, shows up. This is called the
"ZeroCD" feature.
.
On Debian, this is not needed, since the driver is included as a
Linux kernel module, such as "usbserial". However, the device still
shows up as "usb-storage" by default. usb-modeswitch solves that
issue by sending the command which actually performs the switching
of the device from "usb-storage" to "usbserial".


I'm using Puppy 5.28 as an Op System atm and usb-modeswitch is installed and loaded . Now I just have to use it properly