NightscoutFoundation / xDrip

Nightscout version of xDrip+
https://jamorham.github.io/#xdrip-plus
GNU General Public License v3.0
1.4k stars 1.14k forks source link

Android 10+ asks every 5 minutes for pairing with Dexcom transmitter #1494

Closed vitalykekukh closed 3 years ago

vitalykekukh commented 3 years ago

After updating in October 2020 from android to samsung a50 every 5 minutes xdrip 2020 asks for dexcom Bluetooth connections. The xdrip app released in 2019 works fine. How to remove the request to connect dexcom via bluetooth on a50 smartphone?

tolot27 commented 3 years ago

Please can someone try 2019.12.05? This will likely reintroduce the problem described in #1061 but that's just for testing.

Currently, I don't have a phone or tablet for testing. Have to wait till 12th Nov. to get the newer LineageOS image.

tolot27 commented 3 years ago

My recommend settings for testing with xDrip nightly of 2019.12.05 and the following settings:

Navid200 commented 3 years ago

Is the purpose of the test to help with fixing 1494? So, it is for those with Samsung, right?

vytux-com commented 3 years ago

Is the purpose of the test to help with fixing 1494? So, it is for those with Samsung, right?

This affects everyone with an Android and Nov 2020 Security Patch... So also all Pixel 2 and above owners and probably quite a few other phone manufacturers

Navid200 commented 3 years ago

My question was not about whom this issue affects.

If you look above my question, you can see we have been asked to help by performing a test. Who should participate in this test? Can someone whose phone is on Android 8 do what tolo27 asked, and more importantly, will that help him towards finding a solution for this issue?

vytux-com commented 3 years ago

Yes, I get that, based on what tolo27 said it would be anyone that has a new enough version of android to be affected by this issue

Testing on an older version would be secondary to ensure no unintended errors were introduced with this fix for older devices. So testing on Android 8 won't hurt, but it will also not be an accurate test of a fix as that device does not have the current issue.

vitalykekukh commented 3 years ago

Can we get comments on this issue from the xdrip developers? Their app is useless now! They will fix xdrip or we will massively switch to other applications! Unfortunately, there are no other options!

Navid200 commented 3 years ago

There are those who use xDrip for Libre. They are not affected by this issue.
My phone still has Android 9. I have no problem using xDrip with Dexcom G6.
There are people who use Motorola and Android 10. They are not affected. Yes, there are individuals who are affected by this issue. But, they are a portion of the overall xDrip users. Saying "the app is useless" would be an exaggeration.

It seems reasonable to switch to something else if one has to. I don't think anyone would blame you. But, what is the point of putting pressure on the developers? Are they paid for developing and maintaining xDrip? I've never paid for using xDrip.
Yet, they are working on resolving this issue.

vitalykekukh commented 3 years ago

We want the xdrip developers to express their position on this issue. And we, in turn, will decide what to do. If there is a promise to fix this problem, we will follow up on this topic. If they explain that they will not solve the problem, then we will move on to other applications. I would like them to express their opinion on this matter.

tolot27 commented 3 years ago

@vitalykekukh Indeed, the issue will be fixed. It is a breaking one and more and more users get affected. But it takes some time to solve complex problems. From the users point of view it is just a simple touch on "OK" but it is much more complicated from the developers side. Remember, Android is raising the pop-up, not xDrip.

I know, it is an annoying bug for the affected users and I fully understand the consequences on therapy. But please remember, Github is a code repository for open source projects. Every contributor becomes a developer. And as long as the core developers do not have affected devices, it is hardly possible for them to find a good solution rather than a workaround.

tolot27 commented 3 years ago

Is the purpose of the test to help with fixing 1494? So, it is for those with Samsung, right?

Yes, it is to help fixing this issue. Since not only Samsung phones are affected, I'm going to change the issue title.

michalhudecek commented 3 years ago

My recommend settings for testing are 2019.12.05 and the following settings:

  • [x] Minimize Scanning
  • [ ] Allow OB1 unbonding
  • [x] Allow OB1 initiate bonding

Unfortunately, these settings do not help on Samsung Galaxy Note 10.

tolot27 commented 3 years ago

@michalhudecek The settings alone won't help. You need to go back to the xDrip nightly of 2019.12.05, too.

michalhudecek commented 3 years ago

Actually, when I roll back to 2019.12.05, I completely stop receiving any data. I had to upgrade back to 2020.07.13. Pairing every 5 minutes is still better than nothing.

Gufur48387 commented 3 years ago

