Introduction

The Garmin GPSMap 76CSx is a handheld GPS that has a high-sensitivity GPS receiver, barometric altimeter and electronic compass, microSD™ card slot, color TFT screen and turn-by-turn routing. This guide will assist in installing, configuring and testing your system.

It has been validated on the following hardware/software:

  • Toshiba Satellite A300, Gateway DX4850, Acer Aspire One 533
  • Ubuntu 10.10 through to 14.04
  • Linux 2.6.35-22-generic through to 3.13.0-24-generic
  • GNOME 2.32.0 through to 3.8.4, Unity
  • Memory 4GB, 8GB, 12GB
  • Garmin GPSMap 76CSx, Garmin Oregon 650
  • Interface set to NMEA In and NMEA Out
  • Baud Rate 4800
  • tangoGPS 0.99.3, foxtrotGPS 1.1.1-5

This process may work equally as well on other Garmin GPSMap 76 and 60 models, and possibly the newer 78 models along with other Garmin hand-helds.

This device has two interface cables:

  • USB
  • RS232 Serial

The USB cable is what is supplied when purchasing the unit.

The RS232 serial cable can be purchased as an accessory. There are two types, one is a "straight" serial cable cable and the other is a Y cable. The straight RS232 Serial cable has a 9 pin DIN fitting on one end and a proprietary 4 pin circular fitting on the other end.

The Y cable has an additional 12 Volt "Cigarette Lighter" plug.

As both type of RS232 cable can also be used to carry power, two wires are used for power and the other two for data (transmit and receive). As a consequence, there is no hardware handshaking only software handshaking.

If you wish to use the GPS Unit to transmit real-time data to an application such as tangoGPS, xgps, Merkaartor, you must set the transmission protocol to NMEA regardless of which of the three cables (USB, Straight or Y) you are using.

To do this, press the menu button twice to get to the Main Menu, then navigate to Setup then to Interface then to Serial Data Format. Press the Enter button and scroll down to choose NMEA IN/NMEA OUT.

(Note: The GARMIN Serial Data Format is disabled when USB is connected)

Preparations

  1. Boot Computer
  2. Plug in USB cable to Computer
  3. Connect GPS unit to cable
  4. Turn on GPS unit
  5. Watch the Satellite page and wait until satellites have been acquired and a Latitude and Longitude for your position is displayed.
  6. Switch the data format to NMEA as per the instructions above

Installing Needed Components

There is a Garmin Communicator Plugin for Linux / Ubuntu Firefox that you can install. Instructions are at Garmin Communicator Plugin however I have duplicated the instructions below:

sudo add-apt-repository ppa:andreas-diesner/garminplugin
sudo apt-get update
sudo apt-get install garminplugin

Install additional components:

sudo apt-get install gpsd gpsd-clients gpsbabel

Configuration

NOTE: After configuration, you should restart your computer to ensure all new software, drivers and configurations are loaded.

The gpsd configuration file can be directly edited with:

sudo gedit /etc/default/gpsd

Enter these four lines below into the file

START_DAEMON="true"
GPSD_OPTIONS="-G"
DEVICES="/dev/ttyUSB0"
USBAUTO="true"
GPSD_SOCKET="/var/run/gpsd.sock"

Alternatively, you can use dpkg-reconfigure to configure the file

sudo dpkg-reconfigure gpsd

You will be prompted by a series of questions:

If you accept this option, gpsd will be started automatically
Start gpsd automatically? YES

As gpsd only handles GPS devices, it is safe to choose this option.
However, you can disable it if gpsd is causing interference with other
attached devices or programs. Should gpsd handle attached USB GPS
receivers automatically?  YES

Please enter the device the GPS receiver is attached to. It will
probably be something like /dev/ttyS0 or /dev/ttyUSB0.
Multiple devices may be specified as a space-separated list. Leave
empty if you don't want to connect gpsd to a device on boot or if you
want to use device autodetection only.
Device the GPS receiver is attached to:  /dev/ttyUSB0

You can give additional arguments when starting gpsd; see gpsd(8) for
a list of options.
Do not use '-F' here. The control socket path is set independently.
Options to gpsd: -G

Please enter the gpsd control socket location. Usually you want to
keep the default setting.
gpsd control socket path: /var/run/gpsd.sock

After configuration the file should look like:

