Bangle.js breaking changes

Posted on
  • Hi! As I've been working on Bangle.js it's become apparent that the 8 character limit on Storage filenames is making everything needlessly confusing, with us using special characters like */-/=/+ at the beginning of filenames to denote file type. I keep forgetting all the time, and I imagine it's a nightmare for everyone else.

    So... I decided to increase the size of filenames allowed on Espruino, and to switch to using normal file extensions like .js and .json. This required a few changes in the Bangle.js firmware as well as in the App Loader and apps.

    I've taken the opportunity to really tidy things up, which should make the app development process a lot easier - **however this means that from now, you'll need to install a new Bangle.js firmware to keep using the app loader.

    However for those that don't want to update, I've provided a Legacy App Loader

  • Something seems to be wrong with the new loader.
    Reflashed with latest and Installed default apps, and now the "apps" screen looks like this:

    1 Attachment

    • 2020-02-28 14_36_05-Bangle.js App Loader.png
  • Thanks - just fixed.

  • "i don't always test my code but when i do i do it in production"

    Emulator button is broken also :)

  • "i don't always test my code but when i do i do it in production"

    That's how I do it :-P Lately on my Arduino cores, I've had 50/50 success rate with recent releases >.>

    I dislike testing software - I always assume because I do that for my job. When you have a large enough crop of users, they test everything for you!

  • Just fixed the emulator button. Yes, not ideal... Obviously I do test, but there's no specific test script so sometimes things get missed - this was a massive change though so there would always be some things that fell through the cracks.

    ... it's one of the reasons I'm trying to make these big changes now when it's only Beta testers that have the watches!

  • Great... does this mean this changes will be rolled up and available to StorageFile API soon/shortly/already available?

  • hey Gordon, after upgrading the firmware. The watch is stuck on the boot screen with the version. Not able to find anything in the troubleshooting. Help is appreciated.

  • after upgrading the firmware. The watch is stuck on the boot screen with the version. Not able to find anything in the troubleshooting. Help is appreciated.

    Have you tried uploading any apps from the apps store after the upgrade? If not, install the Bootloader, Default Launcher and any of the * Clock apps to get started.

    I had the same boot screen. I am not sure if the firmware comes with any default apps.

  • Ouch, that sounds bad. I'll fix it in a few minutes. For now, if you uninstall the welcome app (it manually install everything without it) then you should be fine.

    Update: It seems the welcome app broke if there was no setting.json file on the Bangle.js - however that's definitely uploaded with the settings app. I had this happen to me as well though, and what must have happened is the upload got corrupted somehow.

    I've now tweaked the welcome app so it'll just soldier on regardless, but it looks like I may have to add some kind of CRC check into the upload process to check that everything really has uploaded ok (it shouldn't really be needed as BLE has a certain level of CRC and lost packet detection).

    Edit2: seems like it may be to do with JS updates from Android. They seem significantly faster than on other platforms and it may be that they're so fast that the flow control isn't stopping things soon enough.

  • ... and yes, in new firmware the storage changes you can see in the GitHub changelog should be available to you.

    There's .length and longer filenames but I don't think there's anything else right now

  • I guess longer file names night be the cause of what I experienced:
    MDBT42Q module, updated to latest build (2v04.377 because why not), tried to upload some code direct to flash (wrote earlier, <50 lines, and known working), and weird messages began:

    >Uncaught Error: File already written with different data
     at line 1 col 1108
    Uncaught Error: Unable to find or create file
     at line 2 col 331
    ... start going forwards",1024);

    Tried uploading to ram, and the code worked just fine.

    Did the usual like reset(1), and when opened the new device storage, I saw two files with names like " , 0!. Looking at it, those were two fragments from my earlier lora experiments. Not full files, just fragments.
    Deleted both of those, reading raw file with Storage module, no files:

    > var st=require('Storage')
    =[  ]

    Try uploading code again, still doesn't work. Same error message. Checking storage again, there is a weird "file" again. Again fragment from earlier code. Now looked at the size, and it's 256 bytes.
    Upload again, and it's working now.

    Totally forgot about longer file names in three days, almost started a new forum thread when remembered this. I think some robust detection of earlier saved code & deletion could reduce support requests :)

  • Try 'Storage.eraseAll' - that should sort you out I think.

    Since the file format changed, previously written data really messes it up. I guess maybe I should add some global code that does a 'filesystem check' at boot

  • Thanks, it's working now. Yes, a check would be nice I think.
    Also, add it somewhere with large blinky letters. Like someone might be surprised if flash contents are gone, since that usually stays there when you update firmware version.

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

Bangle.js breaking changes

Posted by Avatar for Gordon @Gordon