Direct connect between Pixel Watch 2 and Dexcom G6 not working via xDrip #3676
Replies: 8 comments 4 replies
-
Ok I reset the watch, deleted xDrip and made a fresh installation. The watch still won't connect to the g6 sensor but now I get this errors in my log:
Edit:
Ok I managed to build and install the apk (forgot to sign on the first try). I discovered that the wear device uses another endbyte for the authrequest message:
Edit2: ofc. this means the alternate bt channels gets used. Is the decision to use it crucial to any feature in xdrip, afaik there isn't a state where both phone and wear device are both connected simultaneously to the sensor right? |
Beta Was this translation helpful? Give feedback.
-
No one has addressed WearOS issues and requirements for a very long time. There are very small phones that some parents send their kids to school with. I don't have a solution for you. I'm just telling you my limited knowledge of what is available. The problem is that it is not supposed to just work. It has to work reliably. BlueJay does. I mean let's say you figure out a way to improve WearOS direct collection. What will you do when your child switches to G7? |
Beta Was this translation helpful? Give feedback.
-
Ok, it seems that the direct connection from the Pixel Watch2 (WearOS 4) is now working reliably with a few changes in the wear code. I had to update a lot of classes to reflect the changes of the last 3-5 years. We'll be testing the feature with our watch over the next few days/weeks and if everything goes smoothly, I'll provide a PR for it. I'm also going to implement the nightscout upload feature directly from the watch, as this is crucial for us as parents. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, after more extensive testing, we found a problem. Uploading to Nightscout only worked sporadically when the phone (bluetooth) or a known wifi was nearby. Over LTE, the upload was very erratic and only succeeded every few hours at most. I am now implementing several checks for an active network and prioritising the cellular network so that the upload is done every 5 minutes as usual. Unfortunately, the problem is still difficult to analyse because if I want to see the log data on the phone, the bluetooth connection immediately takes over the transfer of the upload data to nightscout and no longer the cellular network directly. I am currently working on a small display view of the log data directly on the watch, so that a connection to the mobile phone is not necessary. |
Beta Was this translation helpful? Give feedback.
-
Ok, it took a lot of work, but in the end it works as I want it to. Originally it could only connect to the nightscout host when xdrip was started on the phone. Unfortunately, prioritising and re-establishing the cellular connection on the clock did not work. I found out that the data packets which are sent from the 'cell phone xdrip app' with the flag “urgent” via wear data-api to the watch virtually wake up the lte connection again. Since the data packets sent via the data api are sent to all nodes, I have now used this mechanism as a workaround:
And it seems to work fine! Even when the xdrip application is completely deactivated/removed on the mobile phone, the watch now sends data to nightscout every 5 minutes! We will be monitoring the battery consumption over the next few days, so it may be possible to tweak things a bit. |
Beta Was this translation helpful? Give feedback.
-
@thepartisan sorry for the late reply. The following steps work reliably for me and succeed every time to get the watch paired correctly:
If this does not work then enable log sync in the wear settings of your xDrip phone app and insert the following logging tags:
Save the log and add it here, maybe I can identify the issue then. |
Beta Was this translation helpful? Give feedback.
-
Update: our Pixel Watch 2 received the WearOS 5 update two weeks ago. xDrip is still working reliably and the Battery lasts longer with the new OS version. Also a bug got fixed that sending of data to Nightscout was not possible after a networkswitch from LTE to Wifi or vice versa. This works really smooth now and the battery lasts approx 14hours (2-3 hours longer as on WearOS4!!) which is long enough for our usecases. I'm update my branch to the latest master and test if the selfping workarounds are still needed on WearOS5 or can get removed (this should reduce the battery consumption of the app even more). |
Beta Was this translation helpful? Give feedback.
-
Hey @t0st, thank you very much for settings this up. That's very promising! I'm helping a friend with the same setup (Pixel Watch 2 on WearOS 5, G6 sensor). I built and installed the current state f6c6778 of your pull request #3719 on the phone and thereafter on the watch by "Wear Installer 2" app. Transmitting BG data from the phone to the watch works. However, the stand-alone "Force Wear Collection Service" doesn't connect the watch with the sensor. I tried to follow the recommended procedure (https://xdrip.readthedocs.io/en/latest/smartwatch/wear/#recommended-sequence). The following log picture (click to enlarge) shows the output after checking "Enable Wear Collection Service" and shortly threafter "Force Wear Collection Service". In the picture I anonymized the transmitter ID, it consists of six characters/digits, they match with the transmitter ID shown in the status page. I didn't check "Only use Wear" but the devices (phone, watch, sensor) were close to each other, so it shouldn't matter to my understanding. Unfortunately I don't have a device to debug myself, just having the logs and trying to follow the plain code. The current state of the wear-specific file "Ob1G5CollectionService.java" in your pull request is: For logging we disabled level "Mid", this floods the log by Actually up to the scanning it looks good. But it doesn't seem to be able to find anything or maybe is unable to connect to anything. Or maybe something wrong with the filter for devices. Accordingly it's also unable to populate a MAC address, I guess. Next thing I did was comparing the wear-specific file "Ob1G5CollectionService.java" with the regular file "Ob1G5CollectionService.java" in app/src/main/java/com/eveningoutpost/dexdrip/services. There are several small differences but I didn't spot anything specifically suspicious. I stopped investigation on the differences of those two files... though I can pick it up again if it's worth. Do you have an idea what's going wrong? Or any debug suggestions? Is there any specific WearOS settings in the watch to enable for allowing it to pair with the sensor? Also maybe it's worth to mention that the firmware version of the sensor in xDrip+ is "unknown" in the current state of the pull request (but would be available in latest nightly commits). Besides that, your pull request was written and tested for WearOS 4, is it supposed to run on WearOS 5 without changes? |
Beta Was this translation helpful? Give feedback.
-
Hey there!
I bought a Pixel Watch 2 for my kid to replace the bulky mobilephone he needs to take with him for the cgm readings atm.
At first the mobile phone with android 14 paired successfully with the dexcom g6 sensor and also the cgm readings were displayed on the google pixel watch 2 (with wearos 4) without problems.
But as soon as the setting "Force Wear Collection Service" gets enabled the readings stop and the watch cannot properly create a connection to the sensor.
I already tried to shutdown the phone, restarted the watch multiple times, resetted the watch multiple times but the connection can't get established.
Is there anything I can do to fix this? I read somewhere that ppl were able to connect their pixel watch 2 with xdrip to the g6 sensor a few months ago, did something change here in the meantime?
Im currently running the lastest build of xDrip, version aee9315-2024.09.19.
Thats the log part the comes from the watch during trying to create a connection to the sensor:
It seems like the log message "Task deadlock on..." comes from here:
https://github.com/NightscoutFoundation/xDrip/blob/master/wear/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/PlusAsyncExecutor.java#L90
and the qsize got reduced to 2 for watches instead of 10 like on the phone but i cannot say if thats the root cause or there is anything else.
Beta Was this translation helpful? Give feedback.
All reactions