# Default settings for gpsd.
# Please do not edit this file directly - use `dpkg-reconfigure gpsd' to
# change the options.
START_DAEMON="true"
GPSD_OPTIONS="-G"
DEVICES="/dev/ttyUSB0"
USBAUTO="true"
GPSD_SOCKET="/var/run/gpsd.sock"

From GPSBabel's site:

"There are two common hazards with Garmin USB on Linux."

"About the middle of 2005, most distributions started shipping with a driver called 'garmin_gps' that claims a USB Garmin device and makes it accessible via a serial port. If you want to use that driver and it actually works for you (a depressingly uncommon situation) this is OK and you can access the device as 'ttyUSB0' or whatever that driver names your dev node. If you want to use GPSBabel's own very well supported USB code and access it as 'usb:', you must remove that driver via rmmod and probably prevent it from loading again. It is our strong recommendation to use the latter approach."

"By default, only root can access the USB devices directly as we do for the 'usb:' case. It is possible to have the system automatically set the permissions on a USB device when it's detected. This eliminates the need for GPSBabel to run as root when using a device controlled by libusb, such as the Garmin 60CSx, VistaC, or LegendC units."

To allow the USB devices to be read and written by a non-privileged user, create a file named /etc/udev/rules.d/51-garmin.rules

sudo gedit /etc/udev/rules.d/51-garmin.rules

Insert this line:

SYSFS{idVendor}=="091e", SYSFS{idProduct}=="0003", MODE="666"

NOTE: After configuration, you should restart your computer to ensure all new software, drivers and configurations are loaded.

Usage Modes

These two operations are mutually incompatible:

  1. To transfer files between your PC and the Garmin GPSMap 76CSx
  2. To display real-time GPS data using tools such as tangoGPS, XGPS and Merkaartor.

Notwithstanding the comments above from GPSBabel's site, in order to collect and display real time data using tools such as tangoGPS, xgps and Merkaartor, you will need to load the garmin_gps module using this command:

sudo modprobe garmin_gps

If you want to use GPSBabel to transfer files, you will need to unload the garmin_gps module using this command:

sudo rmmod garmin_gps

Transferring Files

When transferring files using GPSBabel, first make sure to remove the garmin_gps module:

sudo rmmod garmin_gps

Testing File Transfer Capabilities

To test if the module loaded okay, run:

lsmod | grep 'usb'

The result will be something like this and you should not see the garmin_usb module listed:

usbhid                 36978  0
hid                    67742  1 usbhid

You can use this command to ensure that garmin_gps is not loaded

gpspipe -w -n 100

}}} The output will be something like this and will not show more than these three lines that shows that garmin_gps is correctly not loaded:

close(3) in netlib_connectsock()
netlib_connectsock() returns socket on fd 3
{"class":"VERSION","release":"2.94","rev":"2010-05-13T11:53:05","proto_major":3,"proto_minor":2}
{"class":"DEVICES","devices":[]}
{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false}

This test will also show that the ttyUSB0 device has correctly not been created:

ls -la /dev/ttyU*

The result will be like this:

ls: cannot access /dev/ttyU*: No such file or directory

Transferring tracks, routes and waypoints

You can change the debug level -Dx where x=0..9 to see more or less of the transfer occuring. Here are some sample data transfer commands:

echo Remove the garmin_gps module first
sudo rmmod garmin_gps

echo Download tracks from the Garmin GPSMap 76CSx to the PC
gpsbabel -D1 -t -i garmin -f usb: -o gpx -F tracks.gpx

echo Upload tracks from the PC to the Garmin GPSMap 76CSx
gpsbabel -D1 -t -i gpx -f tracks.gpx -o garmin -F usb:

echo Download routes from the Garmin GPSMap 76CSx to the PC
gpsbabel -D1 -r -i garmin -f usb: -o gpx -F routes.gpx

echo Upload routes from the PC to the Garmin GPSMap 76CSx
gpsbabel -D1 -r -i gpx -f routes.gpx -o garmin -F usb:

echo Download waypoints from the Garmin GPSMap 76CSx to the PC
gpsbabel -D1 -w -i garmin -f usb: -o gpx -F waypoints.gpx

echo Upload waypoints from the PC to the Garmin GPSMap 76CSx
gpsbabel -D1 -w -i gpx -f waypoints.gpx -o garmin -F usb:

Reading the gpsbabel documentation, I found that it does not transfer routable or other maps.

