Bangle Emulator

Posted on
Page
of 3
Prev
/ 3
Next
  • I can reproduce that here - but that's kind of expected just because if you refresh the window it loses the link between it and the IDE. You've also got to be really trying to refresh it with a key shortcut.

    I guess the question is, if this is happening to @sebi then why was the window getting refreshed?

  • I am not sure if I am following the discussion properly...
    But following the standard procedure (click on Connect, then on Emulator) I get this:

    Refreshing the small emulator window (not the IDE) doesn't change it remaining white and doesn't append additional log into the condole. If I close that small window to regain access to the IDE, and try to connect again, I get just a

    >>> Connecting...         index.js:92927
    Set Slow Write = true     index.js:92927
    

    more in the console.

  • Thanks! What happens if you right-click on the emulator window and show the developer console in that? Does it show anything useful?

  • In the developer console of the emulator window, I get this log when trying to connect:

    And this log, after refreshing the emulator window twice:

  • Ok, thanks! That is odd - it looks like it's just not able to communicate between the two windows...

    Usually a windows.postMessage gets sent from the IDE to that window to set everything up,but it seems it's never getting received. Is yours a totally standard Chrome install? Looks like you've got a few things installed including adblock - I wonder if something has disabled the inter-window communication.

    Come to think of it, you disabled adblock for the IDE, but is it possible that adblock is still on for the emulator subwindow? What if you just go to https://www.espruino.com/ide/emu_banglej­s.html - is the adblock icon still enabled?

  • Odd indeed...
    No: adblock is turned off for all the espruino domain, which includes https://www.espruino.com/ide/emu_banglej­s.html (adblock logo is greyed on that page).
    I have a completely stock version of Chrome installed on Windows OS, and it is the latest version:
    Version 92.0.4515.131 (Official Build) (64-bit)
    To check if some addons were responsible for this issue, I just made another try while disabling ALL the addons: chrome.exe --disable-extensions
    ...and Hurray! I get access to the emulator again!
    I thought I tried this already, but I must have made a mistake at that time, like not closing Chrome properly (that kept running in the background) because it didn't fix anything then.
    I will now search for the exact addon (or setting) responsible for this issue and will let people know.

  • FYI: I just launched chrome the normal way (WITHOUT --disable-extensions) with all the plugins enabled and... the emulator is working properly again!

    It's driving me crazy because I didn't even deactivate one single extension this time (adblock is activated but disabled on the whole Espruino domain automatically as always).

    So the only conclusion I have is:

    • make sure to disable adblock on the FULL Espruino domain
    • Shut down chrome completely (make sure it doesn't keep running in the background)
    • Start chrome without enabling extensions (chrome.exe --disable-extensions)
    • Maybe perform some reboots in-between those steps

    and the emulator should be working properly!

    Once the emulator is working properly, chrome can be launched the normal way with all its extensions enabled.

  • Great! Glad it's working for you now!

    That really is a strange one though. Do you think you ever shut down Chrome during the whole time you were having trouble with the emulator? I guess maybe something just got a bit confused in Chrome itself

  • The emulator is not working anymore (for an unknown reason).
    I tried my recipe quickly but it didn't fix anything.
    I guess I'll have to do further experiments (like rebooting in-between these steps) to see if it helps...

    I think I did shut down several times Chrome during the whole time I was having trouble with the emulator as I am used to switching between OSs quite often (which involves rebooting, thus restarting Chrome) and this issue is present on my computer for a long time now.

  • I have done further tests (disabling all extensions, rebooting, ...) and cannot get the Emulator to run back again as normal. Any idea on what to do next?

  • Does it seem to work fine for you on other computers? You're on Windows 10 by the look of it so I guess Edge is installed anyway - what if you run the IDE in that?

  • I have just tried with Edge and unfortunately I get the very same error:

    Can this give use some additional information about the problem?

  • FYI: I just launched chrome the normal way

    Tue 2021.08.24

    Hey @sebi I have a similar environment as yours and at times I see similar errors as do you. I'd be willing to run some code here to see what happens and post those results. Compare hardware, Win10 ver, WebIDE ver and Chrome ver, etc.

    One clarification for me that @Gordon placed in post #26
    'why was the window getting refreshed?'

    In post #32 you indicated 'FYI: I just launched chrome the normal way' then everything was fine.

    I'm not seeing what file is being used to launch the emulator that causes the refresh. I had to
    force one on mine as in post #25

    Should I be jumping in and being more of an interference, then just indicate to butt out and I'll remain a casual observer.

  • I'm just wondering whether there could be something to do with your system configuration that is causing it not to work... What language is your system set to?

  • Should I be jumping in

    Please step in! I feel alone with this issue.
    If you post your configuration I'll know more what you want to compare exactly.

    What language is your system set to?

    Indeed I encountered an issue in the past on my computer that was due to Windows language settings. Windows is the french version, but I switched every aspects to english. Under the hood there must be some leftovers of french thought. The issue had to do with the Windows Sandbox not being able to launch due to those unusual language settings. The issue was registered by Microsoft at first and eventually fixed. Maybe this can help.

  • Wed 2021.08.25

    @Sebi, I have re-read this entire thread and I'm not seeing the specific code block that is being uploaded to cause this issue. I am able to see parts in post #35 and that appears to me not the default that is loaded when one launches the web IDE from link:

    https://www.espruino.com/ide/

    As I pointed out in post #38 @Gordon recognized that my initial test post #25 wouldn't prove anything as I had to force the refresh. Without the offending code block and the step that causes the refresh, it seems pointeless for me to move forward as we wont be comparing the equivalent test.

    Would you mind responding to post #38 so that I may run the same congruent test.

  • Would you mind responding to post #38 so that I may run the same congruent test.

    You want to know my hardware, Win10 ver, WebIDE ver and Chrome ver, right?

    • MacBook Pro 15" Retina A1707 late 2016
    • Windows is running under Bootcamp (not in a virtual machine).
      Windows 10 Pro x64 is up to date: Version 21H1, OS build 19043.1165, Experience Windows Feature Experience Pack 120.2212.3530.0
    • Espruino Web IDE is up to date: Version 0.75.8
    • Google Chrome is up to date: Version 92.0.4515.159 (Official Build) (64-bit)

    Is this enough information?

  • Wow, thanks for all the info!

    Just to add to this, I just booted up my Win 10 laptop and:

    • Opened Chrome
    • Went to espruino.com/ide
    • Clicked connect, Emulator
    • And I got a blank emulator window, exactly like you
    • I right-clicked on the emulator window and chose 'Reload'
    • I then closed it and reloaded the IDE window
    • Clicked connect, Emulator
    • All works now

    But now, every subsequent time I run it, it all works fine.

    So if you follow those steps, you can't get it to spring back to life?

  • Unfortunately not...
    While I got your email yesterday, I was connected using FortiClient VPN to my company's network, and I noticed the Emulator was working properly.
    Today as I restarted the emulator, it wasn't working anymore, so I tried following your steps but it didn't help. I also tried reconnecting to my company network but still, the Emulator didn't work. In between those tries I made sure to close properly Chrome and to clear cached images and files, cookies and other site data.

  • I am able to see parts in post #35 and that appears to me not the default that is loaded when one launches the web IDE

    That is very strange to me... If I understand right, by looking at my Chrome's developer console you didn't recognized the sequence of code that should be executed normally. Is that it? Currently I am clueless, and don't know what could be interfering with running Espruino WebIDE code the normal way on my computer.

  • Sat 2021.08.28

    Replying to post #45

    'Currently I am clueless,'

    Following @Gordon s steps as indicated in post #43 uploading the default code file works flawlessly for me also as has been previously explained.

    It still hasn't been explained what is being done to cause the 'Refresh' in the emulator.

    @sebi    I don't know how plainly we may request, please post the file that is being uploaded as in post #35   Let's rule out that code block, or upload the default code block and provide the default file error output.

    Although I'm running a USA English version of Windows10 with no virtual PC, I have the same app versions as were indicated in post #45  less 'Windows is running under Bootcamp' and 'MacBook Pro'

  • Hello,

    I just wanted to add that I haven't been able to get the Emulator to work either, even after following the refresh steps noted previously. Fortunately, I do have a watch but it would still really be handy to test code using the emulator. Anyway, I'm using Chrome on Ubuntu 18. In case it helps, I see the same behavior and console output @sebi showed in the screenshot for post #37 but with the addition of the following error at the very end:

    DevTools failed to load source map: Could not load content for https://www.espruino.com/ide/secure-dfu.­js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

    Hope this helps diagnose/resolve the issue.

  • @sebi    I don't know how plainly we may request, please post the file that is being uploaded as in post #35   Let's rule out that code block, or upload the default code block and provide the default file error output.

    I would like to help but I still cannot figure out how to do what you ask for...
    You mean post 25 right? (post 35 is mine with some screenshots.)

    Steps:
    https://www.espruino.com/ide/
    Orange Connect Button :: Emulator

    Done!

    Carret inside Emulator Window
    Fn+F5

    Carret? Fn+F5 is to brighten the keyboard on my computer??
    What I understand is: select the Emulator Window and refresh it.

    Done!

    I am not familiar with the Developer console and I don't know how to generate the log files the way you did. Instead I took some screenshots and posted them in the forum. With further explanations I can try to post what you ask for.

    If by "the file that is being uploaded" you mean the file that is being sent from the WebIDE right panel to the emulator, this file can be empty. If you ask for the file that is being executed by Chrome, it is supposed to be the one obtained when navigating to http://www.espruino.com/ide/. I hope my computer does not interfere with that file and leaves it genuine (no addon modifies it). Maybe there is a way to save a copy of the exact code that is being executed by Chrome and this is what you ask for?

    Regarding the refresh process, I couldn't try it to verify it but, from what I understand, if the Emulator is working properly and you refresh that Emulator screen, you will lose the connection with the WebIDE resulting in a white screen for the Emulator. Is this correct?
    So one hypothesis would be that my Emulator window gets refreshed unintentionally at start leading to a connection loss, right?

    Thanks @TTBangler for trying to help too!

  • Sun 2021.08.29

    from post #48 'I hope my computer does not interfere with that file and leaves it genuine'

    @sebi my intent was to isolate whether the refresh you are explaining is a result of the code file sent to the emulator, or is it the PC configuration itself.

    Here is the default content that loads to the R-Hand editor side of the IDE when pointing the browser to http://www.espruino.com/ide/

    (first 50 lines only)

    Bangle.setLCDPower(1);
    Bangle.setLCDTimeout(0);
    
    var scenes = [
      function() {
        y = -100;
        var step = 4;
        var i = setInterval(function() {
          y+=step;
          if (y>70) {
            clearInterval(i);
            
            i = undefined;
          }
          g.clearRect(0,y-(step+1),240,y-1);
          g.drawImage(Bangle.getLogo(),0,y);
        }, 20);
        Bangle.setLCDMode();
        g.clear();
        return function() {
          if (i) clearInterval(i);
        };
      },
      function() {
        var txt = [" ____                 _ \n"+
              "|  __|___ ___ ___ _ _|_|___ ___ \n"+
              "|  __|_ -| . |  _| | | |   | . |\n"+
              "|____|___|  _|_| |___|_|_|_|___|\n"+
              "         |_| espruino.com\n\n",
        "The JavaScript Interpreter for uCs\n",
        "  * On-chip JS Interpreter",
        "  * GPS, Acclerometer, Compass",
        "  * 64 MHz, 64kB RAM, 512kB + 4MB Flash",
        "  * 240x240 IPS LCD",
        "  * Speaker & Vibration motor",
        "  * Bluetooth LE",
        "  * 1 week battery life",
        "",
        "Includes:",
        "  * Tensorflow AI",
        "  * Bluetooth LE central & periph",
        "  * Graphics Library",
        "  * VT100 terminal",
        "","",""
        ];
        var n=0;
        var i = setInterval(function() {
          Terminal.println(txt[n]);
          n++;
          if (n>=txt.length) {
    



    When I look at your screenshot in post #35

    L28 const pixels =

    clearly is not the default file at which L28 prints out part of the Espruino Banner.



    At this point I can only surmise the code block being uploaded is potentially problematic.


    Do you see the above code block with a fresh start of the browser pointing to http://www.espruino.com/ide/ ?

  • Sun 2021.08.29

    Hi @TTBangler and thank you for your input.

    'I haven't been able to get the Emulator to work either'
    'I see the same behavior and console output @sebi showed in the screenshot'

    Does this mean the Pop-up Emulator Window does in fact appear, but it's canvas never renders any content?

    Are you able to confirm that the default code block that is loaded is the same as I posted in #49

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

Bangle Emulator

Posted by Avatar for d3nd3-o0 @d3nd3-o0

Actions