• I've been working on a clock face app. It's been going well before but now I've run into an issue that I can't seem to get around.

    Following these steps

    • Install clock face on BangleJS 2 from my github.io repo BangleApps page, clock face shows up as expected
    • Update code, push to github repo, wait until changes are reflected on my github.io repo BangleApps page
    • Install update to BangleJS 2

    Looking at the output from interacting with the app, the code hasn't been updated. E.g. the app from first install echoes console.log() output. After installing the clock face update, the console.log() is still being output, even when I have removed them from the code.

    The only way to make the code changes "stick" is either

    • Flashing the app through the Espruino IDE, or
    • Resetting the BangleJS 2 and installing the latest update of the clock face app (which in my example doesn't have the console.log() code)

    Is this to be expected? It's certainly very cumbersome to me to hve to reset the BangleJS 2 just to make sure that my latest code updates are working correctly.

    Firmware version 2v15

  • Thats's odd - it isn't expected... You could check the Chrome Dev console when you upload to see if the file you expect is being downloaded by Chrome.

    I know that GitHub does very aggressive cacheing. You could try Ctrl+click on the page reload button which might help?

  • Yeah, "very aggressive cacheing" seem to be one of the keys to this behaviour.

    But, let's say I wanted to avoid going through GitHub to upload my bundle, as it's cumbersome and fiddly, is there a way to accomplish that? That way I'd be able to do my edits and experiment with the entire bundle, locally, before having to deal with Github as the go-between.

    Thanks for a super fun and versatile product! You've re-sparked my interest in coding for a watch since the days of the Pebble era.

  • But, let's say I wanted to avoid going through GitHub to upload my bundle

    You could host the app loader locally? I don't know what OS you're on, but if you can install a webserver (it doesn't even have to be HTTP) then you can just use the app loader direct from your PC. That's how I develop.

    You can also use a command-line app that uses Node.js: https://github.com/espruino/BangleApps/b­lob/master/bin/apploader.js

    But especially on Windows this is a pain, as Node.js doesn't appear to have great Bluetooth LE support on Windows.

  • You can also use a command-line app that uses Node.js: https://github.com/espruino/BangleApps/b­lob/master/bin/apploader.js

    Ooh, I was just thinking it would be nice to have that, without even realizing it already exists, nice!

    FWIW: if you've got npm installed anyway, you can (after doing npm install) use npm run local to start a webserver on localhost

  • You're absolutely right. I've managed to put up a dockerised environment that works on both winows (through WSL 2) and Ubuntu 20.04 and this has improved my situation immensely, especially with the fact that I don't get stuck in cache-hell of Github.

    Now, the apploader.js I haven't got to work yet. I can get it to detect my watch but as soon as I try to install anything I run into issues in the shape of

    $ node apploader.js install about 12:ab:34:cd:56:es
    ...
    App storage contains a 'supports' field, but no device ID found
    App storage contains a 'supports' field, but no device ID found
    
    /home/node/app/core/lib/heatshrink.js:37­
    ...
    abort(App storage contains a 'supports' field, but no device ID found). Build with -s ASSERTIONS=1 for more info.
    
  • Just tried here and same problem - I made a few changes, try now and see if it's better.

    I had to hard-code the device to Bangle.js 2 but I guess that will suit most people, and changing it if you have a v1 is very easy

  • That worked out much better! Thanks for this, really appreciate you spending your time on it!

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

[Dev] Uploaded code changes doesn't update app on BangleJS 2

Posted by Avatar for user148848 @user148848

Actions