Here is a simple script that you can use to transfer files between the Garmin GPSmap 76CSx. It date and time stamps the files as well so you don't overwrite existing files in the download area.

# Setup file locations.  Change this to suit your userid and desired loacations
DownloadArea=/home/peter/Documents/Sports/GPX/Download
UploadArea=/home/peter/Documents/Sports/GPX/Upload

echo ""
echo "This script transfers tracks; routes; and waypoints from the"
echo "Garmin GPSmap 76CSx to ${DownloadArea} on the Laptop"
echo "and then transfers tracks; routes; and waypoints from"
echo "${UploadArea} to the Garmin GPSmap 76CSx."
echo ""

echo "Create folders if they are missing"
if [ ! -d ${DownloadArea}  ]; then
  mkdir --parents ${DownloadArea}
fi
if [ ! -d ${UploadArea}  ]; then
  mkdir --parents ${UploadArea}
fi

echo "Make DateTime string for downloads"
DATE=`date +%Y-%m-%d`
TIME=`date +%H%M%S`

echo "Remove the garmin_gps module first if neccessary"
lsmod | grep 'garmin_gps'
ExitStatus=`echo $?`

if [ ${ExitStatus} -eq 0 ]; then
  echo "Remove the garmin_gps module"
  sudo rmmod garmin_gps
fi

echo "Download tracks from the Garmin GPSMap 76CSx to the PC"
gpsbabel -D0 -t -i garmin -f usb: -o gpx -F ${DownloadArea}/${DATE}_${TIME}_tracks.gpx

echo "Download routes from the Garmin GPSMap 76CSx to the PC"
gpsbabel -D0 -r -i garmin -f usb: -o gpx -F ${DownloadArea}/${DATE}_${TIME}_routes.gpx

echo "Download waypoints from the Garmin GPSMap 76CSx to the PC"
gpsbabel -D0 -w -i garmin -f usb: -o gpx -F ${DownloadArea}/${DATE}_${TIME}_waypoints.gpx

if [ -f ${UploadArea}/tracks.gpx  ]; then
  echo "Upload tracks from the PC to the Garmin GPSMap 76CSx"
  gpsbabel -D0 -t -i gpx -f ${UploadArea}/tracks.gpx -o garmin -F usb:
fi

if [ -f ${UploadArea}/routes.gpx  ]; then
  echo "Upload routes from the PC to the Garmin GPSMap 76CSx"
  gpsbabel -D0 -r -i gpx -f ${UploadArea}/routes.gpx -o garmin -F usb:
fi

if [ -f ${UploadArea}/waypoints.gpx  ]; then
  echo "Upload waypoints from the PC to the Garmin GPSMap 76CSx"
  gpsbabel -D0 -w -i gpx -f ${UploadArea}/waypoints.gpx -o garmin -F usb:
fi

echo "Now sleep for a 30 seconds to view the screen"
sleep 30

Displaying real-time GPS Data

To run the GPS with tangoGPS, XGPS, Merkaartor etc., first load the garmin_gps module:

sudo modprobe garmin_gps

Testing Live GPS Data Display

To test if the module loaded okay run:

lsmod | grep 'usb'

The result will be something like this and you will see the garmin_gps module loaded:

usbserial              33100  1 garmin_gps
usbhid                 36978  0
hid                    67742  1 usbhid

Another test to see the data coming out of the GPS:

gpspipe -w -n 100

The output will be something like this:

