Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unihertz Atom Bluetooth Connection Lost Dexcom G6 #734

Closed
roco5 opened this issue Jan 6, 2019 · 122 comments
Closed

Unihertz Atom Bluetooth Connection Lost Dexcom G6 #734

roco5 opened this issue Jan 6, 2019 · 122 comments
Labels

Comments

@roco5
Copy link

roco5 commented Jan 6, 2019

Xdrip will not stay connected to the sensor, as after about 15-20 mins of being disconnected, xdrip phone gets stuck in the "Scanning" state and the only way I can get it to connect again, after losing the connection, is to restart the phone. I have tested seemingly every setting in xdrip, android, fitbit, and specific to atom, and can't say that any configuration has helped at all.

Settings:
Unihertz Atom running new November 2018 build of firmware
Xdrip 12/27/2018 Nightly Build
Fitbit Versa running Glance and new 3.0 software

Observations:

  • The connection seems very stable between sensor and xdrip when the phone and sensor are in range - to get readings. When the phone goes out of range for more than 1 or two readings, the data stops getting captured from the sensor and the phone gets stuck "Scanning". The only way I know how to resolve this is to reboot the phone (Restarting the collector does not seem to reslove this.)

  • One user has suggested that when they try to use SSW3 watch and atom phone, with xdrip, they have the same connectivity problems I do, but when they don't use the watch the phone functions much better. I have a Fitbit Versa with updated 3.0 Fitbit firmware and need to be able to use the phone and watch combination, so I am reluctant to call it a problem using a watch.

  • It also seems possible that after watching a video or surfing on the phone, the phone misses a couple of readings and gets stuck scanning as well, but I have not completely verified this.

+++

The phone has a perfect form factor for a collector, and I would very much like to work with you to get it to function properly, for me and for others. Thank you for your assistance.

@jamorham
Copy link
Collaborator

jamorham commented Jan 8, 2019

It sounds like the phone's bluetooth stack has problems. I don't have one of these phones to test with. If anyone can loan me one I should be able to discover more quite quickly.

@AdrianLxM
Copy link
Contributor

The Atom BT stack is quite messed up it seems.
I also have problems keeping the BT connection up with a combo pump and with a Dana RS. So neither BLE nor older BT standards seem to work reliably.

It would be good if you could contact the tech support of unihertz. They will give you a guide how to send them system logs. I hope if they get them with different setups they will find a fix.
I don't have much hope as the December update still had the may security patch level of android :(

@tech-support-unihertz
Copy link

Hi, We are the technical support of unihertz.
As the document <log-check-20190109.pdf> describes, can Xdrip app give some instructions and why is it broken?
log-check-20190109.pdf

@2flea
Copy link

2flea commented Jan 9, 2019

Hey guys, I am currently using ATOM (latest firmware) together with xDrip (latest nightly) reading G6 and AAPS (latest dev) with Dana RS pump. It works so far (> 1-2 weeks) without the need to do regular restarts.
When I try to add my Sony SWR50 I get BT communication problems - mostly with AAPS.

I was in contact with Unihertz since I got the phone back in October and we have tried to identify what's amiss (I guess the log above is from mine from end of Nov) but without any success.

I really would like to use the ATOM with my setup together with a smartwatch - this would be my idea of a perfect system for looping.

Please let me know if I can help with any testing.

I have made screenshots of my current system and app settings for your reference: https://photos.app.goo.gl/bi8axT9pnRTHBuH9A


Adrian, Unihertz says on their ATOM FB group that the patch level was updated with their latest FW but not recognized by Google.
image

@jamorham
Copy link
Collaborator

jamorham commented Jan 9, 2019

@tech-support-unihertz I am the developer of the OB1G5Service. The dexcom transmitter wakes up periodically (every 5 minutes) for a short period of time and during that wake up window we need to connect to it to retrieve the data. That is what the service is doing.

I don't have an atom device to test here in the lab but the reports from users have been that the whole phone needs to be rebooted which in my experience implies that it is quite likely the android bluetooth subsystem itself is crashing.

