Giter Site home page Giter Site logo

mlt / schwinn810 Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 6.0 2.51 MB

Software for Schwinn 810 (and also some Mio, Cresta, and RedClover) GPS sport watch with heart rate monitor (Linux, Windows, and Mac OS)

Home Page: https://github.com/mlt/schwinn810/wiki/Windows

Makefile 2.72% C 14.95% C# 6.83% Visual Basic 6.43% Shell 3.87% Python 65.20%

schwinn810's Introduction

News

12/5/2014

This project is well and alive! I set up a Google group for announces and such. Feel free to ask questions. I know that some had to register with GitHub just for that.

Latest binary build for Windows from intermediate dev branch is available in releases section. Note that it does not require VCP driver and should work with whatever Windows installed for you. Uninstall VCP driver if you installed it previously.

12/27/2012

Apparently binary hosting has been deprecated @github. If someone is capable of providing Windows (and Mac) binary builds, please create an issue. I might set up Amazon S3 for binaires. Though it may take a while.

About

There are inexpensive sport watches out there, however the software is limited to MS Windows and is quite ugly.

Plug'n'play on Ubuntu GNU/Linux video.

Idea

All looks like USBXpress Development Tools from Silicon Labs was used to communicate via USB-UART bridge cp2102.

It seems feasible to write a proxy and transcribe all communication between the software on Windows host and device behind USB-UART bridge.

Once protocol and data format are established, code can be written to fetch data.

There are choices as how to organize things. At first it seems natural to use a database to store all results. However the question is what DB to use? Or shall we use ODBC to support virtually all? If we use sqlite, we can access data with HTML5.

At the end I came to conclusion that there is nothing better than plain CSV files named after tracks. All can be enumerated, some deleted, are human-readable, and can be accessed from other software easily.

The problem would be how to get overall statistics? Like it would be sweet to use R to see trends in progress across multiple runs.

Vision

In the end I'd like to see everything modularized such that same code can be reused with GUI for download progress, or built into a larger app.

Implementation

