Any way to reset a Bangle.js2 to factory settings.

Posted on
  • I've managed to get my Bangle.JS into a bit of an unresponsive state. In the course of trying to save as much power as possible to extend battery life, I started by turning off BLE. That looked good, because the watch no longer appeared when I scanned with my cellphone.

    "Great!" I thought to myself. "That works. Now I can go into settings, and turn it back on to finish developing my watch face." Except that now that it's running the first version of my watch face, the button does not enter the settings screen.

    I specifically did not disable "Wake on BTN1" after a discussion in another thread about maintaining the default behaviour of the button. However, at the current time, the button does cause the light to come on, but it does not enter the settings screen.

    So given this state, and the lack of BLE, what options do I have to get this thing back to normal operation. A long press on the button does eventually reboot the watch, but it returns to the above state. Is there some magic incantation I can cast to get it back to the factory default condition? While I'm at it, what could I have done that caused it to get into this state? I'd have thought that "Wake on BTN1" would have been enough, do I need to add something to the watch face itself?

    The watch face can be found at https://github.com/dgnuff/BangleApps/tre­e/master/apps/travelwatch and it can be deployed from https://dgnuff.github.io/BangleApps - look for "TravelWatch". At the current time, there are two additional timezones hard coded to test that logic, they work right if you live in the "America/Los_Angeles" timezone, but other than that they will be wrong. I'll be working with https://www.espruino.com/Bangle.js+Custo­m to fix that, but for now, I need to fix these other problems first.

    -- LATER --

    Got it back from the grave, I found that by rapidly clicking the button after a reboot, I could get it into a "Reset" screen. From there a factory reboot did the trick. That said, this is still a concern, because it probably won't come as any kind of surprise when I say that I really don't want to do this again.

    So what might have got it into that state? While I'm at it, how much of a drain is it to leave BLE enabled 24/7, just as long as I'm not actually communicating with the watch? I found the HRM in the watch, is setting "HRM Interval" to "Off" sufficient to keep the HRM disabled. And since I didn't see any references to GPS in the settings, does that just stay inactive unless something explicitly enables it?

    -- EVEN LATER --

    This is definitely a bug with the watch face. After doing the factory reset, I deployed the watch again, same behavior. This time it's far less of an issue, because I've left the "default" watchface as "AntonClock" that is baked into the firmware, and that one behaves correctly. So to get things back after starting my watch face, I can just reboot, it drops into AntonClock, and I can get to settings from there.

    But I really would like to know what's wrong with my watch face so I can fix it.

  • I think I mentioned at https://forum.espruino.com/conversations­/390481/#17137641 but if you use setUI({mode:"clock"}) it automatically sets up the middle button to go to the launcher - maybe you didn't have that?

    I found that by rapidly clicking the button after a reboot, I could get it into a "Reset" screen.

    Yes - on 2v19 if you hold the button while booting into the watch you get a Recovery menu which makes life a lot easier!

    Leaving bluetooth on while you're developing would save you some pain though!

  • I think I mentioned at https://forum.espruino.com/conversations­/390481/#17137641 but if you use setUI({mode:"clock"}) it automatically sets up the middle button to go to the launcher - maybe you didn't have that?

    That would be it. And now I remember why it's missing. I'd originally added that wen I first started creating the watch face in the emulator, and it generated the following error:

    Uncaught ReferenceError: "setUI" is not defined
     at line 279 col 1 in app.js
    setUI({mode:"clock"});
    

    so I had to remove it again.

    Can I offer a suggestion to add a setUI() function to the emulator that does nothing. It would allow that line to be present, thus permitting developers to use the exact same code in the emulator as they are in production.

  • Are you maybe missing the Bangle object at the start? It's called with Bangle.setUI({mode:"clock"});

  • That's the problem. Emulator is happy. Deploying to production - watch this space for details.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Any way to reset a Bangle.js2 to factory settings.

Posted by Avatar for dgnuff @dgnuff

Actions