Avatar for TTBangler


Member since Aug 2021 • Last active Nov 2021
  • 2 conversations

Most recent activity

  • in Bangle.js
    Avatar for TTBangler

    Thanks very much for adding the ability to take screenshots of the emulator to the Web IDE!

    I just wanted to share a tip I learned automating the taking of screenshots generated by my app. I run the emulator on Ubuntu and wanted to use 'xdotool' to take screenshots. I couldn't figure out why 'xdotool click 1' wasn't doing anything when attempting to click on BTN1, BTN2, or BTN3, so I looked into the emulator source code and discovered those areas are listening for 'mousedown' events. So by replacing 'xdotool click 1' in my bash script with 'xdotool mousedown 1', 'sleep 0.5', 'xdotool mouseup 1' I was able to get the emulator to recognize button presses. 'xdotool click 1' does work fine on the screenshot button, however.

  • in Bangle.js
    Avatar for TTBangler

    I post this just as a reference. The Web IDE certainly works in that case...

    Thanks for chiming in with another reassuring reference point about large apps. It seems there's something odd about my Chrome/Ubuntu setup, which is very strange because I installed Chrome only to use the Web IDE. Regardless, Gordon's catch of the exception seems to have fixed the problem for me in the beta IDE.

  • in Bangle.js
    Avatar for TTBangler

    'The English Language at times can be quite persnickety'

    And you identified a prime example I completely overlooked, thanks for pointing that out :-)

  • in Bangle.js
    Avatar for TTBangler


    The values in my screenshot for post #22 came from the Web IDE connected to my Bangle.js v1. I actually never even noticed the blocksize before and haven't done anything I'm aware of to change the default value. 13 definitely seems like an odd number, though.

  • in Bangle.js
    Avatar for TTBangler


    I wasn't aware of your UI framework--it looks very impressive, thanks for bringing it to my attention! I'll definitely look more into your framework once I get my Bangle.js v2 (since it has a full touchscreen).

    Thanks also for the explanation about what happens during an upload. Overloading the Espruino interpreter buffer on upload could indeed be what happened in my case. The IDE crash behavior was the same when uploading my very large app to either the emulator or my Bangle.js.

  • in Bangle.js
    Avatar for TTBangler

    Hi @Robin,

    Thanks, I tend to do most development using the IDE Emulator (since it's faster than the actual hardware) and I just discovered that my full app code I minified for Bangle.js v2 that works for the Bangle.js v1 emulator gets a strange error and doesn't run on my actual Bangle.js v1 hardware.

    By the way, I believe version 2v10 of the firmware somehow increased the amount of usable memory so here are the numbers I get on my real Bangle.js v1 after connecting and before loading anything:

      VERSION: "2v10",
      GIT_COMMIT: "63dafbf9f",
      FLASH: 524288, SPIFLASH: 4194304, HWVERSION: 1, STORAGE: 4194304, RAM: 65536,
      SERIAL: "8614df71-b4fb9fc0",
      CONSOLE: "Bluetooth",
      MODULES: "Flash,Storage,hea" ... "tensorflow,locale",
      EXPTR: 536882372 }
    ={ free: 1928, usage: 656, total: 2584, history: 11,
      gc: 27, gctime: 5.79833984375, blocksize: 13, stackEndAddress: 536925152, flash_start: 0,
      flash_binary_end: 450188, flash_code_start: 1610612736, flash_length: 524288 }

    That's a good point about Espruino needing space for housekeeping. I've actually been very pleasantly surprised by how much I was able to do before I started running into out-of-memory problems at runtime. And I believe the Bangle.js v2 has 4x more memory so can't wait to receive mine!

  • in Bangle.js
    Avatar for TTBangler

    Hello Robin, Gordon,

    Sorry if I caused any confusion. Just to clarify, the app I uploaded to this post (that is a subset of a much larger app) results in the 'JSCODE' exceeded error for me on Chrome/Ubuntu with the non-beta Web IDE Bangle.js v1 Emulator. I've just confirmed that with the change Gordon made, the (subset) app does now successfully minify/upload for me on the same Chrome/Ubuntu system using the beta Web IDE Bangle.js v1 Emulator. Also, by entering 'window.localStorage.clear()' after getting the 'JSCODE' error in the non-beta IDE, the (subset) app can also be successfully uploaded/minified.

    My full app (that I have not posted here) results in an "Execution Interrupted"/"Prompt not detected - upload failed" IDE crash even with the beta Web IDE Bangle.js v1 Emulator on both Windows and Ubuntu. However--and this is great news--my full app does successfully upload/minify with either the non-beta or beta Bangle.js v2 Web IDE Emulator on Ubuntu. Moreover, I just discovered that I can download the minified source code from the Bangle.js v2 emulator and upload it into storage in the Bangle.js v1 emulator, and the minified version of the source reduces the process.memory() usage from 1239 down to 1215. I had to make a couple of minor changes to the minified source code to get the app to run but it seems to run fine. Oh, and I forgot to mention that the message I receive when uploading my full app to the v2 Emulator is "No errors. Minified 74751 bytes to 37349 bytes."

    Hope that clarifies things--thank you both very much again for your help!

  • in Bangle.js
    Avatar for TTBangler

    Thanks Gordon for following up on this!

    Below I've attached the result of what happened after I pasted what you requested into the Chrome/Ubuntu console. I'm sorry I don't understand what you mean by "offline mode", however the good news is that after entering window.localStorage.clear() into the Chrome console I was able to upload and minify my source code. I also tried pasting my full app into the source code pane and tried to upload it, and got the same "Execution interrupted" errors as I did on Windows. If there's anything else you'd like me to do to help track down what's happening, please let me know.

    In the meantime, I believe I read somewhere in the Espruino documentation about Linux command-line development tools so I'll try to see if those will allow me to minify my full app (~2.5K lines, ~80K).

  • in Bangle.js
    Avatar for TTBangler

    Oh, the mystery deepens! I see the same behavior on Ubuntu regardless of which minification setting I use, even when it's turned off. And sorry for not doing this sooner but when I looked at Chrome's debug console I noticed "'JSCODE' exceeded the quota" errors when doing "Send to Espruino". From what I could learn by searching for the error it appears that Chrome ran out of storage, but as shown in the attached screenshot it still seems to have plenty available.

    If whoever develops the Web IDE has any suggestions on what to try next I'd be happy to do more investigation as I can reproduce the issue consistently on my machine.