droustchev / garmin_weight_sync

A Garmin ConnectIQ application to track weight
0 stars 0 forks source link

What is the status of this work piece? #5

Open weberk opened 9 months ago

weberk commented 9 months ago

Hi Dimitar,

nice idea, I just now already had.

I have seen you are using ActivityRecording.createSession({:name=>"Withings", :sport=>ActivityRecording.SPORT_GENERIC}); I assume this is nice to have it synced automatically to Garmin Connect, but it would end up as a FIT_FILE_ACTIVITY and not a weigh scale type FIT file type.

But maybe I am wrong. Please confirm the status of your work results.

Best regards - Klaus.

typedef enum {
    FIT_FILE_INVALID = FIT_ENUM_INVALID,
    FIT_FILE_DEVICE = 1,                    // Read only, single file. Must be in root directory.
    FIT_FILE_SETTINGS = 2,                  // Read/write, single file. Directory=Settings
    FIT_FILE_SPORT = 3,                     // Read/write, multiple files, file number = sport type. Directory=Sports
    FIT_FILE_ACTIVITY = 4,                  // Read/erase, multiple files. Directory=Activities
    FIT_FILE_WORKOUT = 5,                   // Read/write/erase, multiple files. Directory=Workouts
    FIT_FILE_COURSE = 6,                    // Read/write/erase, multiple files. Directory=Courses
    FIT_FILE_SCHEDULES = 7,                 // Read/write, single file. Directory=Schedules
    FIT_FILE_WEIGHT = 9,                    // Read only, single file. Circular buffer. All message definitions at the start of the file. Directory=Weight
    FIT_FILE_TOTALS = 10,                   // Read only, single file. Directory=Totals
    FIT_FILE_GOALS = 11,                    // Read/write, single file. Directory=Goals
    FIT_FILE_BLOOD_PRESSURE = 14,           // Read only. Directory=Blood Pressure
    FIT_FILE_MONITORING_A = 15,             // Read only. Directory=Monitoring. File number=sub type.
    FIT_FILE_ACTIVITY_SUMMARY = 20,         // Read/erase, multiple files. Directory=Activities
    FIT_FILE_MONITORING_DAILY = 28,
    FIT_FILE_MONITORING_B = 32,             // Read only. Directory=Monitoring. File number=identifier
    FIT_FILE_SEGMENT = 34,                  // Read/write/erase. Multiple Files. Directory=Segments
    FIT_FILE_SEGMENT_LIST = 35,             // Read/write/erase. Single File. Directory=Segments
    FIT_FILE_EXD_CONFIGURATION = 40,        // Read/write/erase. Single File. Directory=Settings
    FIT_FILE_MFG_RANGE_MIN = 0xF7,          // 0xF7 - 0xFE reserved for manufacturer-specific file types
    FIT_FILE_MFG_RANGE_MAX = 0xFE           // 0xF7 - 0xFE reserved for manufacturer-specific file types
} FIT_FILE;
weberk commented 9 months ago

It might be feasible to make the ConnectIQ-App login in Garmin Connect via OAuth and upload a FIT file of ANY type to the account of the logged in user. See https://developer.garmin.com/connect-iq/core-topics/authenticated-web-services/

I your watch has WIFI or is connected to your phone this should be an option to proceed, because similar convenient as your current approach.

droustchev commented 9 months ago

Hey there,

Thanks for your interest and suggestions. As far as I'm aware, the Connect API on wearable devices doesn't allow creating FIT files other than through activities, and as such is limited to SPORT_* types. See also the official API docs. Unfortunately, it doesn't seem possible to record the right messages into the Activity FIT file on the device for weigh ins.

I've also come across your second suggestion already and in fact there are several options out there that already do this, albeit not from a wearable. Given that you can't create the right FIT file on a wearable, I don't think it makes sense to upload it from it either. In addition, there are no public Garmin APIs either. The APIs offered are for businesses and not for personal use, so all the existing solutions are relying on reverse engineered APIs that Garmin could change at any moment.

I mainly used this as a hobby project to get a better understanding of Connect IQ and writing applications for Garmin wearables. I might revisit this, but haven't had a chance to work on this lately.

weberk commented 8 months ago

Hi Dimitar, I succeded to compile FIT files on the watch. Second to send them to the Garmin account oft he logged in user. Furthermore I partnered with Josef the developer who implemented the ANT+ reading of the Tanita BC 1000 weight scale on the watch. Just wanted to ask you if you would like to join our project for contribution here on Github, since your interests with bringing Withings weight scale data to Garmin is very similar. You might want to look at the current version on https://apps.garmin.com/en-US/apps/1c02ac65-70c5-440e-a6e6-f4a706c8deb0

droustchev commented 7 months ago

Hi Dimitar, I succeded to compile FIT files on the watch. Second to send them to the Garmin account oft he logged in user. Furthermore I partnered with Josef the developer who implemented the ANT+ reading of the Tanita BC 1000 weight scale on the watch. Just wanted to ask you if you would like to join our project for contribution here on Github, since your interests with bringing Withings weight scale data to Garmin is very similar. You might want to look at the current version on https://apps.garmin.com/en-US/apps/1c02ac65-70c5-440e-a6e6-f4a706c8deb0

Interesting!

I'll check out the app! I did before the holidays, but the token acquisition was not working for me. I just saw that you pushed several updates over the past couple of weeks, so I'll give it another look. I'd be happy to contribute where I can. Not sure how much time I can dedicate to this at the moment though.