• Hi Steffer,

    I put the try/catch but it was the same, terminal does not respond.

    This is my code

    function initTelnet(){
    
      console.log('Init Telnet');
    
      require("net").createServer(function(soc­ket) {
        
        console.log('Telnet client connected');
        
        socket.write('Welcome!\r\n');
        
        socket.on('error', function(err){
          USB.write(err);
        });
    
        /*socket.on('data', function(data) {
          //just a test to verify connection
          //USB.write("client says " + data);
        });*/
    
        socket.on('close', function() {
          USB.setConsole();
        });
    
        socket.pipe(LoopbackA);
        LoopbackA.pipe(socket);    
        
        try{
          LoopbackB.setConsole();
        } catch(e){
          USB.write(e);
        }
        
      }).listen(23);
    }
    
    function onInit() {
    
      console.log("Init Wifi");
      
      wifi = require("Wifi");
    
      wifi.connect("................", {password : ".................."}, function(err) {
        
        console.log("Wifi Connected");
        
        initTelnet();    
        
      });
    }
    

    When connecting with putty I see:

    Welcome!
    <- USB
    >
    

    and nothing else, no response to commands.

    ...
    EDITED the code to remove the ondata event

About

Avatar for César @César started