Right now there are few independent components (with some code duplication like in download.py and settings.py :( )

  • download.py is the main program to extract tracks, laps, points
  • settings.py extracts all settings that can be fetched, like time zone threshold, user information, etc
  • babelize.cmd is a hook script that optionally can be called by donload.py. It contains commands to execute for each track fetched.
  • schwinn810.cmd is a convenience script to reduce amount of typing necessary to provide download.py with options
  • csv2tcx.py converts laps & points into a single TCX file (gpsbabel lacks laps support)
  • tcx2garmin, mmr_uploader are "templates" on how TCX could be uploaded automatically from babelize.cmd . For now, refer to source code.

Batch/shell scripts babelize and schwinn810 can be renamed for convenience.

Installation

Windows

Please follow this guide.

Ubuntu GNU/Linux

There is a ppa available with package for Oneiric Ocelot. Install as any other package. Use dpkg-reconfigure -plow schwinn810 to change settings.

Build

Just using up-to-date code

At these early stages, I'd recommend to use python source code and do not do compilation into binaries. However, if you don't feel like installing tons of stuff on Windows, refer to download section. I upload binary builds for MS Windows from time to time.

To make Windows redistributable

  1. Install Python 2.7 (preffered) or 3.2, pip, pyserial, cx_Freeze, and pytz.
  2. Execute cxfreeze --compress --include-modules serial.win32 download.py --target-dir dist Refer to setup.py and distutils manual on how to build

Tasks

At this point one should not expect an exact copy of software for other OSes.

  1. Code proxy and transcribe communication making it possible for others to develop software independently.
  2. Improve data format details.
  3. Write some python (?) code that dumps data from serial port into CSV
  4. Make it more unicsv-friendly so gpsbabel can convert data to GPX and/or TCX.
  5. Write some GUI, R code
  6. Export to various web sites Can someone help with dailymile.com ?
  7. Move command line options to a configuration file and make things debconf friendly
  8. Per user JSON-based configuration file and GUI to set things up (WIP)
  9. Watchdog to monitor device notification (when plugged) for Windows and Linux (WIP)

schwinn810's People

Contributors

mlt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

schwinn810's Issues

Unable to open port?

Suddenly getting an "unable to open port" error when running download.py. 2 different ubuntu installations, 13.x (which had been running fine) and 14.04 (which i hadn't tried). dmesg shows:
[ 422.320103] usb 3-1: new full-speed USB device number 3 using uhci_hcd
[ 422.484082] usb 3-1: New USB device found, idVendor=10c4, idProduct=ea61
[ 422.484088] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 422.484092] usb 3-1: Product: CP2102 USB to UART Bridge Controller
[ 422.484095] usb 3-1: Manufacturer: Silicon Labs
[ 422.484098] usb 3-1: SerialNumber: 8887
[ 422.489206] cp210x 3-1:1.0: cp210x converter detected
[ 422.600093] usb 3-1: reset full-speed USB device number 3 using uhci_hcd
[ 422.748455] usb 3-1: cp210x converter now attached to ttyUSB0

I get nothing from ls -l /dev/schwinn810, though of course I do with /dev/ttyUSB0.

TriggerMethod field in TCX

Hi, this is not a bug or issue but a acording to tcx schema, in every lap there is a TriggerMethod field which indicate if this was triggered by distance, location.. or manual.
In the actual version, it always says "Location"

           if heart_max>0:
                print("""    <MaximumHeartRateBpm><Value>{:d}</Value></MaximumHeartRateBpm>""".format(heart_max))
            print("""    <Intensity>Active</Intensity>
    <TriggerMethod>Location</TriggerMethod>
    <Track>""")

Looking into sourcode it is possible to know if this was manual or by distance (0.5, 1.0, 2.0 etc) but never by location. I think it could check autolap var to print different trigger method, for example:

            print("""    <Intensity>Active</Intensity>""")
            if int(theLap['autolap']) > 0:
                print("""    <TriggerMethod>Distance</TriggerMethod>""")
            else:
                print("""    <TriggerMethod>Manual</TriggerMethod>""")

            print("""    <Track>""")

Thank you for your software, I'm using it in Mac OS X Mavericks without problem.

One last thing, I'm trying to extract the settings of my watch but there is no read_settings method in reader_cresta.py. I have copied the one in reader_schwinn.py but it throw an error unpacking the data. I've changed the amount of data read from 25 to 20 without success. Any help?

Support for settings extraction on Cresta alike watch

Post there an exact error you are getting. If it is about failed signatures in other parts of the code, it well >might be that you subsequently trying to fetch things again and again without disconnecting the watch >and something is just stuck in a buffer that was not flushed. Disconnecting the watch before the new >attempt might help if that was an issue.

I'll post the exact error later, there is a way to read a dump bin file without the watch connected?
Because my watch battery is getting bad and I don't want to connect and disconnect the watch several times.

Windows 8 and driver signature enforcement

I had a computer meltdown and ended up installing windows 8. I am running into problems installing the driver for windows 8. The modified driver will not install because it was never meant to work on Win8. So I downloaded their new win8 compatible driver and modified slabvcp.inf with
%USB\VID_10C4&PID_EA61.DeviceDesc%=silabser.Dev, USB\VID_10C4&PID_EA61
under both [SiLabs] as well as [NTamd64]. This gets a bit further into the install but ultimately fails due to the hash not matching. I have tried updating the driver as well as installing from the EXE and both ways fail. Any clue how to fix this?

screenshot

MMF uploader misses splits

For some reason TCX uploaded with mmr_uploader.pl does not contain any splits. Splits do show up and analysis works fine if TCX is uploaded manually.

Also TZ is incorrect (reports as 1 hour later) compared to manual upload.

Unrecorded points = crash

I've got a Highgear XT7 watch that works just fine with this software. However, on one of my trips it missed a few points in the middle, so the "fetching" number of points was higher than the actual number of points. Changing the loop test around 175 in download.py fixed this.

I still have the points file if you'd like to see it. I might still have the debug file? (Not entirely sure where it outputs to.) The actual crash error was something like "Non-BCD argument C in AC", unpackBCD called from pack_coord called from lat = pack_coord(b"\x00" + lat0, b'S'). Also, using Windows 2000 and cxfreeze as per the instructions.

Port can't be opened on Ubuntu 12.04

I am using Ubuntu 12.04. I have used the PPA to successfully install the schwinn810 software and I have run the command to configure it (that all works). However, when I run the following command:

sudo ./download.py -port /dev/schwinn810 -dir /home/mike/GPSData >/home/mike/GPSData/schwinn810.log 2>&1

I get the following error:

CRITICAL:main:Port can't be opened :(
schwinn810 Copyright (C) 2012 Mikhail Titov

How do I configure the usb to be recognized as a port?

Mike Chrisman

--Delete?

This switch doesn't seem to delete the data after import. I can manually go into the watch settings to delete the data, but I was hoping to be able to have the tool delete the run data after I download it.

newbie linux person with port error

Based on what I have read online about linux, I think I installed schwinn810 properly. I typed in "schwinn810" from the terminal and got the port and permission denied errors talked about on another thread. However, I don't know my way around Linux very well. Can you walk me through step-by-step on how to run the software?

Can we guess sport/activity for TCX from stats?

Unfortunately there is no way to tell ahead what that track is all about. It might be possible to deduce it for a particular user from one's track statistics. If median speed & IQR are somewhat high, we are probably biking, otherwise running.

Here is the pic with some stats. Red line results from natural breaks (jenks) split of mean speed into 2 classes.

stats

library(ggplot2)
library(classInt)

root <- "~/Documents/My Runs"
trk.lst <- list.files(root, "*.track$", full.names=TRUE, recursive=TRUE)

trk <- lapply(lapply(trk.lst, read.csv),
              function(x) {
                  x["x1"] <- NULL
                  x
              })
trk.all <- do.call(rbind, trk)

s <- with(all, Speed[Speed>0])
c <- classIntervals(s, 2, "jenks")
threshold <- c$brks[2]

pts.lst <- list.files(root, "*.points$", full.names=TRUE, recursive=TRUE)
pts <- lapply(pts.lst, read.csv, colClasses=c(Track="factor"))
pts.all <- do.call(rbind, pts)

ggplot(pts.all, aes(x=Track, y=Speed)) +
    geom_boxplot() + stat_summary(fun.y=mean, geom="point", shape=23) +
    geom_hline(aes(yintercept=threshold), colour="red") +
    theme_bw()

Broken postinst on Ubuntu 12.04

Running Ubuntu 12.04; sorry, can't figure out how to format code here...

  • Using ppas for install fails at configuration.
The following NEW packages will be installed:
  schwinn810
0 upgraded, 1 newly installed, 0 to remove and 295 not upgraded.
Need to get 0 B/12.1 kB of archives.
After this operation, 139 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package schwinn810.
(Reading database ... 231708 files and directories currently installed.)
Unpacking schwinn810 (from .../schwinn810_0.1-1_all.deb) ...
Setting up schwinn810 (0.1-1) ...
/var/lib/dpkg/info/schwinn810.postinst: 14: /var/lib/dpkg/info/schwinn810.postinst: [[: not found
/var/lib/dpkg/info/schwinn810.postinst: 27: /var/lib/dpkg/info/schwinn810.postinst: [[: not found
/var/lib/dpkg/info/schwinn810.postinst: 38: /var/lib/dpkg/info/schwinn810.postinst: Bad substitution
dpkg: error processing schwinn810 (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 schwinn810
E: Sub-process /usr/bin/dpkg returned an error code (1)

Seems that all files except schwinn.conf are installed though.

  • Importing a kml file (I wasn't able to use babelize.cmd directly because of the lack of a schwinn.conf file, but used the command from that file) into google maps doesn't generate one track. Instead, it imports and displays every data point as a way point.

The gpx file that's generated works well with uTrack, though the speeds are off (pretty sure I wasn't averaging 82 mph on my bike). Thanks for the effort on this!

path error in PPA/debian installation

The current version (0.2.0) of the PPA installs its files to /share/schwinn810 rather than /usr/share/schwinn810. Since all internal absolute paths expect files to be in /usr/share, things aren't usable when installed (unless previous versions of the files are hanging around in /usr/share?)

How to get started on Windows?

I have a Schwinn 810. I am a windows 7 user but don't have a clue how to download and use this software. I'm new to github and I am not a developer. Are there instructions anywhere?

On a side note - may or may not be helpful. I have figured out how to directly access the database created by the schwinn software. The data can be easily converted to CSV, then anyone with some programming skills can convert the data to GPX or TCX etc. I don't have the programming skills to do it but it should be quite simple. I'd like to see it in a simple to use GUI program. I'd be happy to provide the method and password to access the hidden database.

no errors but not working

I'm having problems extracting data from my watch.
I bought that watch from french supermarket Carrefour and installed the driver as described in https://github.com/mlt/schwinn810/wiki/Windows
The watch is detected and everything is fine but when I run download.exe --port COM3 the file waypoints.csv is empty.

The command output:
schwinn810 Copyright (C) 2012 Mikhail Titov

This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under the terms of GPL-3 or later version.

WARNING:core.device:File a bug if you are not using Cresta or Mio watch!
Fetching track 0720101 [1/2] with 64 points
0%
Fetching track 0722101 [2/2] with 619 points
0%
16%
32%
48%
65%
81%
97%
Done

The file *.points has the information but the other one not. Could you help me?

Revert to python2

Python 3 modules pytz and oauth are missing badly in common GNU/Linux distributions. Even pip I have pre-installed is for python 2.

Lack of forum/mailing list?

Please comment / suggest if it would be nice to have one. I have no time and resources to set up something fancy. I would prefer NNTP news but I'm not aware where would I host that. Google Groups is nice but those are hard (i.e. impossible with Emacs/Gnus) to read and do not support threading. Though perhaps would work for the first time anyway.

Tracks cut short

Tracks downloaded are incomplete when compared to tracks downloaded from OEM Software. The ride ends a mile or two early.
I have only had one track that I know of that has had this problem.
from OEM software download: https://dl.dropbox.com/u/19832238/Complete.TCX
From Here: https://dl.dropbox.com/u/19832238/incomplete.TCX

FYI, This track showed incorrect before and after the elevation fix so that change is unrelated.

Here is the debug: https://dl.dropbox.com/u/19832238/schwinn810Incomplete.bin

Managed to make it work on Ubuntu 12.10, but there is a bug line 67 in reader_cresta.py

Hi,
I have a watch sold by french supermarket Carrefour, that can use the Redclover software under windows, so I decided to have a look at your work on linux

I tried to install you driver on Ubuntu 12.10 but it is not working straightforward.
First, there is no automatic recognition when plugin it in.

  1. I had to comment all lines related to "checkpoints" in device.py
  2. Modified line 67 of reader_cresta.py:
       return {'Track': track_name, 'Points': pts, 'Start': date(2000+yr1, mm1, dd1)}

by

        return {'Track': track_name, 'Points': pts, 'Start': datetime(2000+yr1, mm1, dd1, hr1, min1, 0)}

otherwise it returns an error in another script as the return 'Start' value was a date type instead of a datetime type who are 2 differents types.

as the driver is not working automaticly, I manually download the tracks from the watch and then create the tcx manually as follow :

sudo /usr/share/schwinn810/download.py --port /dev/ttyUSB0
/usr/share/schwinn810/csv2tcx.py 0609102.points > 0609102.tcx

For information, lsusb returns :

Bus 005 Device 003: ID 10c4:ea61 Cygnal Integrated Products, Inc. CP210x UART Bridge

thanks for the driver anyway, that is just my small contribution for some who may try to use their watch under linux and still get issues

Stops within a track are not respected while producing TCX

I had a weird occurrence yesterday : When I imported my data I noticed only half of my ride was in the tcx file, even though the .points file shows my actual last location. During my ride I did stop a few times and I hit stop (without saving the data) then I re-started (new lap) and eventually saved the data at the end of the whole ride. I;m guessing that this created a situation that csv2tcx didn't like because it only converted my ride up until my stop.

Any idea if I can get csv2tcx to use only the .points file, without the .lap file? I'm not even sure if there is data missing from the lap file because trainingpeaks shows 8 laps while the watch says it recorded 14 laps.

Any insight would be appreciated.

Otherwise everything works great. Last time I stopped I saved the data then I was able to combine the 2 tcx files I created on one run. I will do this from now on to avoid errors like this.

MapMyFitness Speed Data Missing

It seems that when gpsbabel converts from the .points file into the .tcx file using babelize.sh that the speed or pace data doesn't work when imported into mapmyfitness. I can give you an example of the files I've been trying to upload if you would like.

I'm using Ubuntu 11.10 with python3 and python3-serial installed and the data transfer from the device is flawless so far, so thank you for your excellent work.

modemmanager interferes resulting in inability to open port and SerialException

Modem manager in Ubuntu GNU/Linux gets in the way. This results in intermittent automatic data extraction. One usually sees that as "Port can't be opened". SerialException details say "Device or resource busy". PID of modem-manager can be found using sudo fuser /dev/ttyUSB0 when this happens.

Looks like gpsd is irrelevant since product id in this watch is 0xea61 and not 0xea60 which is affected according to /lib/udev/rules.d/40-gpsd.rules from gpsd.

See also debian bug.

This might be related to symptoms described in issue #24.

Missing Cresta PM808 support

I bought a Cresta PM808 GPS watch and I think that the watch is from the NEWCO family. I can read data from the included software (from NEWCO) and from the MIO software. So I think my watch has the same communication like the MIO. I have installed the CP210x USB to UART Bridge and can communicate via this port.

But your software replies mistakes. Maybe the same problem like MIO.

I made this on you advice:
...
Another alternative is to leave everything as is and make sure you have a --debug option in your schwinn810.cmd . With that option you should get schwinn810.bin in your temporary folder like %USERPROFILE%\Local Settings\TEMP . See [2] for details. Apparently this file is incomplete but there is a chance that it has enough data for me to see what needs to be adjusted. Just send me that file. It is probably just 72 bytes long or alike.
...
Send you the schwinn810.bin via mail

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.