Avatar for Gordon

Gordon

Member since Sep 2013 • Last active Oct 2022

Most recent activity

  • in Bangle.js
    Avatar for Gordon

    So it seems to me that there is some code which after the button has been pressed between 1 and 1,5 seconds will effectively clear all intervals and times.

    Ahh - yes, this is the app reload code.

    The button does two things:

    • If held for ~2 secs it loads the default clock face
    • If held for ~10 secs it resets the device

    The code will stop the ~10 second timer from happening, but not the 2 sec one. So the watch will still reload the default clock face which will then stop your code from running.

    If your code was 'boot code' then it would run even after the reload.

    So for example if you write setInterval(E.kickWatchdog,1000); to noreboot.boot.js then long-pressing the button will not reboot the watch (but it will still cause the default clock app to reload).

  • in Bangle.js
    Avatar for Gordon

    I'm not 100% sure if Gadgetbridge does collect location data. It has to ask for permissions, but that is actually what is required to access Bluetooth!

    But yes, that's a good idea. I feel like it's definitely something that could be added to Gadgetbridge. It could be an option in the 'Android Integration' app and when enabled, if the phone is connected it can override Bangle.setGPSPower so it uses the phone's GPS instead

  • in Bangle.js
    Avatar for Gordon

    You can get/set all the handlers pretty easily with E["#onfoo"] without, so yes a library to handle that would work pretty well

  • in General
    Avatar for Gordon

    Ok, well that code implies that there would be a heart rate if you had 5 bytes of data advertised.

    ... but you only have 4, so your heart rate is not being advertised by the band - I guess it must need configuring somehow to advertise it?

    Bytes 0+1 are your step count I guess. But bytes 2+3 are both zero so those are unlikely to be heart rate :)

  • in Bangle.js
    Avatar for Gordon

    The code @fanoush posted is the best way.

    Hard-coding a 'wait' in Espruino (and JS in general) really doesn't work very well.

    async/await is just a wrapper around promises, and Espruino has promises so you can do everything you can with async/await in Espruino, just slightly more verbosely. However in this case I don't think it helps you...

  • in Bangle.js
    Avatar for Gordon

    Is there a way to block or clear existing events,

    Well, if apps use Bangle.setUI then the handlers are all stored: https://github.com/espruino/Espruino/blo­b/master/libs/js/banglejs/Bangle_setUI_Q­3.js#L12-L31

    So potentially you could find those, remove them and re-add them after... But there is no way of flagging that an event is handled and shouldn't be propagated at the moment. If there's a sensible way to do this I could maybe include this in the firmware though

  • in Bangle.js
    Avatar for Gordon

    Yes, the hideable widget bar is exactly the kind of thing we need. It could be added to https://github.com/espruino/BangleApps/t­ree/master/modules and required...

    Does this clash with other apps using the setLCDOverlay or would the widgets just no longer be displayed if for example another app shows notification with this method?

    Yes, it's just be the last call to setLCDOverlay. Hopefully after a while the widget bar would auto-hide and things would reset though

  • in General
    Avatar for Gordon

    In the uploaded file you can see a screenshot how the setting for Heart rate looks in the nrf Connect app

    You're connected to the band when you see that. It's not something that is being advertised...

    Flower care works because it advertises the data.

    You can set up EspruinoHub to get the data via https://github.com/espruino/EspruinoHub#­connections but it will be connected to the watch band constantly and so won't be able to scan for other advertisements.

    When you look in the Scanning tab of nRF Connect do you see any data that could be heart rate? If so maybe screenshot that, and I can show you how to add it.

  • in Pico / Wifi / Original Espruino
    Avatar for Gordon

    Hi,

    The Pico + ESP01 module shouldn't draw that much power in deep sleep. What's the power draw if you upload no code at all apart from setDeepSleep(1)? And what if you disconnect the eInk display?

    On STM32 when you do setDeepSleep it should shut off the Serial port automatically, but as you say there could be pullups... Since Serial will automatically want to pull the pin up, but if ESP8266 is off, it may be being parasitically powered through those serial pins.

    Maybe when you're not using the ESP8266 you could turn it off and then do RX.read();TX.read(); to set both the serial port pins to inputs?

  • in Bangle.js
    Avatar for Gordon

    Imageclock always loads the widgets and then replaces the draw functions with functions doing nothing and restores them as needed

    Ahh, yes, that'd do it! That would all need undoing... It's the kind of thing that (IMO) we should turn into a library and then maybe the library could handle it automatically.

Actions