Closed tom-a-horrocks closed 10 months ago
The error code is a Garmin error code: NETWORK_REQUEST_TIMED_OUT: Request timed out before a response was received https://developer.garmin.com/connect-iq/api-docs/Toybox/Communications.html
This should have nothing to do with the watchface itself, but somewhere in the communication it does not continue or nothing comes back: Watch -> Garmin Express -> xDrip (?) -> Garmin Express -> Watch
You write that you have deactivated all battery optimizations. Also those of the system Bluetooth apps?
Otherwise, I have no idea what the problem is with this error code... Normally I see this error code when the internet address is not correct (NIghtscout URL) or the web service is not accessible (app terminated in the background, website not accessible, web service not activated in the app (e.g. xDrip) etc.).
By the way: I have of course been using the watchface around the clock for years and have not experienced this problem (currently: Samsung Flip 4, Forerunner 955, previously other smartphones and watches).
Thanks for replying to this. I tried disabling as many bluetooth-related power saving settings as possible, and also set the global power-saving option of "do not optimise". I've notice that the xdrip+ test link (http://127.0.0.1:17580/sgv.json?count=12) times out unless the app has been opened recently... so it seems like it's probably an issue with xdrip or android. I'll post again to this thread if I find a solution.
Is it conceivable that xDrip+ is being deactivated here by some optimization in the background (you write that you have checked everything)? Is Juglucco possibly running in parallel? Depending on the settings, Juglucco responds on the same port. If the request to xDrip+ times out, then this is definitely the cause. That should certainly work! Good luck!
Update: I've tested with different watches and different phones, and the problem is definitely with my Pixel 7 / Android config. I discovered I hadn't actually disabled bluetooth power saving... it was in a menu I hadn't found yet. For anyone else reading this, you can disable system bluetooth power saving by following the instructions at the bottom of this page. This has fixed the Error -300.
Unfortunately, there's still a delay with the watch update. I've managed to confirm that this is due to the xDrip+ web service not responding. Basically, whenever the watch face isn't updating, the xDrip+ test link is also timing out. Conversely, if the xDrip+ test link is working, the watch face is updating as expected. So the problem is definitely the xDrip+ web service becoming unresponsive, which happens if xDrip+ hasn't been in the foreground for a while.
I don't run Juglucco or anything else like that, just Dexcom G6 app, XDrip+, and Garmin Connect etc. I'll ask over at XDrip and see if they have any ideas.
Okay, I've found a solution. It turns out Pixel 7 suspends the execution of cached (background) apps, which was preventing the web service from responding. This can be disabled globally by changing the developer option below.
Settings -> System -> Developer options -> Suspend execution for cached apps -> "Disabled" (previously: "Device default")
That mostly fixed the problem, but it was still a little flakey. I found that resetting my launcher helped with this... maybe the Android 13 to 14 update was not totally clean. To reset the launcher, do the following. Warning: this resets your homescreen apps and widgets to factory, so you'll have to make all your shortcuts etc again.
Settings -> Apps -> See all Apps -> <Three dot menu -> Show system> -> Pixel Launcher -> Storage and cache -> Clear storage
I've created a discussion in the XDrip+ repository to see if there's anything they can change in XDrip+ that would prevent suspension, but in the meantime you might want to consider adding the workaround above to your readme. Thanks for your help with this :).
Thanks a lot for your hints! I never heard or read about this ...
Thank you for making this watchface, it's really improved my life over the past year I've been using it. I'm writing because I get some synchronisation issues where the watch face stops syncing for around 15 - 60 mins every now and then. Often there's no error code, but occasionally it's -300. I wish I could give you more information, but unfortunately I can't find a way to trigger it reliably.
I've disabled all battery optimisation (as per dontkillmyapp) and updated android, garmin connect, garmin connect IQ, and the watch firmware. Phone is Pixel 7 & watch is Venu 2s. This issue has also survived multiple watch versions, android versions, and a phone wipe.
I'm a programmer, so happy to help out where I can if that's something you'd like.