Giter VIP home page Giter VIP logo

fit4ruby's People

Contributors

jpablobr avatar karl-petter avatar masneyb avatar scrapper avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

fit4ruby's Issues

Package fit4ruby for Debian

As a prerequisite to complete Package postrunner for Debian #27, fit4ruby needs to be packaged for Debian first.

Just like with the issue linked above, my intention is to make this happen. The almost two weeks which have passed between posting that first ticket and this one gives an indication that this might take a while, as my priorities are set to merely allow working a bit on this while my Garmin watch is charging. Although eventually we should get there.

To avoid potential duplication of effort, this ticket is filed to:

  • Ask whether @scrapper or anyone else has knowledge about an already started packaging effort?
  • To track the progress of my attempt at the task.

Header size 12 byted

According to section 3.3.1 in the Flexible and Interoperable Data Transfer Protocol Rev 2.2 document the header size can be either 12 bytes or 14. Though in the FitHeader.rb file the check prints an error message if the size is not 14. https://github.com/scrapper/fit4ruby/blob/master/lib/fit4ruby/FitHeader.rb#L30

The error message is "Unsupported header size #{@header.header_size}". Is this intended to warn in the case the header size is 12 bytes or does it mean one tries to parse a faulty file?

NaN issue when importing from a gpx

Hi I'm pursuing the import from gpx feature.
It's starting to give some results. I have a problem with Nan value.
/var/lib/gems/2.3.0/gems/fit4ruby-1.4.0/lib/fit4ruby/GlobalFitMessage.rb:121:in `to_i': NaN (FloatDomainError)
I'm not sure why and what is happening. I want to ask your expertise about if my fix makes sense? Or should I understand why these NaN values appears?
Thanks for your comments.

'Undocumented value 2156' assigned to field garmin_product

Hi, I am trying to alter a fit file activity recorded with an FR630. I would like to add an event (recovery_hr). Currently I tried to read the data and immediately (without updating) write back to a new file but I receive the following error.

Thanks

Unknown value 'Undocumented value 2156' assigned to field garmin_product
Traceback (most recent call last):
4: from test.rb:57:in <main>' 3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/fit4ruby-3.3.0/lib/fit4ruby.rb:22:in write'
2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/fit4ruby-3.3.0/lib/fit4ruby/FitFile.rb:102:in write' 1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/fit4ruby-3.3.0/lib/fit4ruby/Activity.rb:296:in write'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/fit4ruby-3.3.0/lib/fit4ruby/Activity.rb:296:in `sort': comparison of Fit4Ruby::PhysiologicalMetrics with Fit4Ruby::Lap failed (ArgumentError)

Unsupported headers in new FIT files

Hi

Parsing a customers FIT files from a Garmin 935 device. During the summer there has been some errors like this.

Any idea what type of file it can be?

irb(main):001:0> require 'fit4ruby'
=> true
irb(main):002:0> a = Fit4Ruby.read('garmintest.FIT')
Unknown field number 31 in global message 23
Unknown FIT record field 'field31' in global message device_info (23).
Unknown FIT record field 'field31' in global message device_info (23).
Unknown FIT record field 'field31' in global message device_info (23).
Unknown FIT record field 'field31' in global message device_info (23).
Unknown FIT record field 'field31' in global message device_info (23).
Unknown FIT record field 'field31' in global message device_info (23).
Unknown field number 59 in global message 147
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown FIT record field 'field59' in global message sensor_settings (147).
Unknown global message number 207
Unknown field number 0 in global message 207
Unknown field number 1 in global message 207
Unknown field number 4 in global message 207
Unknown field number 2 in global message 207
Unknown field number 3 in global message 207
Unknown global message number 206
Unknown field number 3 in global message 206
Unknown field number 8 in global message 206
Unknown field number 13 in global message 206
Unknown field number 14 in global message 206
Unknown field number 0 in global message 206
Unknown field number 1 in global message 206
Unknown field number 2 in global message 206
Unknown field number 6 in global message 206
Unknown field number 7 in global message 206
Unknown field number 15 in global message 206
Support for compressed headers not yet implemented
Fit4Ruby::Error: Support for compressed headers not yet implemented

error when importing - Stryd related

Since I added the Stryd footpod, postrunner trigger a bug, I guess it's in fit4ruby.
I tried to run the master branch, without any more luck.

