xDrip-Watchface icon indicating copy to clipboard operation
xDrip-Watchface copied to clipboard

Blank screen on time out or button press, Amazfit Pace

Open vebaba opened this issue 5 years ago • 42 comments

On 1st October 2019, midnight, watch started to show some strange issue. On timeout or button press it doesn't turn off background light only but also changes watchface to nothing (blank screen). I tried to:

  • set Raise to light up and I only get blank screen with background light (until I press button)
  • factory reset watch and test it without xdrip watchface and it worked. After xdrip watchface installation, same problem
  • uninstall xdrip watchface and tried it with old version of it. Old version doesn't work
  • unisntall Amazfit only. Install old version (prior 29.9. one) and it didn't fix the problem
  • tried to change languages of xdrip watchface. Didn't help Anyone else?

vebaba avatar Oct 01 '19 16:10 vebaba

Curiously, the same happened to me. It started doing that strange thing exactly at 0.00 of October 1st. I restored Amazfit to factory settings, re-install watchface, even installed old version of Amazfit apk (the latest is 3.4.3 and downgraded to 3.4.1) because I thought it could be owed to that. In fact, tried the same as you did, without success. Last year, the watchface suffered form a minor bug related to September or December month, can't remember. The issue is that if I shift to another watchface, the screen continues to go in black after a while. Urgent review is needed. I haven't the faintest idea of programming, but I am willing to test whatever change @Klaus3d3 may want to implement

yosepito avatar Oct 01 '19 16:10 yosepito

an insight: it is just if the watch enters a hibernate mode and show no screen to save battery. The service is running in the background but it shows a black screen instead of the usual waiting screen. Occasionally, it falls into a unresponsive state so it does not wake up despite pressing the button or double-tapping the screen.

Mine is Amazfit Pace

Another test was to set September 1st in the smartphone so the watch changed the date, just in case. No luck: the problem this strategy creates is that Xdrip cannot show values because timestamp is out of date....,

yosepito avatar Oct 01 '19 16:10 yosepito

reviewing the code, I found the "December" month repeated (in all the languages). Additionally, December was posted as the first month instead of January. Since September is a 30-days month, @Klaus3d3, is it possible this to freezes the sleep mode? path: app/src/main/java/com/klaus3d3/xDripwatchface/widget/MainClock.java Code:

private static String[][] months = { //{"DECEMBER", "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"}, {"DECEMBER", "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", " DECEMBER"},

In addition to this, I found this code in the same MainClock.java: is it possible this "hide" and the mentioned above may cause the problem?

// Hide if disabled if(!service.getResources().getBoolean(R.bool.month)){monthLayout.show=false;}

When I tried to change the watchface, now the watch says "Xdrip+ watchface + services has stopped"

yosepito avatar Oct 01 '19 17:10 yosepito

Guys, you are not alone. I have this, too. I'm on vaccation till sunday, so can't do anything about this till then. I also believe it's date related.

Klaus3d3 avatar Oct 02 '19 18:10 Klaus3d3

I Have also the issue.

@Klaus3d3 thank you for the great work, using daily :)

krixoko avatar Oct 02 '19 20:10 krixoko

Thank you very much, @Klaus3d3 It's amazing how Amazfit-dependent I am right now. I miss it. Well this is the update: a) if I select any watchface but yours, and activate the service in the widget, the Amazfit works perfectly. What I do is shift right until the widget and let the watch to go to sleep mode. This way, every time I double-tap the screen or click the button I can see the BG and trend arrow This means the communication between smartphone and watch is working perfectly. It is just a question of anything in the watchface. b) this led to revise/read the code in the watchface. I am not an expert so I cannot interpret the meaning of most of the code. However, I noticed there is a routine that only works when the month has two digits: 10, 11 and 12 for October, November and December. It is here: xDrip-Watchface/app/src/main/java/com/klaus3d3/xDripwatchface/widget/MainClock.java

In the line 157 and following, the list of months contains December twice. One at the beginning of the list (why here and not at the end?) and another one at the end. This happens in all the languages. However, in the line 179 and following the short name for December is present only once at the beginning (why at the beginning? may this has caused this problem or the problem of past year in December?). Then, the routine for months with 2 digits starts in line 461. And it only activates "if(month>=9)". The following lines are for "months_3let" and "months". But since both lists contain a different number of elements, I guess it may cause an exception in Java language. I may be wrong, but I think this procedure and the bug in those lists may get the app confused since it is possible that the month 10 in "months_3let" and in "months" are different.