close(3) in netlib_connectsock()
netlib_connectsock() returns socket on fd 3
{"class":"VERSION","release":"2.94","rev":"2010-05-13T11:53:05","proto_major":3,"proto_minor":2}
{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyUSB0","activated":1287467665.87,"flags":1,"driver":"Garmin USB binary","subtype":"292: 4.00","native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}]}
{"class":"WATCH","enable":true,"json":true,"nmea":false,"raw":0,"scaled":false,"timing":false}
{"class":"DEVICE","path":"/dev/ttyUSB0","activated":1287467665.88,"flags":1,"driver":"Garmin USB binary","subtype":"292: 4.00","native":0,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00}
{"class":"SKY","tag":"75","device":"/dev/ttyUSB0","xdop":0.00,"ydop":0.00,"vdop":4.47,"tdop":2.67,"hdop":2.20,"gdop":5.65,"pdop":4.98,"satellites":[{"PRN":11,"el":24,"az":305,"ss":38,"used":true},{"PRN":22,"el":49,"az":83,"ss":15,"used":true},{"PRN":9,"el":14,"az":34,"ss":28,"used":false},{"PRN":18,"el":15,"az":88,"ss":23,"used":false},{"PRN":24,"el":68,"az":277,"ss":20,"used":true},{"PRN":3,"el":11,"az":217,"ss":0,"used":false},{"PRN":6,"el":7,"az":205,"ss":0,"used":false},{"PRN":14,"el":80,"az":119,"ss":0,"used":false},{"PRN":19,"el":33,"az":245,"ss":0,"used":false},{"PRN":20,"el":1,"az":277,"ss":0,"used":false},{"PRN":27,"el":4,"az":24,"ss":0,"used":false},{"PRN":31,"el":10,"az":164,"ss":0,"used":false}]}
{"class":"TPV","tag":"75","device":"/dev/ttyUSB0","time":1287467666.000,"ept":0.005,"lat":48.748199097,"lon":-123.549873178,"alt":-3.945,"epx":34.099,"epy":34.099,"epv":28.569,"track":92.3200,"speed":0.710,"climb":-0.130,"eps":22.73,"mode":3}
{"class":"SKY","tag":"75","device":"/dev/ttyUSB0","xdop":0.00,"ydop":0.00,"vdop":4.47,"tdop":2.67,"hdop":2.20,"gdop":5.65,"pdop":4.98,"satellites":[{"PRN":11,"el":24,"az":305,"ss":38,"used":true},{"PRN":22,"el":49,"az":83,"ss":14,"used":true},{"PRN":9,"el":14,"az":34,"ss":28,"used":false},{"PRN":18,"el":15,"az":88,"ss":23,"used":false},{"PRN":24,"el":68,"az":277,"ss":21,"used":true},{"PRN":3,"el":11,"az":217,"ss":0,"used":false},{"PRN":6,"el":7,"az":205,"ss":0,"used":false},{"PRN":14,"el":80,"az":119,"ss":0,"used":false},{"PRN":19,"el":33,"az":245,"ss":0,"used":false},{"PRN":20,"el":1,"az":277,"ss":0,"used":false},{"PRN":27,"el":4,"az":24,"ss":0,"used":false},{"PRN":31,"el":10,"az":164,"ss":0,"used":false}]}
{"class":"TPV","tag":"75","device":"/dev/ttyUSB0","time":1287467667.000,"ept":0.005,"lat":48.748198839,"lon":-123.549863531,"alt":-4.075,"epx":34.099,"epy":34.099,"epv":28.569,"track":92.3200,"speed":0.710,"climb":-0.130,"eps":68.20,"mode":3}

Another test that provide you with information about the various components:

ps -C gpsd -fww

The result will be something like this:

UID        PID  PPID  C STIME TTY          TIME CMD
nobody    1309     1  0 18:36 ?        00:00:06 /usr/sbin/gpsd -G -F /var/run/gpsd.sock -P /var/run/gpsd.pid /dev/ttyUSB0

This test will list the loaded device:

ls -la /dev/ttyU*

The result will be like this:

crw-rw-rw- 1 root dialout 188, 0 2010-10-18 23:00 /dev/ttyUSB0

Load xgps to see if it connects to the GPS:

xgps

Practical Considerations

Leave the module blacklisted to ensure that it is listed in the /etc/modprobe.d/blacklist.conf file so you can switch it on or off.

sudo gedit /etc/modprobe.d/blacklist.conf

Make sure that the following lines are in the /etc/modprobe.d/blacklist.conf file

# most apps now use garmin usb driver directly (Ubuntu: #114565)
blacklist garmin_gps

Known Conflicts

Installation of the advanced power management tool TLP can cause the computer to not recognize the USB device. It also can cause smart phones to not be recognized. If you have installed TLP and find that you cannot get your computer to recognize your Garmin device, you can uninstall it by typing

sudo apt-get --purge remove tlp

The TLP website is at:

Other Tools

There is available a browser plugin that has the same interface as the official Garmin Communicator Plugin and gives you the possibility to access your Garmin device with your browser under linux. Information is at these websites:

sudo add-apt-repository ppa:andreas-diesner/garminplugin

See Also

External Links


CategoryHardware

GarminGPSMap76CSx (last edited 2014-10-02 01:09:39 by 24)