p00ya / vivian

app to download Viiiiva heart rate logs over Bluetooth
https://p00ya.github.io/vivian
Apache License 2.0
4 stars 0 forks source link

Connecting to different Viiiiva sensors #1

Closed ACHIEVE-Performance closed 1 year ago

ACHIEVE-Performance commented 1 year ago

Vivtools appears to work well with one Viiiiva, but will only work on the first sensor it is connected to. To be clear, this is what we and another tester encountered

  1. Connect to Viiiiva device 1.
  2. List, copy files etc from Viiiiva device 1
  3. Bring other Viiiivas (e.g. Viiiiva device 2, Viiiva device 3, Viiiiva device 4) into range and attempt to connect, but all time out.
  4. Device 1 can still connect
  5. To make sure Device 1 isn't causing "interference", we pull the battery on Device 1 and the other devices can still not connect.

As I say, another group who is testing is also seeing the same thing. We would love to be able to use vivtools, but need to overcome this issue.

Thanks,

p00ya commented 1 year ago

Hi, thanks for the report.

Can you confirm that you were using the -u <uuid> flag to attempt to connect to devices 2+?

ACHIEVE-Performance commented 1 year ago

Thanks for the response.

No, we did not use that flag, because we didn't see documentation to do so.

Steve

Stephen J. McGregor, Ph.D. CEO and Founder Sport Performance Technologies @.*** 734-635-1141

[cid:933ffc58-2a26-4172-b264-103f5d70a73c]