Any idea? the error is below;
ERROR: Rename field 'offset' in BinData::Struct, as it shadows an existing method.
/var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/struct.rb:387:in block in ensure_field_names_are_valid' /var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/struct.rb:385:in each'
/var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/struct.rb:385:in ensure_field_names_are_valid' /var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/struct.rb:361:in sanitize_fields'
/var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/struct.rb:336:in sanitize_parameters!' /var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/sanitize.rb:278:in sanitize!'
/var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/sanitize.rb:197:in initialize' /var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/sanitize.rb:186:in new'
/var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/sanitize.rb:186:in sanitize' /var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/base.rb:279:in extract_args'
/var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/base.rb:249:in extract_args' /var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/base.rb:80:in initialize'
/var/lib/gems/2.3.0/gems/bindata-2.1.0/lib/bindata/warnings.rb:22:in initialize_with_warning' /var/lib/gems/2.3.0/gems/fit4ruby-1.6.1/lib/fit4ruby/FitMessageRecord.rb:164:in new'
/var/lib/gems/2.3.0/gems/fit4ruby-1.6.1/lib/fit4ruby/FitMessageRecord.rb:164:in produce' /var/lib/gems/2.3.0/gems/fit4ruby-1.6.1/lib/fit4ruby/FitMessageRecord.rb:41:in initialize'
/var/lib/gems/2.3.0/gems/fit4ruby-1.6.1/lib/fit4ruby/FitRecord.rb:49:in new' /var/lib/gems/2.3.0/gems/fit4ruby-1.6.1/lib/fit4ruby/FitRecord.rb:49:in read'
/var/lib/gems/2.3.0/gems/fit4ruby-1.6.1/lib/fit4ruby/FitFile.rb:59:in read' /var/lib/gems/2.3.0/gems/fit4ruby-1.6.1/lib/fit4ruby.rb:18:in read'
/var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner/Main.rb:476:in import_fit_file' /var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner/Main.rb:464:in process_file'
/var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner/Main.rb:449:in block in process_files' /var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner/Main.rb:443:in each'
/var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner/Main.rb:443:in process_files' /var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner/Main.rb:347:in execute_command'
/var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner/Main.rb:77:in main' /var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner.rb:24:in module:PostRunner'
/var/lib/gems/2.3.0/gems/postrunner-0.8.1/lib/postrunner.rb:22:in <top (required)>' /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' /var/lib/gems/2.3.0/gems/postrunner-0.8.1/bin/postrunner:4:in <top (required)>'
/usr/local/bin/postrunner:22:in load' /usr/local/bin/postrunner:22:in

'


You have triggered a bug in PostRunner 0.8.1!

Undefined method top_level_record

I receive the following error when reading files that are of a short duration:
NoMethodError: undefined method `top_level_record' for nil:NilClass

The gem works really good for normal runs, cycling sessions, triathlons... but it's not working for files with a short duration. My question is now can someone tell me whats the difference between those fit files?

Is the bundler dependency needed in the gemspec?

Hi,

I found your lib for a project that I'm working on, http://www.peppster.com. I think it can be quite useful and we are happy to help out improving and contribute with any changes. One thing I noted was that in the gemspec file, you have included a dependency to bundler. And for version 1.6. Any specific reason?

I encountered this problem when I ran bundle install:

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 1.6.4)

  Current Bundler version:
    bundler (1.12.5)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (~> 1.6.4)' in any of the sources

Correct CRC?

I have a file for which fit4ruby reports faulty CRC while other tools(http://pub.ks-and-ks.ne.jp/cycling/fitdump.shtml) report it as having correct CRC. The file is one of Garmins sample files for implementing support for Garmin Connect. Thus I expect the file to be correct and there is a bug in fit4ruby. So right now I'm looking into the CRC calculations and comparing it with the protocol documentation. I have not yet found the bug that is causing this problem but I think I found another bug.

The thing that I found while doing this is there seems to be an error how the header CRC is calculated. According to the specification(table 3-1) the header CRC: "Contains the value of the CRC (see section 3.3.2 ) of Bytes 0 through 11, or may be set to 0x0000. This field is optional." While looking into the code header crc is set to the CRC of the whole data section. See https://github.com/scrapper/fit4ruby/blob/master/lib/fit4ruby/FitFile.rb#L92

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.