Tuesday, June 30, 2009

Using a Garmin Foretrex 101 with an Apple MacBook

In my previous post I wrote about the process that led to my purchase of a Garmin Foretrex 101 handheld GPS unit (or wearable personal navigator as it says on the box). This post provides some more detail of how I am using it with an Apple MacBook.

The first problem is how to connect the GPS to the MacBook. It would be nice if the GPS unit had Bluetooth capability so that you could wirelessly transfer data direct to the MacBook. But it doesn't. Instead it has a serial connection - which is absent from every computer I've bought this decade. After some poking around on the Internet I found that there were several serial/USB converter cables available. Garmin list one as an accessory for the Foretrex 101, but it gives a list price of £33.99. Instead I plumped for a cable from Amazon, supplied by iBox Ltd, with postage it came to the grand total of £4.70.

The converter cable arrived after a couple of days - well ahead of the main Amazon order which included the GPS unit itself. The cable itself was slightly different from the one in the photo on the Amazon page, in that although the actual 9-pin serial connector itself was male, it had screws to secure the connection instead of hexagonal sockets. Fortunately I was able to liberate a pair of hexagonal nuts from an old serial extension cable to make sure it stayed firmly connected to the serial plug.

A driver is needed to get the converter cable to work with Mac OS X (I'm running OS X 10.5.7 on my MacBook), and a mini-CD was provided with the cable, although you can't use it in a slot loading drive like the MacBook has. The driver needed for OS X is in /Prolific/PL2303X/MacOS-X/PL2303_1.2.1.dmg. Although I went to the Prolific web site and downloaded the slightly newer 1.2.1r2 driver.

You can check that the converter cable uses the Prolific PL2303X chipset by plugging it in and going to System Profiler and checking Hardware > USB section for a device called USB-Serial Controller. It should have a Vendor ID of 0x067b (Prolific Technology, Inc) and a Product ID of 0x2303. Once the driver is installed and the cable is connected there is a new serial device called usbserial, which shows up as /dev/cu.usbserial and /dev/tty.usbserial.

As I was still waiting for the GPS to arrive I tested that the cable was working by plugging in a serial trackball that I had and running od /dev/tty.usbserial in a Terminal. Output appeared when I moved the trackball or clicked a button, so it was looking promising.

The actual GPS unit itself arrived a couple of days later, along with the serial cable. Although the cable is listed on the Amazon site as "Garmin PC Cable (Forerunner 201 & Foretrex 201)" it works fine with the Foretrex 101 too.

At first I didn't much care for the idea of it being wrist mounted. Some of the reviews I had read online claimed the Foretrex 101 was no bigger than a watch. It is a lot bigger than any watch I've ever had, but it is surprisingly light. With batteries installed it weighs in at just under 100g, whereas my watch weighs 80g. And it does seem to function well on your wrist, and if you really want to know the time (and date) it's there in a tiny font on top of the Main Menu page. Or you can select it as one of the readouts on the useful Trip Computer page. After a couple of experiments of putting it in my pocket I attached the wrist strap and now I always use it on my wrist.

Loading data from the GPS to the MacBook is quite straightforward using a GPS utility such as LoadMyTracks. First you need to plug the 2.5mm plug of the serial cable into the GPS. The port is hidden behind a little weatherproof rubber flap. Make sure the plug is pushed in all the way. Then plug the USB cable into the MacBook, turn the GPS unit on and fire up LoadMyTracks. You should select "Garmin Serial" from the dropdown and "usbserial" as the serial port to use, then make sure the GPS unit is turned on and click "Acquire". The application will prompt you for a location to save the data in and will show a progress bar as it transfers the data. The GPS unit will beep and display "Transfer Complete" once the process is done. The data can be saved as a KML file to use with Google Earth, or a GPX file for a variety of uses. I am currently loading GPX files into TrailRunner to keep a log of my GPS tracks.

The GPX data can also be used for geotagging photos using a utility such as GPSPhotoLinker. The best way I have found to geotag photos for use with Apple iPhoto '08 is do this is as follows:
  • Synchronise the clock of your digital camera with the GPS before you start.
  • Take your GPS with you when you take photos.
  • When you get back - before you load them into iPhoto - first make sure the clock on the camera is still synchronised to the GPS. If it isn't just take a photo of the clock on the GPS screen, and then you can use the time difference when tagging the photos.
  • Plug the memory card with the photos on into the Mac, and quit iPhoto (if it starts automatically).
  • Use GPSPhotoLinker to geotag the photos on the memory card. You can use the application to timeshift the photos (if you forgot to sync the camera in the first place), and to check the location you are tagging with before you actually tag the photo.
  • Unmount the card from Finder to make sure the tags are written out to the media.
  • Re-insert the card to the Mac and then import the photos into iPhoto.
Note that with iPhoto '08 you need to geotag the photos before importing them, but once they are imported you should be able to see the location data by bringing up the "Photo Info" window (the GPS data is in the "Exposure" section). You can also select "Show File" to bring up the image file in Finder, open the file with Preview, and then use "Tools > Inspector" to display the GPS data (and then you can click on the "Locate" button to view the location in Google Maps).

For general use the Foretrex should be set to "Garmin" on the Settings > Set Interface > I/O Format page, although you can get it to stream GPS data direct to a Mac utility such as GPSUtility by setting it to "NMEA". (Although I have yet to find a use for this).

4 comments:

Anonymous said...

Just moved from a Windows system to a Mac and was trying to get my old USB-Serial device to work. Your tip to get the driver from Prolific was invaluable. Thanks!

Jim said...

@-t: It sound like the driver may not be running properly. When you plug the USB/Serial cable in a device file should get created by the driver. If you go to Terminal.app and type "ls -l /dev/cu.*" you should see a line like this (the date/time will differ):

crw-rw-rw- 1 root wheel 10, 1 2011-02-01 16:37 /dev/cu.usbserial

When you unplug the cable the device file should disappear, so you can run the above Terminal.app command with the cable unplugged and then plugged in and see if it appears.

If the /dev/cu.usbserial line is not there I would suspect that the driver isn't loading. Make sure you have the right driver for the chipset in your cable - my device shows up under System Profiler on the USB Bus (not the USB High-Speed Bus) as "USB-Serial Controller D", with a Product ID of "0x2303" and a Vendor ID of "0x067b (Prolific Technology, Inc.)". If you're seeing different IDs then the chipset in your cable is different from mine and will require a different driver. You say your cable shows up as a USB2 device, so it probably is different from mine. Mine is a USB1.1 (12Mbps) device.

Also the driver I was using (v1.2.1) was a 32-bit driver (I checked in System Profiler under Software -> Extensions and found the "ProlificUsbSerial" driver. If you're running at 64-bit kernel you could try running your kernel in 32-bit mode to see if that helps (hold down the "3" and "2" keys when you start your system). Although I just downloaded the newest version of the driver (v1.4.0) and it shows up as a 64-bit driver, and seems to work fine on my MacBook under the 32 bit kernel in OS X 10.6.6.

phwill77@gmail.com said...

jim
I hane a foretrex 101 with a garmin interface cable 010-10484-00 ssb2sx converter to a mac book. I can download and find the usb serial contoller and it has the correct data and i can also find the serial controller under extension s as well but not the the data shows up as in your blog when the cable is plugged in
any ideas please
ps I am not a techie

Jim said...

@phwill77: If you've got a USB/Serial converter based on the Prolific PL2303X chipset, which shows up with the right IDs in System Profiler and you've got the latest driver from Prolific (I'm now using driver v1.4.0 on OS X 10.6.6, downloaded from the Prolific web site), then I don't really know what to suggest. I've not had any problems, when I plug my USB/Serial converter in and launch LoadMyTracks it comes up with the Garmin Serial / usbserial as the device to use. And I only really have experience with the one cable that I've got.

You could try re-installing the latest driver from Prolific, in case it's not installed properly for some reason. If you've got access to another computer maybe you could try use the USB/Serial converter with that to ensure that the converter itself actually works. Otherwise you could try and get hold of another converter cable (mine was very cheap) and try that.

That's all I can think of I'm afraid.