onExitSleep() not triggered

onExitSleep() seems to be working fine when tested in the simulator for va3 and fenix 5x. But on a real device onExitSleep() does not seem to triggered even though the gesture is recognized on the device as the light is turned on.
The below code works in simulator but not on device.

Tested myself on va3 with SW-Version 2.60 with CIQ 2.3.4, Eclipse 4.6.3 with CIQ 2.3.4

using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.System as Sys;
using Toybox.Lang as Lang;
using Toybox.Application as App;

var lowPowerMode = true;

class TestWatchView extends Ui.WatchFace {

function initialize() {
WatchFace.initialize();
}

function onLayout(dc) {
setLayout(Rez.Layouts.va3(dc));
}

function onShow() {
}

function onUpdate(dc) {
var time = Sys.getClockTime();
var field = findDrawableById("Label");
field.setText(time.sec.toString());
field = findDrawableById("Label2");
field.setText(lowPowerMode.toString());
View.onUpdate(dc);
}

function onHide() {
}

function onExitSleep() {
lowPowerMode = false;
}

function onEnterSleep() {
lowPowerMode = true;
Ui.requestUpdate();
}
}

  • I'm seeing the exact same problem. It works in the simulator but not on the Vivoactive 3 (SW-Version 2.60).
  • It actually appears that this is a problem with gestures in general. It's not that the CIQ function is not called when onExitSleep is called, but rather, the gestures on the device are not working. I am currently on 2.80 and getting no backlight on gesture and no onExitSleep() called which means to me that the native gesture function is not being triggered. I've got a ticket logged with the device team.

    Thanks,
    -Coleman
  • GidoG,

    I have word from the vivoactive 3 team that they have this fixed in an upcoming Beta v. 3.01 which will later be in the public release. This will take a little bit of time to make it to the production products, but it has been addressed.

    Thanks,
    - Coleman
  • Dear all, I wonder how you trigger the onExitSleep() in the simulator. I do not find a menu entry for it. And: Am I right that onExitSleep() is called upon the "look at watch" gesture?
  • In the sim, under "Settings", "Low Power Mode" is used for this with watchfaces. If it's checked, onUpdate() is called every minute. Unchecked, onUpdate() is called every second, with onEnterSleep()/onExitSleep() called when there is a transition.

    On a watch, (after startup), onExitSleep() is called due to a gesture, and about 10 seconds later, onenterSleep() is called.
  • Hi, on some devices with some updates, the gesture is linked with the backlight behavior... Here is a workaround, turn on backlight after sunset for exemple and onExitSleep works again.