@tech-support-unihertz
Copy link

@jamorham Can you help analyze this log? (Thanks for the log provider @2flea :)
https://www.dropbox.com/s/0f2cmdvxjqmt5ni/mtklog_20181127.zip?dl=0
From the log analysis, Bluetooth data interaction is normal from 21:02 to 21:38. At 21:39:38 seconds, because there is no data interaction, Bluetooth switches to IDLE mode, causing the connection to be disconnected.
Can you tell us if the xdrip app received an error code when the problem occurred?

@2flea
Copy link

2flea commented Jan 9, 2019

As far as I remember the log set above was done with the pre-release firmware including the "Bluetooth has stopped" message not the current version. Also I had different settings in the Atom battery saving.
@tech-support-unihertz, @jamorham I can provide new log data with the current setup and then with the Sony smartwatch if you want. Let me know if should add anything special in xDrip log settings.

@roco5
Copy link
Author

roco5 commented Jan 9, 2019

Hey guys, I am also currently using ATOM (latest firmware) together with xDrip (latest nightly) reading G6, and fitbit versa and have struggled to keep a connection to bluetooth when adding a smartwatch (Fitbit Versa) to the configuration.

History:
Test1:
Tried atom and versa with xdrip and Atom October firmware. Tested every battery, fitbit, and collector setting combination imaginable with no joy.
Result1: Had tons of connection drops and the only way to resolve them was to reboot phone. Happened every few hours.

Test2: Updated atom firmware to November (latest) and tuned xdrip, fitbit, and android settings. Also "Forgot" Sensor in Bluetooth, and let xdrip populate a new Dexcom Bluetooth connection. Still using versa smartwatch.
Result2: Seemed to stay connected a little better, but still had disconnects when the phone was out of range and brought back into range. Many unrecoverable disconnects a day that required rebooting the phone to solve.

Test3: Did a factory reset with latest november atom firmware installed. Installed xdrip but not fitbit versa yet.
Result3: So far, we are going on about 36 hours without needing to reboot, and data capture has been consistent where phone has come in and out of range with sensor after being separated from more than 25 mins.

Test4: Will install fitbit versa on atom, and try to use Versa smartwatch with Test 3 configuration and collecting log data on xdrip and per unihertz instructions.
Result4: ????

@jamorham
Copy link
Collaborator

I have received a unihertz atom phone to test with. It is early days, but my initial findings are that the problems are due to the manufacturers power saving additions to android which shut down xDrip.

PowerSaveService: forceStopThirdApp processName: com.eveningoutpost.dexdrip pid: 6814, packageName:com.eveningoutpost.dexdrip

This happens even though the custom setting for the app "Background activity" is enabled for xDrip and that xDrip is already supposed to be excluded from battery optimization via its standard android runtime permission for the same.

The MTK setting for Intelligent power saving standby is also disabled as well as battery saver in the general battery settings.

xDrip is running a foreground service and does not target oreo sdk (targets sdk 23)

This is running on an atom with build number 20181130

As far as I can tell the custom setting for whether Background activity is allowed for a specific app either is not implemented or doesn't work within the framework. I could be wrong but that is exactly how it looks from my initial testing.

@roco5
Copy link
Author

roco5 commented Feb 13, 2019 via email

@jamorham
Copy link
Collaborator

Okay, I think I have found where this is actually controlled:

Go in to Android Settings -> Smart Assist -> Power Save Manager -> Tick xDrip on in the whitelist

@jamorham
Copy link
Collaborator

jamorham commented Feb 13, 2019

100% capture rate so far on G5 with that setting applied. Using 10th Feb nightly.

@roco5
Copy link
Author

roco5 commented Feb 13, 2019 via email

@tech-support-unihertz
Copy link

tech-support-unihertz commented Feb 14, 2019 via email

@roco5
Copy link
Author

roco5 commented Feb 14, 2019

I assume you have a patch file or something? It was not linked to or attached to your last message....

@tech-support-unihertz
Copy link

I assume you have a patch file or something? It was not linked to or attached to your last message....

