Bangle.js - app upload - upload failed

Posted on
of 2
/ 2
  • Just received my Bangle.js and it looks great, thanks for your amazing effort in getting these devices out at such a difficult time.

    I've updated it to the latest firmware, and tried to upload an app but each time it gets 99% of the way there then displays an error message in an orange bar at the bottom: "Upload failed, Unexpected response" - but nowhere does it say why it failed or what the unexpected response was.

    Can anybody advise how I can find what's going on? Maybe some logs written somewhere?

  • Hit F12 (or the key that brings up browser dev tools in your browser. Most commonly F12), find the "Console" tab, and look for clues there.
    Can you connect to it with the Web Ide? Just as a sanity check: try executing something simple like executing 1+2. Does that work?

  • So, I can connect to the Bangle from the IDE, send it commands and all works as expected. However the problem seems to be that sending it a "reset()" command causes the connection to drop and it then can't be restored without re-pairing. As the app upload issues a reset() then all commands it sends subsequent to that are lost.

    Issuing "reset()" causes the Bangle to reply "=undefined" (presumably expected), then either the IDE or the Bangle prints "-> Terminal", but after that there is no more response from it until I disconnect and reconnect (see screenshot).

    I observe this behaviour on both my desktop Mac and my iPad using the special Bluetooth-enabled browser.

    1 Attachment

    • Screenshot 2020-03-19 at 10.07.57.png
  • @chrisotherwise are you uploading Apps from the official BangleApps repository or a custom App you built yourself. If it is a custom app and an open URL could you share the URL with us :-)

  • It's any of the official apps from the repo. Not even close to writing one myself yet, although I have some exiting ideas in mind. But I believe the problem to be in the "reset()" command rather than any of the apps.

  • Okay... looks like I am a little behind on the Github repo as well as Firmware... can you run the "About" app on the watch a post a picture of the watch face... or just run process.env in the WebIDE terminal and let us know what it returns. Thanks.

  • My process.env returns the following and I was able to upload the 'Default Alarm' app just now...

    I am guessing my firmware version 2v04.398 is a few behind the latest.

    Found BANGLEJS, 2v04.398
    Connected to Web Bluetooth, Bangle.js ed8a
      VERSION: "2v04.398",
      GIT_COMMIT: "292f7d0d",
      FLASH: 524288, SPIFLASH: 4194304, STORAGE: 4194304, RAM: 65536,
      SERIAL: "a0cf0da6-7b6c234d",
      CONSOLE: "Bluetooth",
      MODULES: "Flash,Storage,hea" ... "tensorflow,locale",
      EXPTR: 536883676 }
  • Thr 2020.03.19

    reply to post #3

    The original post indicated a failure to upload apps, failing around 99% but now there may be an issue with the reset() command.

    Before this thread morphs, are there actually two separate issues?

    What was done, such that apps from the official BangleApps repository now upload?

    and, post the results of process.env as indicated in post #7 please.

    'causes the Bangle to reply "=undefined" (presumably expected)'

    Yes, True­-a-command-why-does-espruino-print-undef­ined-


    'reset the underlying hardware'
    'If reset() is called with no arguments, it will reset the board's state in RAM but will not reset the state in flash'­_reset

    Could some erroneous code be lurking about in Flash?

  • Here's my process.env(). Just for full disclosure, I received my Bangle, tried straight away to upload an app and encountered this problem - so I updated the firmware, no issues doing that.

    VERSION: "2v04.404",
    GIT_COMMIT: "8d193bab",
    FLASH: 524288, SPIFLASH: 4194304, STORAGE: 4194304, RAM: 65536,
    SERIAL: "251131b5-18f4c898",
    CONSOLE: "Bluetooth",
    MODULES: "Flash,Storage,hea" ... "tensorflow,locale",
    EXPTR: 536883676 }

  • Thank you, that should assist others.

    Please review post #8 as our individual "Post reply"'s may have crossed.

    'and encountered this problem'

    Which encounter is being referred to, uploading or reset?

  • To answer your questions above:

    • 100% of app uploads fail on my device when using the app repo uploader
    • I have never managed to complete an upload successfully
    • Looking at the output in my browser console, the Bangle stops responding when the "reset()" command is issued to it by the uploader web page.
    • Once this has happened, you then need to re-connect the Bangle before you can use it again.
  • Thr 2020.03.19

    Was save() ever typed in? ref to erroneous code in flash post #8

    While the newly shipped Bangle's make their way to their eagarly awaiting developers and as there are daily app and firmware changes, not 'all' software issues may be initially apparent. It might get a bit frustrating should an unfortunate area of concern get through testing.

    While others take a looksy under the hood, as pointed out in post #7 there is a previous firmware that may be used that appears to be stable. Flashing that may work as a temprorary choice until matters are ironed out.

    Does anyone else have either of these issues with VERSION: "2v04.404"?

  • Good idea, I'll try flashing the earlier version and see if it makes a difference. If it fails then I've probably got a local problem..

  • @chrisotherwise I just flashed 406 (which is now the latest) and it seems to work. Uploads are working. So I would say, stay on the bleeding edge and get the latest again, and see if it changes.

  • I flashed 406, still the same problem. As soon as the reset() command is issued, the watch disconnects and doesn't reconnect. I've also noticed that:

    If I reset with BTN1 + BTN2 ---> watch ends up in "normal" mode running the clock app

    If I reset with reset() command --> watch ends up on the "Bangle" logo screen.

  • Okay... Are you still have issues uploading new apps?

    what are you trying to do with reset() :-) ? You shouldn't have to do a reset() manually.

    From the documentation­_reset reset() seems to be doing what it should.

    After an App is loaded, it should show on screen "Press btn3 to reload". You keep BTN3 pressed and your default app is reloaded.

    Press the middle button and it should launch the App Launcher showing you all the apps that are installed, and you can pick one of the other apps.

    P.S. You mentioned App Uploader is issuing a reset... if you are using Chrome, can you do F12, then right click on refresh button and click "Empty cache and hard reload"... Github pages are cached so maybe you got stuck with a stale version of the BangleApps repository?

  • Hi @PiOfThings. I am still experiencing exactly the same problem I was when I made the OP. That being:

    • When I try to upload an app from the Bangle app repo, the upload fails with the message "Upload failed, Unexpected response".

    Everything else is speculation about what might be the cause of this. In particular:

    • I've noticed (by looking in the browser console) that the uploader sends a "reset()" command to the Bangle. Then it attempts to send the app. The bangle responds to the "reset()" but after that it makes no further response.

    --> My conclusion from this (which might be wrong) is that the reset() command - in my particular environment - is somehow causing an issue.

    --> This is backed up by the fact that issuing the reset() command in the IDE also appears to break connectivity between my computer and the bangle and I then need to re-pair.

    --> I observe the same behaviour on both my desktop Mac and my iPad.

  • I think it might be what's mentioned here:­opment

    On Firmwares shipped on KickStarter Bangle.js please either leave Debug Info set to Hide in Bangle.js's Settings, or update to the latest Bootloader version using

    Is it possible you had set 'Debug Info' to 'Show' in settings?

    I know it's a frustrating gotcha - it's fixed in the latest JS bootloader, but obviously if you can't update the bootloader then you're in trouble!

  • Wahayy!!! That fixed it! Thank you so much!

    All working now, and I can upload apps to my heart's content :)

  • Cool! Thanks again @Gordon :-)

  • Encountered the same (about 3/3) - no app loaded. Starting from scratch was the solution w/ updating boot loader first.

  • I've just added a Bangle.js-specific troubleshooting page:­/blob/master/info/Troubleshooting%20Bang­

    I'll add to that as new things come to light - but feel free to give me PRs for it as well ;)

  • I hate to revive an old thread, but I'm having a similar issue with a slightly worse problem.

    @Gordon Thanks for sending out the watches during this difficult time. I received mine today! As OP did, I tried updating everything as best as I could, and I was also seeing the same error message. In an attempt to fix this, I followed the steps to reset without loading any code but I ended up with Install App failed,. Now I can't access any of the default apps (my guess is they've been removed to install the new ones).

    I tried upgrading the firmware through DFU mode with the Nordic Toolbox app, which worked flawlessly :)

    Then (and only then!) did I read your comment above:

    Is it possible you had set 'Debug Info' to 'Show' in settings?

    I know it's a frustrating gotcha - it's fixed in the latest JS bootloader, but obviously if you can't update the bootloader then you're in trouble!

    I know I have the Debug Info property set to Show. Is there any way to set it to Hide through the terminal?

  • If you can get access with the IDE then you should really be ok to upload - but require("Storage").eraseAll() typed on the left hand side will reset everything so you'll definitely be ok.

    If you can't access anything at all via the IDE then you may have managed to get it into an odd mode where there's just enough stuff installed to disable Bluetooth, but not enough to re-enable it.

    I have just pushed some changes and you should see builds in­master/ in a moment or two. If you upload that then afterwards holding down BTN1 while starting will ensure that NOTHING is loaded, and you'll definitely be able to connect and re-upload apps.

  • Brilliant! Thank you very much, require("Storage").eraseAll() did the trick perfectly!

    Now to get coding!

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

Bangle.js - app upload - upload failed

Posted by Avatar for chrisotherwise @chrisotherwise