If @Klaus3d3 considers this may the problem, I'll be more than happy to have been helpful. Otherwise, sorry for my message. Please, I think we can wait until you come back from holidays. In fact, I have lived without a sensor for the last 30 years. Just we are getting tech-dependents ;)

yosepito avatar Oct 03 '19 14:10 yosepito

Another update: shouldn't the filter for the procedure be "strictly higher than"? I mean, it only has to do that in months 10, 11 and 12, but not in 9. So an additional thought is whether this should be if(month>9) instead of if(month>=9)

Sorry if I'm wrong...

yosepito avatar Oct 03 '19 14:10 yosepito

Thats what i thought, too. This is part of the original code from greatfit i just copied.

Klaus3d3 avatar Oct 04 '19 07:10 Klaus3d3

Greatfit code is the same at this point and greatfit still works. So maybe its something else

Klaus3d3 avatar Oct 04 '19 08:10 Klaus3d3

Is there any log file in the Amazfit we can check? Yesterday I tried once again to set the watchface by selecting it within the Amazfit smartphone app, and it heated a lot, got stuck in the screen (totally unresponsive) and with 20% of battery it drained totally to 0% in a few minutes... This happened October 1st, so somehow it must be linked to "date". What other routines are linked to current date/ timestamp?

yosepito avatar Oct 04 '19 08:10 yosepito

I have the same problems. After 10 second screen black, long time to wake up (freeze system) after press button and battery drain after few hours.

5xssro avatar Oct 04 '19 16:10 5xssro

Here is the fixed version. You will have to uninstall the one before installing you have because it has a different signature. Klaus is away for a while, you will get the official version soon. app-debug.zip

GreatApo avatar Oct 04 '19 20:10 GreatApo

not working for me @GreatApo

Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]ailure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

krixoko avatar Oct 04 '19 21:10 krixoko

@krixoko Uninstall the previous version first :P

GreatApo avatar Oct 04 '19 21:10 GreatApo

yes it is uninstalled, also confused

krixoko avatar Oct 04 '19 21:10 krixoko

@krixoko Try uninstalling with ADB. Amazfit tools and uninstallers some times uninstall the apk but not completely. The command is: adb uninstall com.klaus3d3.xDripwatchface

GreatApo avatar Oct 04 '19 21:10 GreatApo

thanks, will test it tomorrow :)

krixoko avatar Oct 04 '19 21:10 krixoko

@GreatApo, @krixoko: I used Huami Amazfit tool and installation was unsuccessful. What I did: (1) uninstall old apk, (2) reboot watch; (3) install the new one; (4) reboot.

After step 3 the same message appeared: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]ailure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

I guess it might be owed to the different signature so it's a kind of unauthorised update.... Now, I'll try to do it by using ADB. Don't know whether the bootloader should be unlocked for this (????). Mine is still locked. Will tell you further if I'm succesful

@GreatApo: Thanks anyway for the work! I discovered your repository and will also try your amazmod tool

yosepito avatar Oct 05 '19 09:10 yosepito

adb uninstall com.klaus3d3.xDripwatchface

Thanks. Uninstall with adb, reboot and install new apk working....

5xssro avatar Oct 05 '19 10:10 5xssro

an update with the solution that worked, following the recommendation of using ADB instead of Huami Amazfit tool: In light of the "update incompatible" problem, I re-installed the old Klaus3d3 version using the same Huami tool. Reboot. Checked the name of the apk that should be uninstalled using ADB adb uninstall com.klaus3d3.xDripwatchface

Uninstall succesful. Then installed the @GreatApo new version using ADB ADB install /path_where_you_have_the_new_version/app-debug.apk

Installation was sucessful Reboot within Amazfit, performed the procedure to select the watchface. It initially yield an error (watchface service stopped) but the watchface charged anyway. Went to widget to check that background service was active, and it worked perfectly. BTW: I have Spanish language installed and "send health data to Xdrip+" active.

Thank you very much once again @Klaus3d3 and @GreatApo You don't know how you have had a positive impact on my quality of life

new apk working!

yosepito avatar Oct 05 '19 10:10 yosepito

