webIDE vs EspruinoTools cmdline 'espruino'

Posted on
  • I am comparing
    espruino -d bangle -e 'g.drawImage("longimagedataxcaxczx")
    with pasting into webIDE, upload as RAM.

    I assumed they would be identical processes, except the command line one is hitting Low Memory interpreter errors consistently, but the webIDE not.
    Why is this happening? How can I use the command line similarly to the webIDE ram upload mode?

  • Never used 'expruino' command line. But I would imagine the problem will be any additional overhead of calling from the command line and maintaining the connection etc. Running the code on the RAM will have less overhead maybe ?

  • I dug into the code a bit deeper, found this :

    function sendCode() line 407 espruino-cli.js`

    if (args.expr) {
        if (code) {
          if (code[code.length-1]!="\n")
            code += "\n";
        } else
          Espruino.Config.RESET_BEFORE_SEND = false;
        code += args.expr+"\n";
      }
    

    So I changed RESET_BEFORE_SEND to true there and it does the same as ide then, I think. The memory was still occupied from clock face.

  • Ahh, yes, RESET_BEFORE_SEND makes sense.

    If you were uploading via espruino -d bangle myfile.js then the reset would be applied automatically, but when you're just uploading an expression the CLI assumes you don't want a reset (eg you might just want to run a single function to set something up)

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

webIDE vs EspruinoTools cmdline 'espruino'

Posted by Avatar for d3nd3-o0 @d3nd3-o0

Actions