Acknowledged

Instinct 2S completely hangs with BLE bg wf

i'm developing a BLE background watchface and am seeing complete watch hangs on Instinct 2S after about 1 to 2 days of running the wf (and I believe FR 965M but I have stopped testing that due to its inadequate battery.)

i'm not sure which connect iq calls are causing this but i will try to gather more info. since it happens so infrequently (i've seen it at least 3 times and have never been able to get past 2 days of runtime so i'm sure i'll see it again), i'm starting this bug report now anyway to see if others have seen it.

the only thing i can do to the watch after the hang is hold the light button for a long time to power it down, it responds to nothing else and does not update the wf at all.

  • i wasn't able to speed up the sensor at all, and the test that i was doing with phone connection on, re-scanning every time, and only reading 1 characteristic - the instinct2s hung again after ~1.5 days of that.  fwiw when hung the light still works but none of the other buttons either short press or long press does anything. connecting it to the computer also does nothing.  all i can do is a very long press of the light button to turn it off.

    the time of hang is the time shown on the watchface, since it no longer updates, it was 6:12AM.

    looked at the logs after hang and there is nothing recent in CIQ_LOG.YML, 

    in the application log it shows the wakeup before the hang is at 6:07AM, and it proceeds to scan, connect, and read and then exit, all successfully.

    the last logged wakeup is 5 minutes later at 6:12AM (surprise) and only the app initialize() function and onTemporalEvent() are called, the latter shows memory is still fine:

    memory: total: 28688, used: 15528, free: 13160

    but shortly after that it should do a registerProfile() and then another print when that returns, which is not in the log (may just not have been written, or never got there.)

    i did count and log the # of unsuccessful/timed out temporal events, there were 35.  there isn't one shown in the log so i've no indication that is what causes the hang.

    but i will try your onSensor workaround for avoiding bg process auto-timeouts next.

  • that's pretty cool, i'm trying something on the sensor to see if i can speed it up, if that fails i'll try this - thanks!

  • Just a guess, but maybe there are times the sensor is taking too long to respond, and after 30 seconds, your background is killed, leaving the device paired and in an odd state on the watch

    For something else, I tried a simple hack in the background, as you can't use a timer there.  I'll see if I still have the code, but it's kind of like this.  In onTemporalEvent I do this:

        Sensor.setEnabledSensors([Sensor.SENSOR_HEARTRATE]);
        Sensor.enableSensorEvents(method(:onSensor));

    so onSensor is called about every second, and after say, 28 times it was called, I did the cleanup of the (ANT) sensor I was trying to use.

    Maybe try something like that?

  • even 5 seconds for the f7p strikes me as pretty high.  I moved to a sample watchface I did years ago for the thingy52 https://forums.garmin.com/developer/connect-iq/f/discussion/8182/a-very-simple-wf-with-a-background-that-talks-ble-to-the-thingy52

    I don't have access to what's going on in the thingy, but I do have it set so the led changes color when something is connected to it.  The Thingy goes to sleep if nothing is connected to it for 3 minutes and it's stationary, so I have to keep it moving (it's in my pocket right now).  And reading two characteristics from 2 services seems to take about a second or two.

    Can you ask whoever developed your sensor if they understand what's going on?

  • i have 1 char read going now, here are the times my sensor side sees between connect/disconnect:

    i2s: 13 sec
    sim: 16 sec
    f7p: 5 sec

    there's probably some kind of weird legacy ble thing going on between the sensor and the i2s/sim, which the f7p has fixed/worked around.  regardless, i can't change the sensor side unless i abandon the project entirely.