Announcement

Collapse
No announcement yet.

Garmin 405 ANT download on Linux

Collapse
X
  • Time
  • Show
Clear All
new posts

  • Garmin 405 ANT download on Linux

    I've been successfully using a fork of gant (from http://cgit.get-open.com/cgit.cgi/gant/) to download data off of my Garmin 405 as TCX files on 32-bit Linux. I needed to do a bunch of reorganization of the code to get it to be stable (adding retries for failures, sanity checks, etc), but I've been using it reliably for a while to download activities off of my 405 on the command line.

    I'm working on getting patches upstream to the original author, so eventually this should get in the mainline version. For those that are interested, I've put my code here if anyone wants to give it a try. If people have patches or comments, I'm happy to look at them.
    -w
    Attached Files

  • #2
    thank you very much for this.

    I seem to connect and download the data fine, however, when i try and manually upload it i get a, An error occurred with your upload. Please try again.

    Any idea how to fix this ?


    Cheers

    Christian

    :edit

    Seems there was a device name missing in the xml, added the name and it imported fine, no clue why gant did not import the name.
    Last edited by INDBAKKE_DK; 06-30-2010, 10:19 AM.

    Comment


    • #3
      It works like a charm - thank you very much!

      Comment


      • #4
        Thank you (and the earlier authors). Worked for me, after I realized that I needed to go to the Settings menu on the watch to enable pairing mode.

        Comment


        • #5
          W,

          Thank you, this improved gant code works pretty well. I've attached a python script which automatically restarts gant when it takes too long (e.g., when it hangs).

          To use it, just put the script in the same folder as your gant program and then run it from there.

          If you'd like to run the python script via a shortcut, make sure you update the script's GANT_PATH variable to reflect the path to the gant executable. If you use Ubuntu, create a shortcut/launcher like this:
          1) Right-click on the desktop, choose 'Create Launcher'
          2) Choose the 'Application in Terminal' option from the dropdown.
          3) Enter the path to the python script as the command.
          4) Click Ok. Now you can download your data by just clicking on a shortcut :-).
          Attached Files

          Comment


          • #6
            Thanks

            Thanks for all your efforts. Data is downloading

            However I am also seeing that the <Name><Name> in the xml file is empty which results in a failed upload to garmin connect.

            Manually putting something there and retrying fixes it.

            Anyone with an idea on how to fix this?

            Comment


            • #7
              What am I doing wrong???

              Hello all,

              Maybe I'm doing something wrong, so any advise is welcome.
              I Have a 405 and when I plug in the USB stick, is is recognised:

              Code:
              Aug 10 20:36:12 vaio kernel: usb 7-1: new full speed USB device using uhci_hcd and address 2
              Aug 10 20:36:12 vaio kernel: usb 7-1: New USB device found, idVendor=0fcf, idProduct=1004
              Aug 10 20:36:12 vaio kernel: usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
              Aug 10 20:36:12 vaio kernel: usb 7-1: Product: Dynastream ANT2USB
              Aug 10 20:36:12 vaio kernel: usb 7-1: Manufacturer: Silicon Labs
              Aug 10 20:36:12 vaio kernel: usb 7-1: SerialNumber: 10131
              Aug 10 20:36:12 vaio kernel: usbcore: registered new interface driver usbserial
              Aug 10 20:36:12 vaio kernel: USB Serial support registered for generic
              Aug 10 20:36:12 vaio kernel: usbcore: registered new interface driver usbserial_generic
              Aug 10 20:36:12 vaio kernel: usbserial: USB Serial Driver core
              Aug 10 20:36:12 vaio kernel: USB Serial support registered for cp210x
              Aug 10 20:36:12 vaio kernel: cp210x 7-1:1.0: cp210x converter detected
              Aug 10 20:36:12 vaio kernel: usb 7-1: reset full speed USB device using uhci_hcd and address 2
              Aug 10 20:36:13 vaio kernel: usb 7-1: cp210x converter now attached to ttyUSB0
              Aug 10 20:36:13 vaio kernel: usbcore: registered new interface driver cp210x
              Aug 10 20:36:13 vaio kernel: cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver
              I have added some printf statements in the code and I found out that it remains in the call
              Code:
              fd = open(devname, O_RDWR);
              in the function ANT_Initf in antlib.c

              It never returns from that call, unless I remove the USB device, then it returns with an error opening /dev/ttyUSB0.

              At this point I can't figure out where to continue. Any hints, tips or even better: solutions?

              To be complete: I am using Fedora 13.

              Regards,
              René

              Comment


              • #8
                thanks in advance i use ubuntu too, i donwloaded the files, but I don't understand how to install.
                I think after installing the software has to work, but before how to install?
                What to write in terminal?
                thanks

                Comment


                • #9
                  Originally posted by RPERDOK View Post
                  Hello all,

                  Maybe I'm doing something wrong, so any advise is welcome.
                  I Have a 405 and when I plug in the USB stick, is is recognised:

                  Code:
                  Aug 10 20:36:12 vaio kernel: usb 7-1: new full speed USB device using uhci_hcd and address 2
                  Aug 10 20:36:12 vaio kernel: usb 7-1: New USB device found, idVendor=0fcf, idProduct=1004
                  Aug 10 20:36:12 vaio kernel: usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
                  Aug 10 20:36:12 vaio kernel: usb 7-1: Product: Dynastream ANT2USB
                  Aug 10 20:36:12 vaio kernel: usb 7-1: Manufacturer: Silicon Labs
                  Aug 10 20:36:12 vaio kernel: usb 7-1: SerialNumber: 10131
                  Aug 10 20:36:12 vaio kernel: usbcore: registered new interface driver usbserial
                  Aug 10 20:36:12 vaio kernel: USB Serial support registered for generic
                  Aug 10 20:36:12 vaio kernel: usbcore: registered new interface driver usbserial_generic
                  Aug 10 20:36:12 vaio kernel: usbserial: USB Serial Driver core
                  Aug 10 20:36:12 vaio kernel: USB Serial support registered for cp210x
                  Aug 10 20:36:12 vaio kernel: cp210x 7-1:1.0: cp210x converter detected
                  Aug 10 20:36:12 vaio kernel: usb 7-1: reset full speed USB device using uhci_hcd and address 2
                  Aug 10 20:36:13 vaio kernel: usb 7-1: cp210x converter now attached to ttyUSB0
                  Aug 10 20:36:13 vaio kernel: usbcore: registered new interface driver cp210x
                  Aug 10 20:36:13 vaio kernel: cp210x: v0.09:Silicon Labs CP210x RS232 serial adaptor driver
                  I have added some printf statements in the code and I found out that it remains in the call
                  Code:
                  fd = open(devname, O_RDWR);
                  in the function ANT_Initf in antlib.c

                  It never returns from that call, unless I remove the USB device, then it returns with an error opening /dev/ttyUSB0.

                  At this point I can't figure out where to continue. Any hints, tips or even better: solutions?

                  To be complete: I am using Fedora 13.

                  Regards,
                  René
                  Is there anybody with suggestions, tips or hints about this problem?

                  Comment


                  • #10
                    Stack Smashing

                    I tried this on ubuntu 10.04, 64bit. I am having stack smashing errors.

                    Comment


                    • #11
                      Originally posted by RPERDOK View Post
                      Hello all,

                      Maybe I'm doing something wrong, so any advise is welcome.
                      I Have a 405 and when I plug in the USB stick, is is recognised:
                      <snip>

                      I have added some printf statements in the code and I found out that it remains in the call
                      Code:
                      fd = open(devname, O_RDWR);
                      in the function ANT_Initf in antlib.c

                      It never returns from that call, unless I remove the USB device, then it returns with an error opening /dev/ttyUSB0.

                      At this point I can't figure out where to continue. Any hints, tips or even better: solutions?

                      To be complete: I am using Fedora 13.

                      Regards,
                      René
                      That's what gdb said for me as well. Apparently what happens is that newer Linux kernels will wait for a carrier detect from the device, before returning from that call. It looks like the Garmin® USB device does not provide one, and so we wait forever. Adding the O_NDELAY option to that call fixed it for me. My line 411 of antlib.c now looks like this:
                      Code:
                      fd = open(devname, O_RDWR | O_NDELAY);
                      Hope that helps,

                      Lourens

                      Comment


                      • #12
                        Originally posted by GPGIUIT View Post
                        thanks in advance i use ubuntu too, i donwloaded the files, but I don't understand how to install.
                        I think after installing the software has to work, but before how to install?
                        What to write in terminal?
                        thanks
                        Hi,

                        You have to install first build-essential (
                        Code:
                        sudo apt-get install build-essential
                        in a shell). After you can open a shell in the same directory of gant and write
                        Code:
                        make
                        and

                        Code:
                        chmod +x gant
                        After

                        Code:
                         ./gant -f yourname -a auth405
                        and it's perfect : I have all my .tcx in my directory.
                        If it doen't work at the first time, try again. (in my computer, 2 ou 3 times are necessary)
                        Last edited by philomene_g; 02-24-2011, 02:09 AM.

                        Comment


                        • #13
                          Hi,

                          Has someone managed to taggle with 405CX with Ubuntu on 64bit machine? I just end up on message "/dev/ttyUSB0: No such file or directory".

                          BR Ilkka

                          Comment


                          • #14
                            Worked perfecly on 64-bit ubuntu 10.04, however it stopped working when I upgraded to 10.10.
                            Have tried numerous ways of fixing this, including:
                            http://www.thefloatingfrog.co.uk/gee...05405-musings/

                            Would like to try the gant version referred to in this thread, but the link seems to be dead.

                            Does anyone have it?

                            Comment


                            • #15
                              Updated version with fixes

                              I've applied lourens314's patch that fixes the usb port opening issue on newer Linux kernels as well as some other fixes (handling recording that was interrupted by the watch running out of battery, etc.)

                              I've attached a newer version of my git repository, which has my full edit history from the trunk.

                              I'm successfully running this on Ubuntu Maverick (10.10) amd64.
                              Attached Files

                              Comment

                              Working...
                              X