Actually, when I roll back to 2019.12.05, I completely stop receiving any data. I had to upgrade back to 2020.07.13. Pairing every 5 minutes is still better than nothing.

I downgraded my Note 10 Plus to October Security Patch (DTI5) and its working great again. But remember, you will loose all your phone data, if you downgrade

jredders commented 3 years ago

On my Pixel 3a, I've found that if I reboot my phone, I'll get the pairing notification only once after startup, then it works fine until I lose connection between my phone and G6. Once the connection is lost, I get the pairing notification every five minutes until I reboot again.

Quergestreift commented 3 years ago

I have the same problem. Every 5 Minutes xDrip+ aked for pairing my Dexcom G6 and I`m loosing my connection. This error exists sine I have update my Samsung S10+ this morning. How is it possible to upgrade to the previous software version?

Gufur48387 commented 3 years ago

I have the same problem. Every 5 Minutes xDrip+ aked for pairing my Dexcom G6 and I`m loosing my connection. This error exists sine I have update my Samsung S10+ this morning. How is it possible to upgrade to the previous software version?

Find previous Firmware for you device Download it Download Odin (Flash Tool) Flash previous Firmware with odin

Beware that you will loose all your data

There are a lot of guides out There how to use Odin, if you Nerd Further help, contact me

Quergestreift commented 3 years ago

Is there any hope, the problem will be solved by xdrip? What do you think?

Gufur48387 commented 3 years ago

Is there any hope, the problem will be solved by xdrip? What do you think?

Yes, I think so The Dexcom App is still working, so it can be done correctly

In the menatime im Just happy to have xdrip+ its a lifesaver, and I will happily wait for an Update with a fix :)

Quergestreift commented 3 years ago

