Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

Crash when connecting with Garmin Fenix 5 #23

Open
catteneo opened this issue Sep 29, 2020 · 2 comments
Open

Crash when connecting with Garmin Fenix 5 #23

catteneo opened this issue Sep 29, 2020 · 2 comments

Comments

@catteneo
Copy link

catteneo commented Sep 29, 2020

Description
While trying to connect zwifit (connected with Proform 995i via BLE) with a Garmin Fenix 5 got a crash on the zwifit app.
This would be useful to perform a Garmin Coach training plan workout.

Steps To Reproduce

  1. Connect the treadmill with Zwifit via BLE
  2. Activate the Run-Speed-Cadence profile
  3. In the watch add zwifit as a sensor
  4. Start a treadmill activity
  5. Zwifit crash

Expected behavior
Should work as with zwift

Logs
0|app | Connected to Zwift (watch MAC address)
0|app | RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 3. Received 4
0|app | at boundsError (internal/buffer.js:77:9)
0|app | at Buffer.readUInt8 (internal/buffer.js:243:5)
0|app | at parseCommandHeader (/home/pi/zwifit/src/ble/ifit/_request.js:707:29)
0|app | at /home/pi/zwifit/src/ble/ifit/_request.js:166:18
0|app | at Characteristic.listener (/home/pi/zwifit/src/ble/ifit/_request.js:657:4)
0|app | at Characteristic.emit (events.js:327:22)
0|app | at Noble.onRead (/home/pi/zwifit/node_modules/noble/lib/noble.js:414:20)
0|app | at NobleBindings.emit (events.js:315:20)
0|app | at NobleBindings.onNotification (/home/pi/zwifit/node_modules/noble/lib/hci-socket/bindings.js:448:8)
0|app | at Gatt.emit (events.js:315:20) {
0|app | code: 'ERR_OUT_OF_RANGE'
0|app | }

Debug
Added printing to the buffer:
0|app | writeRequestAndGatherResponse: 4
0|app | writeRequestAndGatherResponse: <Buffer 01 00 00 00>

So tried to discard packets with size <= 4 (is set to <4 only)
https://github.com/dawsontoth/zwifit/blob/master/src/ble/ifit/_request.js#L698

But started to get random disconnects from treadmill as soon as the activity on the watch starts

@catteneo
Copy link
Author

@RasPelikan can you give this a look?

@catteneo
Copy link
Author

catteneo commented Nov 2, 2020

@dawsontoth & @RasPelikan
anything?

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

No branches or pull requests

1 participant