Espruino 2v10

Posted on
  • Espruino 2v10 has just been released.

    Some huge changes this time!

    The biggest one is the merge of the experimental_compact_vars branch, which adds roughly 20% more JavaScript variables to most builds, within the same RAM footprint. Performance suffers by around 2% but for the vast majority of users the increased memory should be a massive benefit. More info here...

    Other changes are...


    • Support for Bangle.js 2 when released
    • New HRM and step counting calculations
    • Peripherals are kept on during app load, which avoids a pause in activity on GPS
    • Add support for color schemes (eg black on white)
    • Support for rendering 3 bit images
    • Fix issue where long-press BTN3 while holding BTN1 would reload the app but wouldn't load configuration
    • Bangle.setUI added to ease usage of setWatch/etc for clocks
    • Display small 'Loading...' screen to show something is happening when loading apps
    • g.flip no longer keeps the screen awake
    • ANCS support added (not enabled by default)
    • Add Bangle.getGPSFix to get last GPS fix without waiting for a listener


    • Support for Puck.js 2.1
    • Self test now only happens if button held at first boot


    • Add Graphics.blit command for fast copies within a single Graphics instance (only offscreen in Bangle.js 1)
    • Graphics.scroll can now scroll a partial area (inside cliprect) (only offscreen in Bangle.js 1)
    • Add Graphics.getBPP
    • Allow g.drawImage to use ArrayBuffer Graphics as an argument


    • 'BLE task in progress' messages now give a readable name, not task number
    • Fix issue where Bluetooth getPrimaryServices could fail with NRF_BUSY
    • Bluetooth stack errors now report a line number


    • Fix 2v09 regression where clearWatch reset pin state, removing pullups
    • Fix issue where full storage could cause Espruino to think it was corrupt and do an erase.
    • Fix Storage issue where flash compacts could cause functions executing from flash to be relocated wrong
    • Serial1.unsetup can now be called even if Serial wasn't enabled
    • Add E.decodeUTF8 for easy UTF8 decoding
    • Util timer no longer 'drift's if left running
    • Fix issue with .then().then(...) on an already-resolved promise
    • Add ArrayBufferView.subarray for easily making subarrays (eg a.set(a.subarray(-1)))
    • Solve case where an ArrayBuffer set using the same array could duplicate entries (a.set(a.subarray(),1))
  • I just flashed my Bangle 1 the other day and two things I noted. 1) I got the Storage corrupt message, and it wiped out my Storage (nothing I couldn't rebuild, but...) and 2) I am now occasionally getting the ERR_CONN message, which doesn't seem to affect anything, and I can't yet reproduce it on demand.

    Other than that, things are good... and thanks for all the new features!

  • Argh, shame about the Storage erasure. That's interesting though - do you remember if/when you last did 'Install Default Apps' or a full storage erase? I guess it could have been a much older firmware that had the problem.

    Hopefully that won't happen to you again as new firmwares shouldn't cause any issues with the Storage. I guess if this ends up being a common issue it might be possible to look at repairing and trying to keep existing files rather than just erasing. Ideally I'd need to find a way of reproducing damaged storage first though.

    If you get ERR_CONN again, please could you post up a new thread about it with a screenshot of the error? I don't remember seeing that error - if we can find a way of reproducing it here I'll look into it

  • One of the listed changes is that "g.flip no longer keeps the screen awake" but the hardware reference says that Graphics.flip "will cause the screen to light up if it was previously off due to inactivity". So is the documentation now incorrect, or is there a subtle distinction I am not seeing?

  • No, you're right - documentation is out of date. I'll get that fixed!

  • Hi, just wondering why the change to the g.flip() function was made? Now what can I do to keep the screen on? (I'm new to BangleJS by the way)

  • It is for buffered usage of transflective displays, such as of the Bangle2JS, which do not need backlight to turn on. With original BangleJS (Bangle1JS), which has a transmissive display, there was no point to have the flip (the buffer) and power on (of backlight) separate, but with Bngle2JS is makes sense in bright ambiance light condition and would be a power waste but power on is used separately / independent when ambiance light absent.

  • just wondering why the change to the g.flip() function was made?

    It was a longstanding issue that when using the doublebuffered graphics mode you had to use g.flip() to put the data on the screen. That meant that if you had for example a double-buffered clock face that updated once a second, or a game, it would force the LCD to stay on all the time and would never let it time out.

    It's better to be able to split the two up, so you can keep updating the screen and then respond to the lcdPower event in order to stop what you were doing when the LCD turns off.

    Now what can I do to keep the screen on?

    You can just use Bangle.setLCDPower(1) to 'poke' the LCD or can call Bangle.setLCDTimeout(0) which will just stop the LCD from turning off until you change to the next app.

    If you spot any apps that turn off now when they should stay on, please let me know and I'll update them.

  • Just to let all know: 2V10 is not working for ESP8266. Will take a look into next week.

  • I updated to 2v10 and now I'm having an issue where if I switch apps while a notification is open, the notification will get "stuck" and won't go away until I either get another notification or restart the device. It looks to me like the LCD offset isn't being reset.

  • Ok, thanks - that definitely seems plausible. I'll try and get a fix in for that tomorrow

    edit: fixed now. Will be in cutting edge builds, or 2v11

  • Just pulled and tested again on ESP12 - everything is running again as expected.

      VERSION: "2v10.154",
      GIT_COMMIT: "95781609",
      BOARD: "ESP8266_4MB",
      FLASH: 0, STORAGE: 196608, RAM: 81920,
      SERIAL: "5ccf7f74-6e1d",
      CONSOLE: "Serial1",
      MODULES: "Flash,Storage,hea" ... "r,crypto,neopixel",
      EXPTR: 1073647724 }

    looks like some of @fanoush pr fixed ESP12 too - Thanks!

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

Espruino 2v10

Posted by Avatar for Gordon @Gordon