"Failed to turn on the backlight, 1 min limit exceeded" exception when calling Attention.Baklight for the first time.

I'm trying, without success, to wake the screen in a Data Field right before calling a DataFieldAlert.

It's working fine in the simulator, but when I test on my Venu 2s the app crashes. I've added a try and catch and recorded the error, I'm getting this message:

"Failed to turn on the backlight, 1 min limit exceeded."

It happens the first and only time that Attention.Baklight is called. Doesn't matter if the screen is on or off. 

public function compute(data as Activity.Info) as Numeric or Duration or String or Null {
    if (!_alertDisplayed){
        try {
            Attention.backlight(0.5f); // It crashes here
        }
        catch (e instanceof Lang.Exception) {
            System.println("!!! EXCEPTION CAUGHT: Backlight on failed !!!");
            System.println("  Error Message: " + e.getErrorMessage());
            System.println("  Error Code: " + e.getErrorMessage()); 
        }
        Attention.vibrate(vibeData);
        WatchUi.DataField.showAlert(new $.DataFieldAlertView());
        _alertDisplayed = true;
    }
    return "--"
}

Not sure if it's a bug or if I'm missing something. It's the first time I try to use Attention.Baklight

  • Hey, this thread sounds like it's related to your issue, especially the final post:

    https://forums.garmin.com/developer/connect-iq/f/discussion/300499/attention-has-backlight-crash-on-venu2/1747174#1747174

    We got the same error starting a few weeks ago for venu 2 devices. There is an Unhandled Exception error caused by a line where backlight is set to true.

    Unfortunately the final post was made over a year ago, and the OP is 3 years old, so I'm not sure if this issue will ever be resolved.

    Does the activity AOD mode (enabled or disabled) make a difference?

  • I got this today as well in my app (also on a venu2s).

    Unfortunately nothing seems to work to be able to get the backlight to turn on from the datafield, it always just throws an exception with the message "Failed to turn on the backlight, 1 min limit exceeded".

    I tried a few things

    * Wait 1 min with the backlight off, then call - still throws
    * Call it whilst the backlight is already on  - throws (id expect this to be a noop, esp if the level already matches)

    Did you ever get this to work? It use to work fine for me a while ago, but I suspect a recent firmware change has broken it.

  • Not sure if this will be a double post, first one was marked as spam.

    I had the same issue on my venu 2s tonight (after months of my datafield alerts working flawlessly)

    No matter what I did it still failed with the '1 minute" exception every time i tried to use the backlight.

    I tried waiting for over a minute with the backlight off - still throws on first call

    Finally what worked was rebooting the watch, and everything works again. So somehow I guess on garmins end it was locked to 'never allow'. Not sure if this is a new firmware problem or if it just gets stuck in this state after a while.

  • The documentation is vague: "Calling this repeatedly can hold the display on, but if the product has burn in protection an exception will be thrown if you attempt to keep the display enabled for too long (e.g. over 1 minute)."

    My guess is that this might not be every time you turn the backlight on, but it accumulates the time since the app started, so if you turn it on for 10 seconds, then off, then on again for 10seconds, then it'll work 6 times but will fail on the 7th time.

  • Yeh I suspect similar.

    It's worth noting I was experiencing this on fresh boot of the datafield, in a new activity. Maybe the accumulation is logged against the datafield for longer than the lifetime of the activity though. I'd still expect it to time out after 1minute of not calling any backlight methods though.

    Perhaps side loading the datafield for testing, then installing a newly released version caused some race condition/conflict that caused it to always reject all calls to the backlight methods.

    I have not seen the issue again since the reboot, so I guess it's fixed for now at least.

  • I would think it's somehow stored together with the session. Or the app itself. Try if Resume later changes anything