I tried to factory reset watch and then install GreatApo version and it was no go. 'Xdrip service has stopped'. Then I unistalled GreatApo version and couldn't install old version.

vebaba avatar Oct 05 '19 11:10 vebaba

I tried to factory reset watch and then install GreatApo version and it was no go. 'Xdrip service has stopped'. Then I unistalled GreatApo version and couldn't install old version.

To start with, uninstall each version with ADB and not Amazfit Tool. Additionally, on both versions there is also a bug when data are not available (sth that can be the case after a factory reset). I pulled request a fix which is not included in the version I uploaded because I want Klaus to test it. Here it is if you want to try it: app-debug.zip

GreatApo avatar Oct 05 '19 11:10 GreatApo

OK, thanks. I did uninstallation of your's version via adb and managed to install old version after that but still have 'xdrip service has stopped error'. I'm going to factory reset watch and try this latest version of your's. I understand that it will work. Thanks

vebaba avatar Oct 05 '19 11:10 vebaba

@vebaba : please, do let us know what software you are using to do so. Huami Amazfit Tool? Try to use ADB. In my case, after following the mentioned above procedure, and selecting the watchface in Amazfit, it yielded the same message but the watchface screen appeared anyway. Then went to the widget and be sure that background service is on

For ADB you will need to open a command terminal (I use Windows) and you will need the drivers (you can download from here) https://amazfitwatchfaces.com/downloads/drv_p1.zip

You should download ADB tools for Windows (if you are in windows). You can download from here: https://developer.android.com/studio/releases/platform-tools

Then extract the files from the zip downloaded. Go to that folder and by pressing the key "shift"+right click select "open command terminal here". You should have Amazfit connected to the computer. Then write this: adb uninstall com.klaus3d3.xDripwatchface

When done, reboot watch

Then following the same procedure, write this: adb install /path_where_you_have_the_new_version/app-debug.apk

Of course, it should be this new one

it should work

)

yosepito avatar Oct 05 '19 11:10 yosepito

OK, thanks. I did uninstallation of your's version via adb and managed to install old version after that but still have 'xdrip service has stopped error'. I'm going to factory reset watch and try this latest version of your's. I understand that it will work. Thanks

You don't really need to factory reset, just uninstall it.

GreatApo avatar Oct 05 '19 11:10 GreatApo

Wow, you're both fast... I started factory reset prior reading answers. @yosepito I used adb for both install and uninstall. I didn't check widget though. Maybe that was a problem...

vebaba avatar Oct 05 '19 11:10 vebaba

Wow, you're both fast... I started factory reset prior reading answers. @yosepito I used adb for both install and uninstall. I didn't check widget though. Maybe that was a problem...

It yielded the same message to me. Initially, it seemed to continue with the problem (unresponsive) but after a while it worked as usual. Although the service should be active when selecting the watchface, I checked it anyway in the widget. In light of the message, the service was stopped. Do activate it there and voilá

yosepito avatar Oct 05 '19 11:10 yosepito

I tried to factory reset watch and then install GreatApo version and it was no go. 'Xdrip service has stopped'. Then I unistalled GreatApo version and couldn't install old version.

To start with, uninstall each version with ADB and not Amazfit Tool. Additionally, on both versions there is also a bug when data are not available (sth that can be the case after a factory reset). I pulled request a fix which is not included in the version I uploaded because I want Klaus to test it. Here it is if you want to try it: app-debug.zip

This worked for me. Thanks for your help. I installed it via adb NOTE: I don't have a Widget in this version. I don't needed it, really. Just for your reference.

@yosepito Thanks for your help, too

vebaba avatar Oct 05 '19 11:10 vebaba

@vebaba I had the same problem but I don't know why :stuck_out_tongue: That is why I didn't upload it at first.

GreatApo avatar Oct 05 '19 12:10 GreatApo

Vebaba, you don't have the widget? Thats strange.

Btw. The service starts automaticly when u choose the wf and stops when changing to a different wf. The switch on the setup page of the widget is for times, when u want the data to the widget but want to use a different wf. Apos Greatfit WF does can show the glucose data, too, as soon as we fixed it. Then his wf gets can also get the data from my service. But that needs to be fixed first. We never finalized this.

Klaus3d3 avatar Oct 05 '19 18:10 Klaus3d3