From: Dean Scarff @.> Sent: Wednesday, July 19, 2023 12:29 AM To: p00ya/vivian @.> Cc: Steve McGregor @.>; Author @.> Subject: Re: [p00ya/vivian] Connecting to different Viiiiva sensors (Issue #1)

Hi, thanks for the report.

Can you confirm that you were using the -u flag to attempt to connect to devices 2+?

— Reply to this email directly, view it on GitHubhttps://github.com/p00ya/vivian/issues/1#issuecomment-1641393861, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZFCA2JVFCMES3IXYKRB6Y3XQ5PCHANCNFSM6AAAAAA2JYI3ZQ. You are receiving this because you authored the thread.Message ID: @.***>

p00ya commented 1 year ago

No problems. The flag is documented in the man page (man ./vivtool/vivtool.1 from the repo root), but it's not supposed to be mandatory. What you've encountered still sounds like a bug, because vivtool is meant to fall back to a BLE scan for new devices if it can't find the last-used device.

So for now, there are two workarounds: use the -u flag to connect to a particular device, or use defaults delete vivtool LastConnectedDeviceUuid to reset the cached UUID when switching devices.

Meanwhile I'll try and fix the bug so that switching devices just works even without the -u flag / defaults workaround.

Best regards

ACHIEVE-Performance commented 1 year ago

Dean,

Thank you very much for the responsiveness and help. My developer won't be able to try this until early next week, so, I'll report back then.

Thanks again, Steve

Stephen J. McGregor, Ph.D. CEO and Founder Sport Performance Technologies @.*** 734-635-1141

[cid:6dfbcd7a-6779-4e46-b8cf-a95f11755086]


From: Dean Scarff @.> Sent: Wednesday, July 19, 2023 8:53 PM To: p00ya/vivian @.> Cc: Steve McGregor @.>; Author @.> Subject: Re: [p00ya/vivian] Connecting to different Viiiiva sensors (Issue #1)

No problems. The flag is documented in the man page (man ./vivtool/vivtool.1 from the repo root), but it's not supposed to be mandatory. What you've encountered still sounds like a bug, because vivtool is meant to fall back to a BLE scan for new devices if it can't find the last-used device.

So for now, there are two workarounds: use the -u flag to connect to a particular device, and/or use defaults delete vivtool LastConnectedDeviceUuid to reset the cached UUID when switching devices.

Meanwhile I'll try and fix the bug so that switching devices just works even without the -u flag.

Best regards

— Reply to this email directly, view it on GitHubhttps://github.com/p00ya/vivian/issues/1#issuecomment-1642950279, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZFCA2NLGDLDCS3IN55JXADXRB6PVANCNFSM6AAAAAA2JYI3ZQ. You are receiving this because you authored the thread.Message ID: @.***>

p00ya commented 1 year ago

I tried to repro this bug by:

  1. defaults write vivtool LastConnectedDeviceUuid with a UUID other than my Viiiiva's - this simulates having been previously connected to a device that's no longer present.
  2. Wear my Viiiiva, ensure Bluetooth is enabled on my computer.
  3. vivtool ls -v

vivtool falls back to a scan and finds the device I'm wearing even though it's wasn't the cached UUID. So it seems like vivtool is working as intended here - this is equivalent to successfully connecting to Device 2 in the original report.

However, I'm unable to test with multiple real devices, so perhaps there is something deeper going on at the macOS/CoreBluetooth layers that is caching previously connected devices and preventing discovery.

I've also created released a new version (v1.1.0) that has a vivtool scan command.

It should print out the names and UUIDs of nearby HRMs. This can be used to identify the UUIDs to use with the -u option.

Stephen: when your devs get a chance, please ask them:

If vivtool is still not able to connect to devices 2+ when following those instructions, then please provide the terminal history of those commands and the output, along with the macOS version and the version of the Viiiiva reported in the official 4iiii app to assist me with debugging.

ACHIEVE-Performance commented 1 year ago

Dean,

Thanks so much for this and your continued assistance. We will be trying several separate devices and your suggestions over the next day or so and I'll get back with the results.

Steve

Stephen J. McGregor, Ph.D. CEO and Founder Sport Performance Technologies @.*** 734-635-1141

[cid:6e33a26f-a36f-4a3a-b205-9a85eaa642fe]


From: Dean Scarff @.> Sent: Sunday, July 23, 2023 7:46 AM To: p00ya/vivian @.> Cc: Steve McGregor @.>; Author @.> Subject: Re: [p00ya/vivian] Connecting to different Viiiiva sensors (Issue #1)

I tried to repro this bug by:

  1. defaults write vivtool LastConnectedDeviceUuid with a UUID other than my Viiiiva's - this simulates having been previously connected to a device that's no longer present.
  2. Wear my Viiiiva, ensure Bluetooth is enabled on my computer.
  3. vivtool ls -v

vivtool falls back to a scan and finds the device I'm wearing even though it's wasn't the cached UUID. So it seems like vivtool is working as intended here - this is equivalent to successfully connecting to Device 2 in the original report.

However, I'm unable to test with multiple real devices, so perhaps there is something deeper going on at the macOS/CoreBluetooth layers that is caching previously connected devices and preventing discovery.

I've also created released a new version (v1.1.0) that has a vivtool scan command.

It should print out the names and UUIDs of nearby HRMs. This can be used to identify the UUIDs to use with the -u option.

Stephen: when your devs get a chance, please ask them:

If vivtool is still not able to connect to devices 2+ when following those instructions, then please provide the terminal history of those commands and the output, along with the macOS version and the version of the Viiiiva reported in the official 4iiii app to assist me with debugging.

— Reply to this email directly, view it on GitHubhttps://github.com/p00ya/vivian/issues/1#issuecomment-1646819015, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZFCA2NFU37R3HUYMWVGF5TXRUFIPANCNFSM6AAAAAA2JYI3ZQ. You are receiving this because you authored the thread.Message ID: @.***>

ACHIEVE-Performance commented 1 year ago

Dean,

I just wanted to check in and let you know that we've made good progress on this after your feedback. We're able to get data off of several different sensors and will be working toward various enhancements as we progress.

One question I wondered if you could help us with. One of the main reasons we want to use the Viiiva is as an Ant+ bridge. So, pairing another Ant sensor with the Viiiva and having the Viiiva write the other sensor's data to its fit file. For example, pair a power meter with the Viiiva and once paired, the Viiiva will write the power data to the Viiiva's fit file, in addition to the HR data. Pairing the other ant sensor with the Viiiva can be done with the 4iiii app, but we'd like to be able to do it with multiple sensors, just like we are with the other commands. I don't suppose you would have any idea how that could be accomplished would you? We couldn't find anything in your manual, but I honestly didn't expect to.

Again, thank you for your assistance, this is starting to look promising.

Steve

Stephen J. McGregor, Ph.D. CEO and Founder Sport Performance Technologies @.*** 734-635-1141

[cid:4a5b3afa-8501-4cb2-9f51-8d907b17f822]


From: Dean Scarff @.> Sent: Sunday, July 23, 2023 7:46 AM To: p00ya/vivian @.> Cc: Steve McGregor @.>; Author @.> Subject: Re: [p00ya/vivian] Connecting to different Viiiiva sensors (Issue #1)

I tried to repro this bug by:

  1. defaults write vivtool LastConnectedDeviceUuid with a UUID other than my Viiiiva's - this simulates having been previously connected to a device that's no longer present.
  2. Wear my Viiiiva, ensure Bluetooth is enabled on my computer.
  3. vivtool ls -v

vivtool falls back to a scan and finds the device I'm wearing even though it's wasn't the cached UUID. So it seems like vivtool is working as intended here - this is equivalent to successfully connecting to Device 2 in the original report.

However, I'm unable to test with multiple real devices, so perhaps there is something deeper going on at the macOS/CoreBluetooth layers that is caching previously connected devices and preventing discovery.

I've also created released a new version (v1.1.0) that has a vivtool scan command.

It should print out the names and UUIDs of nearby HRMs. This can be used to identify the UUIDs to use with the -u option.

Stephen: when your devs get a chance, please ask them:

If vivtool is still not able to connect to devices 2+ when following those instructions, then please provide the terminal history of those commands and the output, along with the macOS version and the version of the Viiiiva reported in the official 4iiii app to assist me with debugging.

— Reply to this email directly, view it on GitHubhttps://github.com/p00ya/vivian/issues/1#issuecomment-1646819015, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZFCA2NFU37R3HUYMWVGF5TXRUFIPANCNFSM6AAAAAA2JYI3ZQ. You are receiving this because you authored the thread.Message ID: @.***>

p00ya commented 1 year ago

Closing this issue since it seems like the original report (not being able to connect to new devices) has been addressed.

Regarding the ability to pair ANT+ sensors to the Viiiiva: I think it would be feasible, but if it's anything like the file protocol that Viiiiva uses (which is non-standard) then it would require reverse engineering the BLE traffic from the Viiiiva app. Previously, I obtained BLE traffic using Android's HCI Snoop log. These days I don't have access to any ANT+ devices that I could test with (other than the Viiiiva itself). If you can provide me with suitable HCI logs (ideally with corresponding timestamps and screenshots of what you were doing in the Viiiiva app, the ANT+ IDs of the other sensors, etc.), then please file a new feature request with those things attached and I'll see what I can do. Alternatively, if you can organize the sensor hardware to be sent to Sydney and back, I could capture the BLE traffic myself.

ACHIEVE-Performance commented 1 year ago

Dean,

I'm not sure how I missed this response.... shoot... would have tried to set things up so we could pursue the ant+ pairing. I'll look at this response in more detail and see if we can figure something out.

Thanks again for your help.

Steve

Stephen J. McGregor, Ph.D. CEO and Founder Sport Performance Technologies @.*** 734-635-1141

[cid:b2669e6a-061c-4d39-89db-23c6b1a3be16]


From: Dean Scarff @.> Sent: Tuesday, August 22, 2023 12:25 AM To: p00ya/vivian @.> Cc: Steve McGregor @.>; Author @.> Subject: Re: [p00ya/vivian] Connecting to different Viiiiva sensors (Issue #1)

Closing this issue since it seems like the original report (not being able to connect to new devices) has been addressed.

Regarding the ability to pair ANT+ sensors to the Viiiiva: I think it would be feasible, but if it's anything like the file protocol that Viiiiva uses (which is non-standard) then it would require reverse engineering the BLE traffic from the Viiiiva app. Previously, I obtained BLE traffic using Android's HCI Snoop log. These days I don't have access to any ANT+ devices that I could test with (other than the Viiiiva itself). If you can provide me with suitable HCI logs (ideally with corresponding timestamps and screenshots of what you were doing in the Viiiiva app, the ANT+ IDs of the other sensors, etc.), then please file a new feature request with those things attached and I'll see what I can do. Alternatively, if you can organize the sensor hardware to be sent to Sydney and back, I could capture the BLE traffic myself.

— Reply to this email directly, view it on GitHubhttps://github.com/p00ya/vivian/issues/1#issuecomment-1687397113, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZFCA2I6YDQNTORM7KMGYMLXWQYE5ANCNFSM6AAAAAA2JYI3ZQ. You are receiving this because you authored the thread.Message ID: @.***>

ACHIEVE-Performance commented 11 months ago

Dean,

I thought about your last response and was considering sending you hardware, but we were able to grab logs using nrf sniffer. Your last response regarding the matter stated....

Regarding the ability to pair ANT+ sensors to the Viiiiva: I think it would be feasible, but if it's anything like the file protocol that Viiiiva uses (which is non-standard) then it would require reverse engineering the BLE traffic from the Viiiiva app. Previously, I obtained BLE traffic using Android's HCI Snoop log. These days I don't have access to any ANT+ devices that I could test with (other than the Viiiiva itself). If you can provide me with suitable HCI logs (ideally with corresponding timestamps and screenshots of what you were doing in the Viiiiva app, the ANT+ IDs of the other sensors, etc.), then please file a new feature request with those things attached and I'll see what I can do.

So, I think we'll file a feature request and see if that may bear fruit.

Thanks, Steve

Stephen J. McGregor, Ph.D. CEO and Founder Sport Performance Technologies @.*** 734-635-1141

[cid:152f2e49-6b17-450f-80f4-39786b997c4b]


From: Steve McGregor @.> Sent: Wednesday, November 1, 2023 6:30 PM To: p00ya/vivian @.> Subject: Re: [p00ya/vivian] Connecting to different Viiiiva sensors (Issue #1)

Dean,

I'm not sure how I missed this response.... shoot... would have tried to set things up so we could pursue the ant+ pairing. I'll look at this response in more detail and see if we can figure something out.

Thanks again for your help.

Steve

Stephen J. McGregor, Ph.D. CEO and Founder Sport Performance Technologies @.*** 734-635-1141

[cid:b2669e6a-061c-4d39-89db-23c6b1a3be16]


From: Dean Scarff @.> Sent: Tuesday, August 22, 2023 12:25 AM To: p00ya/vivian @.> Cc: Steve McGregor @.>; Author @.> Subject: Re: [p00ya/vivian] Connecting to different Viiiiva sensors (Issue #1)

Closing this issue since it seems like the original report (not being able to connect to new devices) has been addressed.

Regarding the ability to pair ANT+ sensors to the Viiiiva: I think it would be feasible, but if it's anything like the file protocol that Viiiiva uses (which is non-standard) then it would require reverse engineering the BLE traffic from the Viiiiva app. Previously, I obtained BLE traffic using Android's HCI Snoop log. These days I don't have access to any ANT+ devices that I could test with (other than the Viiiiva itself). If you can provide me with suitable HCI logs (ideally with corresponding timestamps and screenshots of what you were doing in the Viiiiva app, the ANT+ IDs of the other sensors, etc.), then please file a new feature request with those things attached and I'll see what I can do. Alternatively, if you can organize the sensor hardware to be sent to Sydney and back, I could capture the BLE traffic myself.

— Reply to this email directly, view it on GitHubhttps://github.com/p00ya/vivian/issues/1#issuecomment-1687397113, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZFCA2I6YDQNTORM7KMGYMLXWQYE5ANCNFSM6AAAAAA2JYI3ZQ. You are receiving this because you authored the thread.Message ID: @.***>

p00ya commented 11 months ago

Sounds good - it seems like https://github.com/p00ya/vivian/issues/2 is asking for this feature, so if you can either attach the logs there (or if you have any privacy concerns about dropping the raw logs on github, you can send them via email).