JohanDegraeve / xdripswift

xdrip for iOS, written in Swift
GNU General Public License v3.0
327 stars 321 forks source link

Direct connect Apple Watch #280

Open A-w-K opened 2 years ago

A-w-K commented 2 years ago

Would it be possible to use the Apple Watch as primary device and collect data from the sensor?

If it's possible I'll gladly support in developing the feature

wiegerthefarmer commented 2 years ago

I don't know if Apple has released that functionality in the watch. (the ability for the watch to connect to bluetooth devices). But I do think it's coming soon. There has been work in DiaBLE to have the watch connect directly to a libre patch that has bluetooth in it (Libre2,3,sense)

JtxGit commented 2 years ago

Yes, as @gui-dos said. Definitely also possible with Android and Wear OS. I'm running my Wear OS watch stand-alone after "creating" the BLE connection with my phone using NFC on the phone (since the Wear OS Android version does not (yet?) have the Android NFC code to scan NFC-V tags). The required parameters to connect over BLE is then simply sent from the phone to the wear device, which can then simply connect to the L2 sensor.

LiroyvH commented 2 years ago

Interestingly, this is probably possible with Anubis G6 as well since it supports three channels instead of two. (Pump + iPhone + Apple Watch could all independently connect to the transmitter). And for users without pump or reader, it can maybe also be done with official G6 transmitters, but that may pose a challenge since those channels are specifically targeted at one reader device and one smartphone. -edit- Actually we could have the Watch pretending to be a reader device.

tromanisagit commented 2 years ago

I'm not sure how they do it but ambrosia linkblucon does this. Ie scan on phone then move bt to watch.

LiroyvH commented 2 years ago

@tromanisagit They connect to their transmitter rather than the FSL. I've used their app in the past btw and it was extremely temperamental, hope we can do muuuuuch better if we implement something like this. ;)

tromanisagit commented 2 years ago

So - whats the best approach here? create watch app? can that do all the nfc and other bits? or move the bluetooth to the watch after setup - like ambrosia? not sure if the bluetooth can be moved? i assume amb are moving the phone side of the connection to the watch by moving the bluetooth mac? i’ll have to read up on the bluetooth conneciton method.

robster7674 commented 2 years ago

Looks like Apple has opened up the Watch for bluetooth devices:

Connect Bluetooth devices to Apple Watch https://developer.apple.com/videos/play/wwdc2021/10005/

It would be great to be able to have both Watch and iPhone be able to autonomously read from FSL using the direct connection. Especially with the later Watch models that support eSIM, one could even leave the phone at home. ;)

miguelpruivo commented 1 year ago

Bumping this thread. I've seen multiple devices connecting directly into the watch — for instance, my Nuki Smart Lock connects directly to the watch through BLE when no iPhone is near by.

This would be an amazing addition to xdrip as a fallback option (if iPhone is available, use the iPhone, else the watch) because for me, for example, everytime I go jogging, I have to take my iPhone with me or the libre reader just to have the readings whenever I need.

LiroyvH commented 1 year ago

@miguelpruivo pretty sure that's a special API for smarthome appliances, same as car keys. That's "cheating" a bit :P

miguelpruivo commented 1 year ago

@LiroyvH cant it be used for an app that’s not in the AppStore anyway? 😁

LiroyvH commented 1 year ago

@miguelpruivo Not sure! Apple has been rather protective of the Watch with entitlements, probably due to battery drain concerns. I'll have a look. I'm not sure if this can be made reliable anyway with how very conservative the Watch is due to battery constraints. For good reason, but still annoying heh.

tromanisagit commented 1 year ago

Ambrosia have just announced a similar feature, but its not with the direct to libre.

LiroyvH commented 1 year ago

@tromanisagit Ambrosia has had it for a few years, but it worked exceptionally unreliable when I tried it. Maybe they fixed it now, but wouldn't get hopes up.

tromanisagit commented 4 months ago

Just a note. Its interesting that dexcon G7 now has direct to watch. Looks like its a start on phone and shift to watch method. Interesting to see how they do that.

LiroyvH commented 4 months ago

@tromanisagit There's an extra slot on it. The Dexcom transmitter always controls the state, this has been the same for the past generations of Dexcom's. So essentially: the only reason you have to start it on the phone, is because the Watch doesn't have an option built-in to start it. For the rest it works exactly the same as other devices. :)