thanks for yor answer. I`m abit lsot now.

Quergestreift commented 3 years ago

sorry, I´m a bit lost now ;-)

MikeUniformCharlie commented 3 years ago

I have full confidence that some of the smartest ppl of the web meet here and solve the issue. For the time being I was wondering, if there's a way for me to get the Dexcom G6 readings on my smartwatch. I thought maybe using xDrip setup as a follower could read the data from the dexcom share - even though that would propably come with a hefty delay. Cheers, Pete

tolot27 commented 3 years ago

@jredders

On my Pixel 3a, I've found that if I reboot my phone, I'll get the pairing notification only once after startup, then it works fine until I lose connection between my phone and G6. Once the connection is lost, I get the pairing notification every five minutes until I reboot again.

Please can you post such a cycle with with the initial pairing, two successful bg readings without pairing request, connection loss for at least 3 readings (min. 15 minutes) and then reconnect with at least two repeated (and accepted) pairing requests?

Before, please enable verbose logging in settings > less common settings > extra tags for logging and then add there: BluetoothScan:v,DexCollectionService:v,Ob1G5CollectionService:v,Ob1G5StateMachine:v,G5CollectionService:v and post relevant lines here or attach SQLite DB entries of table UserErrors (most useful). That would further narrow down the problem and will improve my understanding of reconnect problems (#1061).

foodevnul commented 3 years ago

Pixel 4a user here. 2020.07.13 was working great for me on Android 11. This issue started happening for me right after I applied the November 2020 Android security patch.

mistermintsgh commented 3 years ago

My apologies, I haven't been able to read through all the comments on this issue, but can anyone confirm if this is an issue affecting Dexcom only?

I've just received the notification to upgrade, but I use Libre+MiaoMiao. Since I use this to loop I cannot risk it not working if I install the update.

Can anyone confirm whether MiaoMiao is affected like the Dexcom is?

Thanks

vytux-com commented 3 years ago

My apologies, I haven't been able to read through all the comments on this issue, but can anyone confirm if this is an issue affecting Dexcom only?

I've just received the notification to upgrade, but I use Libre+MiaoMiao. Since I use this to loop I cannot risk it not working if I install the update.

Can anyone confirm whether MiaoMiao is affected like the Dexcom is?

Thanks

It seems to affect the Bluetooth stack so is very likely to affect anything related to xdrip and Bluetooth (MiaoMiao included)

mistermintsgh commented 3 years ago

My apologies, I haven't been able to read through all the comments on this issue, but can anyone confirm if this is an issue affecting Dexcom only? I've just received the notification to upgrade, but I use Libre+MiaoMiao. Since I use this to loop I cannot risk it not working if I install the update. Can anyone confirm whether MiaoMiao is affected like the Dexcom is? Thanks

It seems to affect the Bluetooth stack so is very likely to affect anything related to xdrip and Bluetooth (MiaoMiao included)

Forgive my ignorance on this, but if it affects everything Bluetooth related, isn't there an impact on things like headphones, speakers, anything else? Or is it only everything Bluetooth that connects via xDrip?

Would it affect a RileyLink connected via AAPS?

afreitag33 commented 3 years ago

RileyLink is working fine for me. It stays connected though and isn't in the official BT stack.

opasha commented 3 years ago

Same issue here. My Samsung Galaxy Fold just updated to latest November 1, 2020 (Android 10) security patch.

Every 5 minutes on latest nightly version of xdrip, I get that annoying pop up to pair my Dexcom transmitter (see screenshot below). Cannot roll back to the May 2019 build to test (as suggested earlier) as it gives sensor sanity failure.

If you need me to test any beta type nightly, let me know. I've had flawless connectivity prior to this.

Only xdrip is affected. My car, my Ticwatch Pro 3, Ticwatch 4G, and Airpods are unaffected.

Thank you, developers for your efforts and time. I know this is annoying for you as well and not an easy thing.

Screenshot_20201111-135245_Settings

diabeticpilot commented 3 years ago

I have a Pixel 2 on Google Fi and had this happen when I updated to the latest on Nov 5th on Android 11.

For me, reverting to https://github.com/NightscoutFoundation/xDrip/releases/tag/2019.05.18 actually worked to resolve this issue. There are still some connection problems when my phone dies or is away from the Dexcom transmitter, but it can be resolved by hitting "forget device" and then restarting the collector.

opasha commented 3 years ago

Yeah, I tried that same version again, forgot it like you said, then did restart transmitter.

It worked. It changed from Sensor Raw Data Sanity Failure to the correct glucose. Thanks! I'll keep an eye on it.

Just after 5.18.19 version install: Screenshot_20201111-160654_xDrip+

After forgetting and restarting transmitter on 5.18.19 version - give it a minute or two to refresh:

Screenshot_20201111-160951_xDrip+

Proof that the previous 5.18.19 version of xdrip is working just fine without any loss of Bluetooth since my last reading above at 140 mg/dL:

Screenshot_20201111-162539_xDrip+

The random transmitter connection loss as other reported above is present on this version (5.18.19) despite bluetooth connection being fine:

Screenshot_20201111-163614_xDrip+

UPDATE: SCRATCH THAT, PREVIOUS VERSION ALSO HAS BLUETOOTH ISSUE - DO NOT DOWNGRADE XDRIP:

Screenshot_20201111-164351_Settings

tolot27 commented 3 years ago

Actually, when I roll back to 2019.12.05, I completely stop receiving any data. I had to upgrade back to 2020.07.13. Pairing every 5 minutes is still better than nothing.

Please can at least a second user try 2019.12.05? I can't really believe that it should not work wit 2019.12.05.

BTW: Hopefully the Nov. security patch will be released for S7, tomorrow. Than I can continue digging into this issue.

opasha commented 3 years ago

Actually, when I roll back to 2019.12.05, I completely stop receiving any data. I had to upgrade back to 2020.07.13. Pairing every 5 minutes is still better than nothing.

Please can at least a second user try 2019.12.05? I can't really believe that it should not work wit 2019.12.05.

BTW: Hopefully the Nov. security patch will be released for S7, tomorrow. Than I can continue digging into this issue.

This version leads to a not found error - missing or dead link. Can someone upload it so we can test?

tolot27 commented 3 years ago

This version leads to a not found error - missing or dead link. Can someone upload it so we can test?

Sorry, fixed the link.

tolot27 commented 3 years ago

One more update. Please can anyone having this issue try the following extra logging tags and post the log of one confirmed pairing process?

BluetoothScan:v,DexCollectionService:v,Ob1G5CollectionService:v,Ob1G5StateMachine:v,G5CollectionService:v,jamorham JoH:v

opasha commented 3 years ago

Actually, when I roll back to 2019.12.05, I completely stop receiving any data. I had to upgrade back to 2020.07.13. Pairing every 5 minutes is still better than nothing.

Please can at least a second user try 2019.12.05? I can't really believe that it should not work wit 2019.12.05.

BTW: Hopefully the Nov. security patch will be released for S7, tomorrow. Than I can continue digging into this issue.

This version (https://github.com/NightscoutFoundation/xDrip/releases/tag/2019.12.05) is working flawlessly! Thank you!

Screenshot_20201111-183532_xDrip+

UPDATE: Nevermind, spoke too soon, lol. It lost connection as well. Just stays connected longer, but got the same Bluetooth pairing request:

Screenshot_20201111-185025_xDrip+

opasha commented 3 years ago

Just a shot in the dark, but maybe the developers can use this to figure something out? BluetoothLibraryPatcher - Fix bluetooth pair… | Samsung Galaxy Note 9 https://forum.xda-developers.com/galaxy-note-9/development/zip-libbluetooth-patcher-fix-losing-t4017735

Thanks!

I'm back on the latest nightly. As others have said, it's better to have Bluetooth pairing annoyance as opposed to signal/data loss with the old versions:

Screenshot_20201111-200354_xDrip+

heba29 commented 3 years ago

Had the same issue with my S10, Dexcom G6, AAPS and 1. november Patch installed this morning. The 2019.12.5 version fix the problem :-). Thanks for the information about this issue and how to resolve the problem...

opasha commented 3 years ago

Had the same issue with my S10, Dexcom G6, AAPS and 1. november Patch installed this morning. The 2019.12.5 version fix the problem :-). Thanks for the information about this issue and how to resolve the problem...

Unfortunately, it does not fix the problem. Monitor it, and you'll start to see signal loss to your transmitter the same way you would with being too far from your phone and the same way sensor errors occur after restarts - that is the behavior reported by others and my tests above.

If you lose signal and have issues, please update this thread. Thank you!

heba29 commented 3 years ago

Had the same issue with my S10, Dexcom G6, AAPS and 1. november Patch installed this morning. The 2019.12.5 version fix the problem :-). Thanks for the information about this issue and how to resolve the problem...

Unfortunately, it does not fix the problem. Monitor it, and you'll start to see signal loss to your transmitter the same way you would with being too far from your phone and the same way sensor errors occur after restarts - that is the behavior reported by others and my tests above.

If you lose signal and have issues, please update this thread. Thank you!

Yes, you are right. Connection lost after 15 minutes. Restart collector do not work. But my Dexcom Transmitter is pared. Update to the last Nightly Version :-)

JonathanM32 commented 3 years ago

Had the same issue with my S10, Dexcom G6, AAPS and 1. november Patch installed this morning. The 2019.12.5 version fix the problem :-). Thanks for the information about this issue and how to resolve the problem...

Unfortunately, it does not fix the problem. Monitor it, and you'll start to see signal loss to your transmitter the same way you would with being too far from your phone and the same way sensor errors occur after restarts - that is the behavior reported by others and my tests above.

If you lose signal and have issues, please update this thread. Thank you!

Also just downgraded. Seems to work a bit better but I am still seeing significant signal loss like this

opasha commented 3 years ago

Had the same issue with my S10, Dexcom G6, AAPS and 1. november Patch installed this morning. The 2019.12.5 version fix the problem :-). Thanks for the information about this issue and how to resolve the problem...

Unfortunately, it does not fix the problem. Monitor it, and you'll start to see signal loss to your transmitter the same way you would with being too far from your phone and the same way sensor errors occur after restarts - that is the behavior reported by others and my tests above. If you lose signal and have issues, please update this thread. Thank you!

Also just downgraded. Seems to work a bit better but I am still seeing significant signal loss like this

Only usable and stable option as another user mentioned earlier is to download custom dexcom app, turn off alerts and glance notifications, use dexcom share within the dexcom app (make your follower), then login with your dexcom ID into dexcom share within xdrip.

Rock solid connection without any Bluetooth issues.

STEPS: Simply stop sensor with xdrip. Remove transmitter from sensor. Wait 30 minutes. Setup your dexcom app (use 2 hour default in your option at the end), start transmitter/sensor in the dexcom app, setup dexcom share (share button within the app), then open xdrip and settings, hardware data source as dex share follower - use your dexcom username login and password.

UPDATE: nickb24's comment below: "If you want to switch from xDrip to Dexcom app on an already running sensor you don't need to stop the sensor. Just stop the xDrip app, then run the Dexcom app. It will pickup on the already running session and continue. *Note: this is assuming you have a G6."

Screenshot_20201112-082803_xDrip+

Working flawlessly (for real this time) since restarting using the same sensor and transmitter as in my earlier tests with xdrip.

Screenshot_20201112-082913_xDrip+

heba29 commented 3 years ago

Can we stop the Sensoren XDrip, Wait 30 Minutes, Remote transmitter and install patched dexcom App??

So my Sensor ist from yesterday 😬

nickb24 commented 3 years ago

I would like to add my input in case it helps someone in the future. I've been looking at the xDrip bluetooth code for the last 2 days intensively. As @tolot27 already mentioned, the android source code has been updated to fix a bug but has now also introduced a security measure that shows a popup to the user each time a new bluetooth devices is connected.

When you break down the issue from a code perspective, the issue becomes clear. The popup only occurs when a bluetooth devices is first added to your Android bluetooth list. Once it is added and the user accepts the prompt from the Android OS, then it will never show again. This is why with the Dexcom app it only shows the first time adding a transmitter or running the Dexcom app from a new install. @vitalykekukh has already mentioned this:

The difference between the old and new versions of Android is the enhanced Bluetooth security system. The developers claim that hackers can steal data from a smartphone via Bluetooth. So in the new version of Android, they have enabled an additional pairing request. The 2019 version of xdrip is permanently paired via Bluetooth. To save battery power, the 2020 versions connect via Bluetooth every 5 minutes and then disconnect. Therefore, when paired, Android recognizes the pairing as connecting a new device and issues a request to the smartphone user. In this situation, either the xdrip developers in the new versions will make permanent pairing via Bluetooth, or the Android developers will make it possible to make a one-time request to pair with a known (allowed) device.

I don't think this change was done only to save power. Not from what I can see in the code.

What is not discussed is why does the Dexcom app work without unbonding and then rebonding the bluetooh device? This is the questions we need to answer. The older versions of xDrip never removed the bluetooth bond (therefore never removed the bluetooth devices in the Android device list) and this is why the popup doesn't occur with the old version. However, at the same time Dexcom changed something in their transmitters and then it caused what xDrip users here describe as 'signal lost', but it's not a signal loss. It is a breakdown of the bluetooth communication. What xDrip does when the communication protocol is broken is to unbond the transmitter and do a full rebond and authentication. So then why was unbonding not necessary at one point then become necessary, what changed? It's clear that the xDrip unbond/bond technique is a patch that is hiding a deeper issue.

What I believe the solution is to this problem, is to remove the code that unbonds the transmitter. However, at the moment if we do that then the communication will fail after a certain amount of time. As others have mentioned above, it seems to be around 15 minutes. Based on my findings I mention in this issue, https://github.com/NightscoutFoundation/xDrip/issues/1279#issuecomment-725774671 , I believe the issue could be related to the way xDrip is handling the communication protocol to the transmitter. There looks to be a security mechanism that xDrip is not using. I believe that if this bluetooth dialog issue is fixed for this set of users, then all of you would then get the other issue here https://github.com/NightscoutFoundation/xDrip/issues/1279#issuecomment-725774671 if you start running one of the new transmitters.

nickb24 commented 3 years ago

Can we stop the Sensoren XDrip, Wait 30 Minutes, Remote transmitter and install patched dexcom App??

So my Sensor ist from yesterday 😬

If you want to switch from xDrip to Dexcom app on an already running sensor you don't need to stop the sensor. Just stop the xDrip app, then run the Dexcom app. It will pickup on the already running session and continue. *Note: this is assuming you have a G6.

heba29 commented 3 years ago

Can we stop the Sensoren XDrip, Wait 30 Minutes, Remote transmitter and install patched dexcom App?? So my Sensor ist from yesterday 😬

If you want to switch from xDrip to Dexcom app on an already running sensor you don't need to stop the sensor. Just stop the xDrip app, then run the Dexcom app. It will pickup on the already running session and continue. *Note: this is assuming you have a G6.

Yes thats works great for me. Thank you. Now i can sleep without alarms. Hope the Developer of XDrip solve the problems. You made a great Job!!

spencertollefson commented 3 years ago

Hmmm I have a Pixel 3a, just updated to the November update, and encountered the issue. I began following @tolot27 request a few days ago to gather log data. I restarted by phone, paired, received a few successful readings, set phone in microwave and missed readings for ~30 minutes, removed phone from microwave, received the pair request message and paired again, and it's been humming along fine for 20 minutes since then.

Basically, it's (so far) working again for me after a simple reboot. I'm on the 2020.10.01 nightly version.

AppEternal commented 3 years ago

I had the same issue after updating to android 10 today (note 10+)

After rebooting and resetting the network settings it's started to read without requesting a pair each time.

evanheics commented 3 years ago

Where/which network settings did you reset?

On Thu, Nov 12, 2020 at 12:25 PM AppEternal notifications@github.com wrote:

I had the same issue after updating to android 10 today (note 10+)

After rebooting and resetting the network settings it's started to read without requesting a pair each time.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NightscoutFoundation/xDrip/issues/1494#issuecomment-726221625, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJG7U2UYDIP6YUUQKDVVU3DSPQLCDANCNFSM4TGMLYVA .