Hello to all,
I'm new to the forum: I apologize if I published my post in the wrong place.
I'm having been using Slackware for some time now on my private laptop. I've just upgraded to Slackware 15 64 bit, and I must say that is a big improvement with respect to 14.2: I find it more responsive and quick.
As I like running, I want to share the success in downloading GPX tracks from my (old) Garmin Forerunner 205 using GpsBabel. This activity was one of the very few that forced me to switch to Windows (on my wife's laptop), so that I could use Garmin Express to download the tracks and view them on the Garmin Connect website. In addition to having to use another pc, the connection with the Garmin was always tricky: I often had to spend a few minutes rechecking the electric contacts, resetting the Garmin, etc, in the hope that the pc (running Windows 10) could "see" the Garmin and synchronize.
I tried to look for other people in my situation, but I could not find many posts on this, so I list below what I did to successfully connect to my Garmin Forerunner 205 and upload the tracks on the website Garmin Connect, just as I did with the Garmin Express workflow. But all this from Slackware 15.
1) install the gpsbabel (1.7.0) packet for 14.2 (the new slackbuilds for 15.0 are not yet available). It seems that the 2 dependencies indicated (qt5 and libminizip) are already satisfied on Slackware 15.0, as the packed build compiled without problems
2) when I attached the Garmin to my laptop, I could check that the system autoloaded the kernel module garmin_gps. This means that the /dev/ttyUSB0 device is created. I started working as root to avoid permission problems for debugging, but even if I found several workarounds using the stty command, I was not able to have it working correctly. In the GpsBabel website I found this page (
https://www.gpsbabel.org/os/Linux_Hotplug.html ) pointing out that GpsBabel needs not the kernel module, as it can manage the USB connection by itself. In few words, if you use garmin_gps module, you'll have to use /dev/ttyUSB0 as input device, if you let gpsbabel do the work, just use usb: . For the latter option, which works for me and is suggested by GpsBabel developers, it is mandatory to remove the garmin_gps module, otherwise the resource will be busy. To do so, use the command
You should see /dev/ttyUSB0 disappear, and the following command should work correctly as root (showing current GPS position):
Code:
gpsbabel -i garmin -f usb:
3) to prevent the garmin_gps module from being loaded automatically in the future, I created the file /etc/modprobe.d/blacklist.conf with the following text:
Code:
blacklist garmin_gps
4) to run gpsbabel as a normal user, I followed the indications here:
https://docs.slackware.com/howtos:hardware:gps_devices
- I added the user to the plugdev group with the command
Code:
usermod -a -G plugdev <user>
- I created a new udev rule to allow user access to the members of group plugdev, by creating file /etc/udev/rules.d/51-garmin.rules with following content
Code:
ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", MODE="666", GROUP="plugdev"
5) at this stage, gpsbabel should be correctly communicating with the Garmin, and be able to download all the tracks stored in the device:
Code:
gpsbabel -t -i garmin -f usb: -o gpx,gpxver=1.1 -F track.gpx
-t limits operations to tracks (as apposed to routes and waypoints)
-i input stream is of type garmin (serial/USB protocol, see
https://www.gpsbabel.org/htmldoc-dev...mt_garmin.html)
- f usb: input file is usb: (with garmin_gps module, you had to put -f /dev/ttyUSB0, but it never worked fully for me). In the manual, it says you could explicit the USB port such as -f usb:0 (or indicate -f usb:-1 to have the program list the available ports), but it works perfectly even without indicating the port, as I think it autodetects it.
- o gpx,gpxver=1.1 the output format is gpx, format 1.1 (the real output tipe is gpx, whereas gpxver=1.1 is an option that indicates the version to be used)
- F track.gpx output file that will contain ALL the tracks that are stored in the device, unless you explicitly delete them. Garmin Express automatically selects the tracks that have not been downloaded, whereas the command above downloads all the tracks, and you have to extract with another command the desired ones.
6) to extract the desired one, I exploited gpsbabel capability to manage gpx (and many other formats), after googling to learn some Bash scripting. For each track I extract the name and the date of the first track point, then I let gpsbabel filter the desired track and save it in another file track_XX.gpx:
Code:
# show list of available tracks (with name and timestamp of first point)
sed -n '/<name>/{:start /<time>/!{N;b start};/<time>/p}' track.gpx | grep "name\|time" | paste -sd ' \n'
printf "\nWhich track do you want to extract? (enter the name)"
read VARNAME
# extrack track matching the name in VARNAME
echo "Extracting track track_XX.gpx"
gpsbabel -i gpx -t -f track.gpx -x track,name=${VARNAME} -o gpx,gpxver=1.1 -F track_${VARNAME}.gpx
In the above call, I use as input the track.gpx file that was downloaded in advance from the Garmin, and I apply a filter (-x track,name=<track name>). It is MANDATORY to use the gpx version 1.1 here, as the output file track_XX.gpx must be in the GPX format 1.1. I first used the simple gpx output format (without expliciting the version 1.1), and the Garmin Connect web page was unable to upload the track correctly
7) now you just have to upload the new file track_XX.gpx file to the Garmin Connect page. You can reach by clicking on the upper right part of the page, on the icon of the cloud, and click on "import data". You're done, you'll have the track exactly as you would have had by synchronize your Garmin Forerunner 205 using Garmin Express on Windows.
I was astonished at seeing how stable the connection and communication between my laptop and the Garmin is! After using the usb: input device, I never ever lost one single download, whereas using Garmin Express I often lost 5 or 10 minutes desperately trying to have the communication start.
I hope that my tutorial can be useful for other people, and I would be glad of course if other users will give suggestions, improve the scripts, etc.