How to ensure App will not be cleaned up.pdf

@roco5
Copy link
Author

roco5 commented Feb 15, 2019 via email

@jamorham
Copy link
Collaborator

Okay so we have resolved the power saving issues with xDrip getting shut down. Now beyond that in extended testing (>12 hours run) I can see what looks like bluetooth stack crashing which I'm looking at now.

@tech-support-unihertz
Copy link

tech-support-unihertz commented Feb 19, 2019 via email

@tech-support-unihertz
Copy link

Okay so we have resolved the power saving issues with xDrip getting shut down. Now beyond that in extended testing (>12 hours run) I can see what looks like bluetooth stack crashing which I'm looking at now.

Thank you for your support. If you have any questions about the Bluetooth stack, please feel free to communicate with us. Thank you.

@tech-support-unihertz
Copy link

The attachment will guide you how to catch the log file.(BTW: Click the menu Open Bluetooth log Tool-> More Settings -> Firmware Test Situation: -> choose debug)
How to get Bluetooth mtklog for Atom.pdf

@gobeti
Copy link

gobeti commented Feb 19, 2019

@tech-support-unihertz I am the developer of the OB1G5Service. The dexcom transmitter wakes up periodically (every 5 minutes) for a short period of time and during that wake up window we need to connect to it to retrieve the data. That is what the service is doing.

I don't have an atom device to test here in the lab but the reports from users have been that the whole phone needs to be rebooted which in my experience implies that it is quite likely the android bluetooth subsystem itself is crashing.

@jamorham The same issue seems to be the case for the FINOW Q1 PRO --. Android 6 (using as collector and uploader to nightscout for a G6). Linked to #648 Exactly same issue. It is very unstable because of this. Only solution found to turn off and on the BT until it eventually connects again. Otherwise it keeps scanning without success. Let me know if I should send some logs as well or it is not necessary.

@roco5
Copy link
Author

roco5 commented Feb 21, 2019

Okay so we have resolved the power saving issues with xDrip getting shut down. Now beyond that in extended testing (>12 hours run) I can see what looks like bluetooth stack crashing which I'm looking at now.

@jamorham - any luck identifying bluetooth stack crashing or what is causing it?

@tech-support-unihertz
Copy link

tech-support-unihertz commented Feb 22, 2019 via email

@Ringelschlingel
Copy link

After removing the watch and restarting the phone xdrip starts working fine again. It is not possible to use watch and xdrip at the same time

@roco5
Copy link
Author

roco5 commented Mar 2, 2019 via email

@thomasmenges
Copy link

@roco5 I think you're right !
But what could be the recommendation for @tech-support-unihertz ?
In my opinion the bluetooth software implementation on the ATOM smartphone isn't up to date and should be replaced by a better one.

@Ringelschlingel
Copy link

