HOWTO GPS / Microsoft GPS-360

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

Microsoft GPS-360 / Streets and Trips GPS

While you might be a staunch opponent of Microsoft, their Streets and Trips can be purchased with a 'puck' style USB GPS receiver for less than an inexpensive handheld unit. It has a nice, long cord so your notebook can remain in your passenger seat while the puck can sit on your dash. Of course there are not linux drivers, but when did that stop us!

Note: in the following directions 'elmer linux #' is my command prompt. Yours will vary. You don't type it for the commands to work.

Get the IDs

First we need to check the Device ID (it's plugged in, right?):

elmer linux # lsusb

Bus 004 Device 003: ID 067b:aaa0 Prolific Technology, Inc.

We can see that our GPS unit is detected on bus 4 as device 3. Your values will probably vary. What shouldn't vary is the ID '067b:aaa0'. We will need this for the driver header file.

Modify USB Serial Driver

Note: This should only be necessary for older kernels. With Linux 2.6.11 at least (probably with some previous versions of the 2.6 kernel as well), support is already in the kernel.

Edit the driver header: elmer linux # nano -w /usr/src/linux-2.4.27/drivers/usb/serial/pl2303.h

Add 2 lines at the top of the file, just below the comment/header section:

#define GPS360_VENDOR_ID      0x067b
#define GPS360_PRODUCT_ID     0xaaa0

Save your file. Notice how the vendor ID and product ID match what we saw on the bus? '0x' means hexadecimal values, while the last 4 digits are the id we saw. We just gave this driver the ability to claim this device when detected.

You need also edit the driver source: elmer linux # nano -w /usr/src/linux-2.4.27/drivers/usb/serial/pl2303.c

Find (but do not modify):

static struct usb_device_id id_table [] = {

On a newline after the above, insert:

{ USB_DEVICE(GPS360_VENDOR_ID, GPS360_PRODUCT_ID) }, 

Failure to add this line may result in an unmatched symbol error during compile.

Compile and copy

Change into your kernel source tree: elmer linux # cd /usr/src/linux

Compile our new driver: elmer linux # make modules

Now we need to copy this driver into our lib so the kernel can use it. 'make modules_install' is not necessary, is overkill and didn't work for me - probably because I use genkernel.

elmer linux # cp /usr/src/linux/drivers/usb/serial/pl2303.o /lib/modules/2.4.27/kernel/drivers/usb/serial/pl2303.o

Did it work as desired? elmer linux # ls -lha /lib/modules/2.4.27/kernel/drivers/usb/serial/pl2303.o

-rw-r--r--  1 root root 16K Nov 19 00:01 /usr/src/linux-2.4.27/drivers/usr/serial/pl2303.o

We can see that the file is now current (Nov 19 might not be today's date in your case.)

Load Module

Our driver is now ready to do what it is intended to do. We just need to load it. First we remove any of the needed modules from the kernel (if they are loaded).

elmer linux # rmmod pl2303

elmer linux # rmmod usbserial

Now we insert the modules into the kernel. The system will read the new one we just made.

elmer linux # insmod usbserial

elmer linux # insmod pl2303

You want to know it worked? dmesg is your friend: elmer linux # dmesg

File: Output of dmesg
usbserial.c: USB Serial support registered for PL-2303
usbserial.c: USB Serial converter detected
usbserial.c: USB Serial converter now attached to ttyUSB0 (or usr/tts/0 for devfs)
pl2303.c: Prolific PL2303 USB to serial adaptor driver v0.10

Wrapping Up

Make sure you add (if needed) usbserial and pl2303 to /etc/modules.autoload.d/kernel-2.4 (or kernel-2.6 as the case may be) to keep this functionality after a reboot.

You can now run gpsd and gpsdrive with the setting set to ttyUSB0.


A further note: If for some reason, you decide to use this GPS in windows, and if, for some reason, it gives you an error message about the GPS not sending data in NMEA mode, you can fix this by again running gpsd with your particular device, connect to the gpsd using telnet or some such thing, and then manualy alter the mode back to NMEA by typing n=0. (man gpsd).

Personal tools