onSleep getting missed by WatchFace

I have a epix (gen 2) with the AMOLED display, not using the wrist gesture option, and I'm having issues getting my watch face code to properly determine the sleep status in certain situations.

I'm using a variable that is set / cleared on the onEnterSleep() and onExitSleep() functions.  Based on the forums that seems to be the usual method.  This is then used to manage the display between the standard and low power faces.

On this watch, I've noticed a scenario where the the watch face app exits the sleep mode (and calls the onExitSleep() properly) and re-enters the sleep mode without calling noEnterSleep();

It seems to happen when the watch face loses focus.  For example... watch face is in sleep mode as normal.  The watch receives a notification from a phone via BTE, which "wakes' the watch.  onExitSleep() is called, but the display moves to the notification focus.  The low power timeout is only 8 seconds, and while the notification message is still on display, the backlight reduces AS IF the watch is going to sleep mode.  After the 30 sec timeout for the notification, the display changes back to the watch face but the watch face app never received a call to the onEnterSleep() so it displays the standard face with the lower backlight.  It will stay in this indefinitely or until something else happens.

I've seen this on multiple watch face apps, including the one I'm writing myself.  Since the isSleepMode property was phased out, there doesn't seem to be a way in the APIs to verify whether the watch is in sleep mode through code.  So the app can't verify it's in the right mode.

Has anyone else seen this?  Or possibly have any ideas on what could be causing this?  I'm not extremely good at debugging directly on the watch (I'm still very new to Garmin and MonkeyC) and the CIQ simulator doesn't seem to simulate these activities that take focus on the screen.

I would be very interested in anyone else's opinion...

  • What version of firmware do you have? There is some bugs in 8.37 connected with power fixed in beta e.g.

    Fixed issue where a Connect IQ watch face would be stuck in its high power display while watch was in low power mode.

  • What this is kind of sounding like is a common problem where folks try to save battery.

    When onUpdate() is called, you always want to update the entire display,  Not just parts.  With things like notifications, you don't know what on the screen needs to be updated.  On some devices, the screen is cleared before you see onUpdate,  Always update the entire display.

  • I do have 8.37 firmware on the watch itself.  Should I be upgrading to a beta version?

  • The very first two commands in my onUpdate function are setting the color and clearing the screen.  There's also not any documentation on how the non-WF or app calls are made, like what exactly happens with the OS is taking control of the screen to display a notification.  So it's been tough to try and figure out what's happening.

    I'm going to upgrade the firmware and see if this solves the problem.

  • when you update you can't check app on current SW but it' should be checked in past Slight smile but you will know what happens in future

    I rather install  beta - but you have to know it can be dangerous for watch so your decision and don't blame me Slight smile

    To calm you down, I know a few people who use beta - but still your decision.

  • I don't mind trying the beta, I'd just like something to work!
    And shame on me.... but I hadn't confirmed this similar behavior on the stock watch faces.  Doing that now...

  • With betas, there's a roll back version of the FW included.  It resets the watch, but you can recover.

    And again, stock watch faces are NOT written in CIQ.  They operate differently.  If you want to try something similar to yours, download something from the app store.

  • There is another case

    - start activity without CIQ data filed

    - back to WF

    - I can see that WF goes sleep and there is high power and onUpdate is called every second (usually low power is called every minutes)

  • While this issue is VERY repeatable on my quickie custom WF, and one I had gotten off the Connect IQ store (which is why I started researching this)... the Garmin watch faces do not exhibit this same problem.  Using a Garmin WF, the backlight goes into low power mode while the text notification is on the screen, but when the watch face gains focus again, it is the correct low power watch face.  So Garmin is doing something we are not.. (or at least me and one other developer are not).