Edit - two days later (since using the watch the last time) and I still have several crashes which make it necessary to restart the phone :-(

@tech-support-unihertz
Copy link

We need a new log to analyze the problem. The attachment will guide you how to catch the log file.(BTW: Click the menu Open Bluetooth log Tool-> More Settings -> Firmware Test Situation: -> choose debug)
How to get Bluetooth mtklog for Atom.pdf

@tech-support-unihertz
Copy link

@evalisapphire
Bluetooth-2019042316_g35v63c2k_dfl-ota.zip (https://drive.google.com/file/d/1AcogqYGzaZ4gUq2ktJSDgNRl90LBJHjO/view?usp=sharing): Cannot be upgraded with multiple tools, only for T card upgrades.

If you want to downgrade the version to 8.1, the only way is to flash a rom.
Whether you have a computer with Windows OS?

Here is the rom of 8.1: https://drive.google.com/file/d/1MPk6-68wbBIN7Yf8VTh9Wf-fc5Jn8yqE/view?usp=sharing
Here is the guide: https://drive.google.com/file/d/1qVlaYucvE44ZJqF1RCHGknEBQWy_Z65m/view

Please follow the instruction document for operation.
If you have any other question of the flash,please feel free to contact us.

@tech-support-unihertz
Copy link

@Pallesauka
Is there any problem now?

@rgcstats
Copy link

The bluetooth problem with dexcom is still there with android 9 on the atom. How about solving this unihertz?

@rgcstats
Copy link

rgcstats commented Dec 28, 2019

@evalisapphire
Bluetooth-2019042316_g35v63c2k_dfl-ota.zip (https://drive.google.com/file/d/1AcogqYGzaZ4gUq2ktJSDgNRl90LBJHjO/view?usp=sharing):%EF%BC%9A) Cannot be upgraded with multiple tools, only for T card upgrades.

If you want to downgrade the version to 8.1, the only way is to flash a rom.
Whether you have a computer with Windows OS?

Here is the rom of 8.1: https://drive.google.com/file/d/1MPk6-68wbBIN7Yf8VTh9Wf-fc5Jn8yqE/view?usp=sharing
Here is the guide: https://drive.google.com/file/d/1qVlaYucvE44ZJqF1RCHGknEBQWy_Z65m/view

Please follow the instruction document for operation.
If you have any other question of the flash,please feel free to contact us.

I downloaded Bluetooth-2019042316_g35v63c2k_dfl-ota.zip and followed the instructions to flash a rom, but I got the same problem as @evalisapphire : the SP-Multidownload app says that the scatter file (scatter.txt) is invalid.

@tech-support-unihertz
Copy link

@rgcstats
"2019030120_g35v63c2k_dfl.zip" is the correct ROM, please download it from the following URL, thank you!
Here is the rom of 8.1: https://drive.google.com/file/d/1MPk6-68wbBIN7Yf8VTh9Wf-fc5Jn8yqE/view?usp=sharing

@rgcstats
Copy link

rgcstats commented Dec 30, 2019 via email

@tech-support-unihertz
Copy link

@rgcstats
This document provides methods to allow third-party applications to run in the background at all times.
https://github.com/NightscoutFoundation/xDrip/files/2863094/How.to.ensure.App.will.not.be.cleaned.up.pdf

@roco5 roco5 changed the title Unihertz Atom Bluetooth Connection Lost Dexcom G6 and Fitbit Versa Unihertz Atom Bluetooth Connection Lost Dexcom G6 Jul 18, 2020
@roco5
Copy link
Author

roco5 commented Jul 18, 2020

@roco5 We have released a new temporary version of atom, which add the latest Bluetooth fw. Thanks!
https://drive.google.com/file/d/1VI_Edt0ckhAsnRL4bQKqixeexq0jcdzH/view?usp=sharing

Image 16

The firmware on a new replacement atom phone you sent (v.20190722) does not seem to
stay connected to our dexcom for more than 30 mins, and I am guessing it doesn't have the bluetooth fix that
you made for 20190322? - WHICH WAS WORKING PERFECTLY

Question: At this point, what are my options and what is working for everyone?

OTA Update or Flash the ROM back to 20190322 ?
Android 9.0 - Did this fix the bluetooth issue ?
Other?

@Thebigedge82
Copy link

Hi @tech-support-unihertz ,
I'm having trouble with xdrip connect to atom:
Android 9.0
Build Number: 20191114

I will attempt to flash to Android 8.1 as per your document.
As per your document 'check the model of your device and get the correct ROM!'- will the document supplied in this thread work with this device?

@tech-support-unihertz
Copy link

tech-support-unihertz commented Aug 26, 2020 via email

@tech-support-unihertz
Copy link

tech-support-unihertz commented Aug 26, 2020 via email

@rgcstats
Copy link

rgcstats commented Sep 4, 2020

Anyone tried the new atom xl to see if the bluetooth stack works better?

@mountrcg
Copy link

mountrcg commented Sep 10, 2020

@rgcstats I have an Atom XL running with AAPS & xdrip+. Everything is very smooth if you have the battery optimization cleaned up. Very good battery time (2 days) and 100% capture rate in xdrip+. I use an omnipod so also this AAPS branch with RileyLink via bluetooth works fine.
There is 2 tweaks you can do in skinClassic.kt in order to get maximum use of your screen for the first graph and put 2 additional graphs down for scrolling down one page:
override val mainGraphHeight: Int get() = 290
override val secondaryGraphHeight: Int get() = 210

Screenshot_20200910-130710
Screenshot_20200910-130715

@mountrcg
Copy link

If screen property is a bigger issue one can also replace the funny icons for IOB COB TBR and Sens with text. 2 of these icons (COB & TBR) have display functions depending on status, so you will lose these if you only do text.

Text_instead_of_Icons_on_Info-Fragment_and_Large_Skin_adjusted.patch.zip

This patch also includes an adjustment to the Large Skin, to extend the first graph fully on a Huawei P20 Pro.

@Thebigedge82
Copy link

Thebigedge82 commented Sep 15, 2020 via email

@mountrcg
Copy link

@Thebigedge82 it is pretty straight forward in Android Studio:
Bildschirmfoto 2020-09-16 um 11 29 19
and
Bildschirmfoto 2020-09-16 um 11 32 11

@rgcstats
Copy link

Thanks very much @mountrcg, I might get myself the atom L for Christmas in that case. Can you give a few tips about getting the battery optimisation right? It seems like there are battery-related settings in multiple places, and I was never sure with the atom that I'd turned them all off.

@mountrcg
Copy link

mountrcg commented Sep 20, 2020

@rgcstats
(1) There is the gerneral battery settings under Settings > Battery where the Battery Saver is set to off
(2) the app specific battery otimization settings under Settings > Apps & Notifications > Advanced > Special app access > Battery Optimization where AAPS and xDrip need to be set to "not optimized"
(3) the Atom specific part under Settings > Smart Assistent > App Blocker where you untoggle Start Blocker, Background Blocker and Background Cleanup for both xDrip and AAPS

@tolot27
Copy link
Collaborator

tolot27 commented Sep 21, 2020

It looks to me that the problem is caused by the Unihertz BT stack and not by xDrip. Or is it solved, meanwhile?

@mountrcg Thank you for your screen size adaption. Please can you create a separate feature request to not further mix up this issue?

@Mackwe
Copy link

Mackwe commented Sep 29, 2020

@tech-support-unihertz : Downloaded the 2020072319_g35v63c2k_dfl_bt-ota.zip onto an Atom. Installed 8.1 very nicely and I configured everything for this use. The collection seems to work well, but for some reason my IMEIs are set to 11111111111111 and 22222222222222 respectively, so I can't use any SIM card functionality (it will not register onto any network).

Is there another version I can try?

@tolot27
Copy link
Collaborator

tolot27 commented Sep 29, 2020

@Mackwe Please can you contact Unihertz directly? The IMEI issue is not related to xDrip.

It looks like the original issue is solved now. Hence, I close this issue. @mountrcg will create a new issue with its feature request, hopefully.

@tolot27 tolot27 closed this as completed Sep 29, 2020
@tech-support-unihertz
Copy link

tech-support-unihertz commented Sep 30, 2020 via email

@Mackwe
Copy link

Mackwe commented Sep 30, 2020

Please input *#*#8#*#* in dial app, enter and edit the correct IMEI for SIM1 and SIM2, then click SAVE button, Restart your Atom.

@tech-support-unihertz Thanks for swift reply. But I am afraid it didn't work. I get the dialog, enter the correct IMEIs, press Save, restart and the IMEIs are still 111111111111111 and 222222222222222..
Please advise.

@tech-support-unihertz
Copy link

tech-support-unihertz commented Sep 30, 2020 via email

@Mackwe
Copy link

Mackwe commented Oct 2, 2020

Hi, Try to use this tool to write IMEI

Thanks for your reply. I couldn't make this tool work. I simply cannot get a VCom port to the Atom. I can get ADB access, but then I would need to have root access I think?

In order not to hog this thread anymore, would you consider e-mailing me please?

Thanks in advance!

@Navid200 Navid200 removed the invalid label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests