Closed arutscheidt closed 5 months ago
Please upgrade. The latest version is 4.2.1 at the moment.
The version you are running lacks some very important updates.
If you still have an issue on that version, please start a verbose session with debug logging and share the redacted output.
Do I need a higher python version?
Ok, this is weird. I upgraded to 4.1.0. (Maybe 4.2.1 is with a higher python >3.8?)
The output looks the same This Withings metric contains no weight data. Not syncing...
but the import into Garmin was successfull.
Difference is at the end of the output
...
2023-10-25 09:25:01,811 - root - INFO - 2023-09-26 07:12:29 This Withings metric contains no weight data. Not syncing...
2023-10-25 09:25:01,816 - root - INFO - No blood pressure data to sync for FIT file
2023-10-25 09:25:01,817 - root - INFO - Writing jsonfile to .../Gewicht_2023-09-26.json.
2023-10-25 09:25:01,832 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
2023-10-25 09:25:06,656 - root - INFO - Fit file with weight information uploaded to Garmin Connect
So there was a fit file uploaded. What about the error message?
EDIT: Maybe the error disappears with the current version. So I have to check, how to upgrade python without crashing my system. (Had issues in the past :-) )
It should work jus fine with python 3.8 (for now).
Please paste the full debug/verbose log (but redact your login info). The above log does not show any issue.
I redacted sesitive data to ...
:
2023-10-26 11:16:42,712 - root - DEBUG - withings-sync script version 4.1.0
2023-10-26 11:16:42,712 - root - DEBUG - Script invoked with the following arguments: Namespace(garmin_username='...', garmin_password='...', trainerroad_username='', trainerroad_password='', fromdate=datetime.datetime(2023, 10, 26, 0, 0), todate=datetime.date(2023, 10, 26), to_fit=False, to_json=True, output='/srv/share/Withings/Gewicht_2023-10-26', no_upload=False, features=[], verbose=True)
2023-10-26 11:16:42,714 - withings - INFO - Refresh Access Token
2023-10-26 11:16:42,719 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2023-10-26 11:16:43,044 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /v2/oauth2 HTTP/1.1" 200 220
2023-10-26 11:16:43,050 - root - INFO - Fetching measurements from 2023-10-26 00:00 to 2023-10-26 23:59
2023-10-26 11:16:43,050 - withings - DEBUG - Get Height
2023-10-26 11:16:43,053 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2023-10-26 11:16:43,563 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/1.1" 200 337
2023-10-26 11:16:43,566 - withings - DEBUG - Height received
2023-10-26 11:16:43,566 - withings - INFO - Get Measurements
2023-10-26 11:16:43,568 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2023-10-26 11:16:43,855 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/1.1" 200 1769
2023-10-26 11:16:43,857 - withings - DEBUG - Measurements received
2023-10-26 11:16:43,857 - root - INFO - 2023-10-26 07:21:21 This Withings metric contains no weight data. Not syncing...
2023-10-26 11:16:43,857 - root - DEBUG - Pulse Wave Velocity: ... m/s
2023-10-26 11:16:43,857 - root - DEBUG - Vascular age: ... years
2023-10-26 11:16:43,857 - root - INFO - 2023-10-26 07:21:21 This Withings metric contains no weight data. Not syncing...
2023-10-26 11:16:43,857 - root - DEBUG - Pulse Wave Velocity: ... m/s
2023-10-26 11:16:43,858 - root - INFO - 2023-10-26 07:21:21 This Withings metric contains no weight data. Not syncing...
2023-10-26 11:16:43,858 - root - DEBUG - Heart Pulse: ... bpm
2023-10-26 11:16:43,858 - root - DEBUG - 2023-10-26 07:21:21 Detected data:
2023-10-26 11:16:43,858 - root - DEBUG - Weight: ... kg
2023-10-26 11:16:43,858 - root - DEBUG - Fat Mass Weight: ... kg
2023-10-26 11:16:43,858 - root - DEBUG - Muscle Mass: ... kg
2023-10-26 11:16:43,858 - root - DEBUG - Hydration: ... kg
2023-10-26 11:16:43,858 - root - DEBUG - Bone Mass: ... kg
2023-10-26 11:16:43,858 - root - DEBUG - Fat Ratio: ... %
2023-10-26 11:16:43,858 - root - DEBUG - Fat Free Mass: ... kg
2023-10-26 11:16:43,858 - root - DEBUG - Record: 2023-10-26 07:21:21, type=weight
height=... m, weight=... kg, fat_ratio=... %, muscle_mass=... kg, percent_hydration=... %, bone_mass=... kg, bmi=...
2023-10-26 11:16:43,858 - root - DEBUG - Processed data:
2023-10-26 11:16:43,858 - root - DEBUG - date_time=2023-10-26 07:21:21
2023-10-26 11:16:43,858 - root - DEBUG - height=...
2023-10-26 11:16:43,858 - root - DEBUG - weight=...
2023-10-26 11:16:43,858 - root - DEBUG - fat_ratio=...
2023-10-26 11:16:43,858 - root - DEBUG - muscle_mass=...
2023-10-26 11:16:43,858 - root - DEBUG - hydration=...
2023-10-26 11:16:43,859 - root - DEBUG - percent_hydration=...
2023-10-26 11:16:43,859 - root - DEBUG - bone_mass=...
2023-10-26 11:16:43,859 - root - DEBUG - pulse_wave_velocity=...
2023-10-26 11:16:43,859 - root - DEBUG - heart_pulse=...
2023-10-26 11:16:43,859 - root - DEBUG - bmi=...
2023-10-26 11:16:43,859 - root - DEBUG - raw_data=[<withings_sync.withings2.WithingsMeasure object at 0x7fc4f53e1660>, <withings_sync.withings2.WithingsMeasure object at 0x7fc4f53e30a0>, <withings_sync.withings2.WithingsMeasure object at 0x7fc4f53e3dc0>, <withings_sync.withings2.WithingsMeasure object at 0x7fc4f53e37f0>, <withings_sync.withings2.WithingsMeasure object at 0x7fc4f53e39d0>, <withings_sync.withings2.WithingsMeasure object at 0x7fc4f5464370>, <withings_sync.withings2.WithingsMeasure object at 0x7fc4f54648e0>]
2023-10-26 11:16:43,859 - root - DEBUG - type=weight
2023-10-26 11:16:43,859 - root - DEBUG - last_dt: 2023-10-26 07:21:21 last_weight: None
2023-10-26 11:16:43,859 - root - DEBUG - Generating fit data...
2023-10-26 11:16:43,859 - root - INFO - No blood pressure data to sync for FIT file
2023-10-26 11:16:43,859 - root - DEBUG - Fit data generated...
2023-10-26 11:16:43,859 - root - DEBUG - Generating json data...
2023-10-26 11:16:43,859 - root - DEBUG - Json data generated...
2023-10-26 11:16:43,860 - root - INFO - Writing jsonfile to /.../Gewicht_2023-10-26.json.
2023-10-26 11:16:43,862 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
2023-10-26 11:16:43,862 - root - DEBUG - attempting to upload fit file...
2023-10-26 11:16:43,865 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): thegarth.s3.amazonaws.com:443
2023-10-26 11:16:44,410 - urllib3.connectionpool - DEBUG - https://thegarth.s3.amazonaws.com:443 "GET /oauth_consumer.json HTTP/1.1" 200 124
2023-10-26 11:16:44,413 - requests_oauthlib.oauth1_auth - DEBUG - Signing request <PreparedRequest [POST]> using client <Client client_key=...secret=****, resource_owner_key=..., resource_owner_secret=****, signature_method=HMAC-SHA1, signature_type=AUTH_HEADER, callback_uri=None, rsa_key=None, verifier=None, realm=None, encoding=utf-8, decoding=utf-8, nonce=None, timestamp=None>
2023-10-26 11:16:44,413 - requests_oauthlib.oauth1_auth - DEBUG - Including body in call to sign: True
2023-10-26 11:16:44,414 - oauthlib.oauth1.rfc5849 - DEBUG - Collected params: [('oauth_nonce', '...'), ('oauth_timestamp', '1698311804'), ('oauth_version', '1.0'), ('oauth_signature_method', 'HMAC-SHA1'), ('oauth_consumer_key', '...'), ('oauth_token', '...')]
2023-10-26 11:16:44,414 - oauthlib.oauth1.rfc5849 - DEBUG - Normalized params: oauth_consumer_key=...&oauth_nonce=...&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1698311804&oauth_token=...&oauth_version=1.0
2023-10-26 11:16:44,414 - oauthlib.oauth1.rfc5849 - DEBUG - Normalized URI: https://connectapi.garmin.com/oauth-service/oauth/exchange/user/2.0
2023-10-26 11:16:44,415 - oauthlib.oauth1.rfc5849 - DEBUG - Signing: signature base string: ...h_version%3D1.0
2023-10-26 11:16:44,415 - oauthlib.oauth1.rfc5849 - DEBUG - Signature: ...
2023-10-26 11:16:44,415 - oauthlib.oauth1.rfc5849 - DEBUG - Encoding URI, headers and body to utf-8.
2023-10-26 11:16:44,415 - requests_oauthlib.oauth1_auth - DEBUG - Updated url: https://connectapi.garmin.com/oauth-service/oauth/exchange/user/2.0
2023-10-26 11:16:44,415 - requests_oauthlib.oauth1_auth - DEBUG - Updated headers: {b'User-Agent': b'com.garmin.android.apps.connectmobile', b'Accept-Encoding': b'gzip, deflate', b'Accept': b'*/*', b'Connection': b'keep-alive', b'Content-Type': b'application/x-www-form-urlencoded', b'Content-Length': b'0', b'Authorization': b'OAuth oauth_nonce="...", oauth_timestamp="1698311804", oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_consumer_key="...", oauth_token="...", oauth_signature="..."'}
2023-10-26 11:16:44,415 - requests_oauthlib.oauth1_auth - DEBUG - Updated body: ''
2023-10-26 11:16:44,416 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): connectapi.garmin.com:443
2023-10-26 11:16:45,100 - urllib3.connectionpool - DEBUG - https://connectapi.garmin.com:443 "POST /oauth-service/oauth/exchange/user/2.0 HTTP/1.1" 200 None
2023-10-26 11:16:45,253 - urllib3.connectionpool - DEBUG - https://connectapi.garmin.com:443 "GET /userprofile-service/socialProfile HTTP/1.1" 200 None
2023-10-26 11:16:45,257 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): connect.garmin.com:443
2023-10-26 11:16:46,119 - urllib3.connectionpool - DEBUG - https://connect.garmin.com:443 "POST /upload-service/upload/.fit HTTP/1.1" 201 385
2023-10-26 11:16:46,122 - root - INFO - Fit file with weight information uploaded to Garmin Connect
EDIT: I am so proud of my high quality measurement hardware. Some of the body values had 10 digits after the comma. it is sooo exact !1!11!
Your issue with connection to Garmin was solved with the upgrade.
The INFO messages you see in the output now are expected. For some reason Withings is saving a single reading from a scale in multiple entries in their cloud.
When parsing these entries, only the entries containing weight data are actually parsed, if no weight data is found, INFO is printed.
In your DEBUG output, you'll see 3 entries without weight data, so they are skipped, the 4th entry contains the data so it is parsed. I guess this issue can be closed.
2023-10-26 11:16:43,857 - root - INFO - 2023-10-26 07:21:21 This Withings metric contains no weight data. Not syncing...
2023-10-26 11:16:43,857 - root - DEBUG - Pulse Wave Velocity: ... m/s
2023-10-26 11:16:43,857 - root - DEBUG - Vascular age: ... years
2023-10-26 11:16:43,857 - root - INFO - 2023-10-26 07:21:21 This Withings metric contains no weight data. Not syncing...
2023-10-26 11:16:43,857 - root - DEBUG - Pulse Wave Velocity: ... m/s
2023-10-26 11:16:43,858 - root - INFO - 2023-10-26 07:21:21 This Withings metric contains no weight data. Not syncing...
2023-10-26 11:16:43,858 - root - DEBUG - Heart Pulse: ... bpm
2023-10-26 11:16:43,858 - root - DEBUG - 2023-10-26 07:21:21 Detected data:
2023-10-26 11:16:43,858 - root - DEBUG - Weight: ... kg
2023-10-26 11:16:43,858 - root - DEBUG - Fat Mass Weight: ... kg
Same problem here, latest docker image:
root@c11cf243bfad:/usr/local/bin# ./python withings-sync --gu "XXX" --gp "XXX" -f 2024-06-10 -t 2024-06-18 -v
2024-06-18 14:02:56,915 - root - DEBUG - Script invoked with the following arguments: Namespace(garmin_username='XXX', garmin_password='XXX', trainerroad_username='', trainerroad_password='', fromdate=datetime.datetime(2024, 6, 10, 0, 0), todate=datetime.datetime(2024, 6, 18, 0, 0), to_fit=False, to_json=False, output=None, no_upload=False, features=[], verbose=True)
2024-06-18 14:02:56,916 - withings - INFO - Refresh Access Token
2024-06-18 14:02:56,920 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-06-18 14:02:57,068 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /v2/oauth2 HTTP/1.1" 200 220
2024-06-18 14:02:57,072 - root - INFO - Fetching measurements from 2024-06-10 00:00 to 2024-06-18 23:59
2024-06-18 14:02:57,073 - withings - DEBUG - Get Height
2024-06-18 14:02:57,076 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-06-18 14:02:57,268 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/1.1" 200 338
2024-06-18 14:02:57,269 - withings - DEBUG - Height received
2024-06-18 14:02:57,274 - withings - INFO - Get Measurements
2024-06-18 14:02:57,278 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-06-18 14:02:57,439 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/1.1" 200 587
2024-06-18 14:02:57,440 - withings - DEBUG - Measurements received
2024-06-18 14:02:57,445 - root - DEBUG - 2024-06-18 13:17:01 Detected data:
2024-06-18 14:02:57,447 - root - DEBUG - Weight: 75.0 kg
2024-06-18 14:02:57,448 - root - DEBUG - Record: 2024-06-18 13:17:01, type=weight
height=1.79 m, weight=75.0 kg, fat_ratio=None %, muscle_mass=None kg, percent_hydration=None %, bone_mass=None kg, bmi=23.4
2024-06-18 14:02:57,448 - root - INFO - 2024-06-18 13:17:01 This Withings metric contains no weight data. Not syncing...
2024-06-18 14:02:57,449 - root - DEBUG - Height: 1.79 meter
2024-06-18 14:02:57,449 - root - ERROR - Invalid or no data detected
2024-06-18 14:02:57,449 - root - DEBUG - Generating fit data...
2024-06-18 14:02:57,450 - root - INFO - No weight data to sync for FIT file
2024-06-18 14:02:57,450 - root - INFO - No blood pressure data to sync for FIT file
2024-06-18 14:02:57,451 - root - DEBUG - Fit data generated...
2024-06-18 14:02:57,451 - root - DEBUG - Generating json data...
2024-06-18 14:02:57,451 - root - DEBUG - Json data generated...
2024-06-18 14:02:57,451 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
2024-06-18 14:02:57,452 - root - INFO - No Garmin username - skipping sync
Any idea what I should do?
I assume you're not using the latest docker image. Othervise, the version should be printed out.
Can you please doublecheck? you get the latest with docker pull ghcr.io/jaroslawhartman/withings-sync:master
or better docker pull ghcr.io/jaroslawhartman/withings-sync:v.4.2.4
.
I have explicitly pulled the 4.2.4 version (master does not exist?):
2024-06-20 13:34:57,431 - root - DEBUG - withings-sync script version 4.2.4
2024-06-20 13:34:57,432 - root - DEBUG - Script invoked with the following arguments: Namespace(garmin_username='XXX', garmin_password='XXX', trainerroad_username='', trainerroad_password='', fromdate=datetime.datetime(2024, 6, 10, 0, 0), todate=datetime.date(2024, 6, 20), to_fit=False, to_json=False, output=None, no_upload=False, features=[], verbose=True)
2024-06-20 13:34:57,432 - withings - INFO - Refresh Access Token
2024-06-20 13:34:57,435 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-06-20 13:34:57,647 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /v2/oauth2 HTTP/1.1" 200 220
2024-06-20 13:34:57,653 - root - INFO - Fetching measurements from 2024-06-10 00:00 to 2024-06-20 23:59
2024-06-20 13:34:57,653 - withings - DEBUG - Get Height
2024-06-20 13:34:57,657 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-06-20 13:34:57,827 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/1.1" 200 338
2024-06-20 13:34:57,828 - withings - DEBUG - Height received
2024-06-20 13:34:57,832 - withings - INFO - Get Measurements
2024-06-20 13:34:57,835 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): wbsapi.withings.net:443
2024-06-20 13:34:58,089 - urllib3.connectionpool - DEBUG - https://wbsapi.withings.net:443 "POST /measure?action=getmeas HTTP/1.1" 200 587
2024-06-20 13:34:58,091 - withings - DEBUG - Measurements received
2024-06-20 13:34:58,096 - root - DEBUG - 2024-06-18 13:17:01 Detected data:
2024-06-20 13:34:58,097 - root - DEBUG - Weight: 75.0 kg
2024-06-20 13:34:58,097 - root - DEBUG - Record: 2024-06-18 13:17:01, type=weight
height=1.79 m, weight=75.0 kg, fat_ratio=None %, muscle_mass=None kg, percent_hydration=None %, bone_mass=None kg, bmi=23.4
2024-06-20 13:34:58,097 - root - INFO - 2024-06-18 13:17:01 This Withings metric contains no weight data. Not syncing...
2024-06-20 13:34:58,098 - root - DEBUG - Height: 1.79 meter
2024-06-20 13:34:58,098 - root - ERROR - Invalid or no data detected
2024-06-20 13:34:58,098 - root - DEBUG - Generating fit data...
2024-06-20 13:34:58,099 - root - INFO - No weight data to sync for FIT file
2024-06-20 13:34:58,099 - root - INFO - No blood pressure data to sync for FIT file
2024-06-20 13:34:58,099 - root - DEBUG - Fit data generated...
2024-06-20 13:34:58,099 - root - DEBUG - Generating json data...
2024-06-20 13:34:58,099 - root - DEBUG - Json data generated...
2024-06-20 13:34:58,100 - root - INFO - No TrainerRoad username or a new measurement - skipping sync
2024-06-20 13:34:58,100 - root - INFO - No Garmin username - skipping sync
I have just realized that there should be a second datapoint of today - but there isn't. Hence, there is most likely a problem with the scale not synchronizig. I will check that and report back.
There was indeed a problem with the synchronization. Sorry for the noise!
Hello everybody,
I use Withings-Sync inside a Shell script triggered by a cron job.
script:
The script stopped working since 25th Sept 2023. Today I started it manually and all I get is the following message for every day:
Following some data:
Did the API change on Withings or Garmin?