• I often used the LINUX board and connect via WebIDE and TCP/IP for source testing. Looks like this is not possible any more because SETTINGS->COMMUNICATION does not offer TCP/IP input. I still can build a LINUX board and launch it with parameter --telnet like this:

    bin/espruino --telnet
    

    Any hints what I miss or what workaround is available to get this working again?

  • I'm afraid it's gone because Google are in the process of shutting down the Chrome web app, so we're left with espruino.com/ide which doesn't support telnet directly as far as I know.

    I guess the only real option would be to make the Linux build capable of starting an HTTP server with websockets - there is a fragment of JS code that does this already (below), but because it's doing it in JS isn't not as flexible as something built in at a lower level:

    function onPageRequest(req, res) {
      res.writeHead(200, {'Content-Type': 'text/html'});
      res.end(`<html>
    <body style="margin:0px"> 
    <iframe id="ideframe" src="https://www.espruino.com/ide/" style="width:100%;height:100%;border:0px­;"></iframe>
    <script src="https://www.espruino.com/ide/embed.­js"></script>
    <script>
      var ws = new WebSocket("ws://" + location.host + "/ws", "serial");
      var Espruino = EspruinoIDE(document.getElementById('ide­frame'));
      Espruino.onports = function() {
        return [{path:'local', description:'Local Device', type : "net"}];
      };
      Espruino.onready = function(data) { Espruino.connect("local");};
      Espruino.onwrite = function(data) { ws.send(data); }
      ws.onmessage = function (event) { Espruino.received(event.data); };
      ws.onclose = function (event) { Espruino.disconnect(); };
    </script>
    </body>
    </html>`);
    }
    
    /* Hack to ensure that `reset` won't cause us problems */
    global.reset = function() {
      console.log("Ignoring reset() request");
    };
    
    var server = require('ws').createServer(onPageRequest­);
    server.listen(80);
    server.on("websocket", function(ws) {
      ws.on('message',function(msg) { LoopbackA.write(msg); });
      LoopbackA.on('data',function(msg) { ws.send(msg); }); 
      ws.on('close', function() { 
        LoopbackA.removeAllListeners();
        USB.setConsole(); 
      });
      LoopbackB.setConsole();
    });
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Have we lost WebIDE with TCP/IP or is there a workaroud?

Posted by Avatar for MaBe @MaBe

Actions