Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection question #32

Open
david-4444 opened this issue Apr 24, 2021 · 6 comments
Open

Connection question #32

david-4444 opened this issue Apr 24, 2021 · 6 comments

Comments

@david-4444
Copy link

Thanks for sharing these tools. I'm having problems getting going.
I've installed everything but I get this error. 'no polar USB device connected' although I can find it in the folder /dev/ttyACM0 ?
It's a Polar Vantage M.

david@david-OptiPlex-790 ~/polar $ ./polar_ftp -d/dev/ttyACM0
? serial ? found, but couldn't open serial device on /dev/ttyACM0: EACCES
Please specify the device to use with the -d option.
No Polar USB device detected.

@david-4444
Copy link
Author

I tried again, this was the output
david@david-OptiPlex-790 ~/polar $ ./polar_ftp -d/dev/ttyACM0 DIR /
Polar Vantage M serial 849D7322 found, but couldn't open serial device on /dev/ttyACM0: EACCES
Please specify the device to use with the -d option.
No Polar USB device detected.
Any ideas gratefully received.

@cmaion
Copy link
Owner

cmaion commented Apr 24, 2021

Hi David,

It seems that you just need to grant yourself access to /dev/ttyACME0 (eg, with sudo chown or sudo chmod).

Cheers

@david-4444
Copy link
Author

david-4444 commented Apr 25, 2021

Thanks Cédric, The SYNC works well now. I'm really pleased I can now connect my watch to Linux without having to send all my data via Polar flow.
In case others have the same problem, this is what I did to give myself access.
Opened the directory /dev in terminal
changed the owner of ttyACM0 to me, and changed the read write permissions to rw-

david@david-OptiPlex-790 /dev $ chown david:david ttyACM0
david@david-OptiPlex-790 /dev $ chmod 660 ttyACM0

When I list the files in the /dev directory this is what ttyACM0 looks like now.
crw-rw---- 1 david david 166, 0 Apr 25 10:08 ttyACM0

Then using the polar_ftp ruby command I get:
david@david-OptiPlex-790 ~/polar $ ./polar_ftp -d/dev/ttyACM0 DIR /
Connected to Polar Vantage M serial 849D7322
Listing content of '/'
JOURNAL.DAT 10240
PRODCONF.TXT 27
SS/
SDLOGS/
SDSIMU/
SYS/
U/
SYSLOG.BPB 25
SYSCONF.BPB 6
MUSCF.BIN 12
SDSIMU.BPB 14
PRODDATA.BIN 152
SDLOGS.BPB 32
DBGTRC2.BIN 24400
DBGTRC1.BIN 102108
SYSLOG.TXT 3151
ERRORLO2.BPB 1739
DEVICE.BPB 206
SYNCINFO.BPB 93

I have a couple of questions. I hope you don't mind, I'm a bit of a newby to Linux.

  1. I can only get the polar_ftp command to work using ./ before the command when I'm in the directory containing the Ruby script. It doesn't work in the terminal like other commands. Have I done something wrong in the install ?
    david@david-OptiPlex-790 ~ $ polar_ftp DIR /
    polar_ftp: command not found
  2. I would really like to be able to convert multiple files, e.g. take all the training sessions as .gpx files.
    I have managed to get polar_trainng2gpx to convert 1 file at a time.
    But is it possible to search all the folders and convert multiple?

$ ./polar_training2gpx /home/david/polar/polarwatchfiles/U/0/20210424/E/185520 ~/polar/gpx_files/20210424run.gpx
Converting Polar training session in '/home/david/polar/polarwatchfiles/U/0/20210424/E/185520' to Garmin GPX format as '/home/david/polar/gpx_files/20210424run.gpx'...
Done

Many thanks, David

@cmaion
Copy link
Owner

cmaion commented Apr 27, 2021

  1. this is because the directory in which you installed the tools is not in the search path ($PATH). You may add something like PATH=$PATH:/path/to/polar/directory in your profile (usually ~/.profile or ~/.bashrc)
  2. I use another script that builds on top of those tools to convert all training sessions to TCX (unless already converted), something quick 'n dirty like this:
#!/bin/sh
POLAR_DIR=/path/to/polar
IN_DIR=~/Polar/<device ID>
OUT_DIR=~/Trainings

$POLAR_DIR/polar_ftp SYNC

mkdir -p "$OUT_DIR"
for dir in $(find "$IN_DIR/U/0" -type d | grep -e '/E/[0-9]\+$'); do
    out=$(echo $dir | sed -n 's/.*\/\([0-9]\+\)\/E\/\([0-9]\+\)$/\1-\2-polar.tcx/p')
    outfile="$OUT_DIR/$out"
    if [ -n "$out" -a ! -f "$outfile" ]; then
        $POLAR_DIR/polar_training2tcx "$dir" "$outfile"
    fi
done

Adapt as suitable to you. BTW, if you only need this script, you may not need to change your $PATH -- just create a ~/bin directory (if it's not there yet) and place this script in that directory (and make it executable with chmod +x). Depending on your Linux distribution, ~/bin may already be in $PATH (you may have to logout & login again -- check your ~/.profile & co).

Cheers

@maiko29
Copy link

maiko29 commented Oct 29, 2022

I have similar error on windows platform:

C:\Ruby31\bin>ruby.exe C:\GitHub\polar\polar_ftp DIR /
? serial ? found, but couldn't open serial device on /dev/ttyACM0: ERROR_PATH_NOT_FOUND
Please specify the device to use with the -d option.
No Polar USB device detected.

Where and how can I find the Vantage V path (value for -d) in Windows platform?

@cmaion
Copy link
Owner

cmaion commented Nov 3, 2022

Hi @maiko29,

On Windows, I believe you should try --dev=//./COM3.

If it's not connected on COM3, try COM4 or check the list of connected devices in Device Manager (check Show Hidden Devices and expand Ports (COM & LPT)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants