• Indeed.
    I reduced a bit the code, did a full restart of everything and uploaded the code at the bottom of this post under the dashed line. The output is just below that.

    You can see that it is actually the serial garbage (which is a known problem in 0.9.2.4), that is the cause of the (initial) error. That's why I originally added the setTimeout. Anyway, I took that setTimeout away for now.

    After uploading and executing that code (which failed), I entered the following in the command window

    wifi.connect("solarsystem","tmpjoimc", print);
    

    That resulted in:

    =undefined
    CWMODE failed: AT+CWMODE=1
    

    To display the full error, I entered this:

    wifi.connect("solarsystem","tmpjoimc", function(err) {if (err) throw err;});
    

    which then resulted in:

    =undefined
    >Uncaught CWMODE failed: AT+CWMODE=1
     at line 1 col 17
    {if (err) throw err;}
                     ^
    in function "b" called from line 2 col 2
    e):d.cmd("AT+CWJAP="+JSON.stringify(a)+","+JSON.stringify(c)...
      ^
    in function "d" called from line 1 col 26
    {e=void 0;var b;d&&(b=d(a))?(e=g,d=b):clearTimeout(c);void 0...
                              ^
    in function "e" called from line 1 col 291
    ...f&&(g[f](d),n=!0);n||e&&e(d)}b=b.substr(a+1);"\n"==b[0]&&(b=...
                                   ^
    in function called from system
    Uncaught CWMODE failed: undefined
     at line 1 col 17
    {if (err) throw err;}
                     ^
    in function "b" called from line 2 col 2
    e):d.cmd("AT+CWJAP="+JSON.stringify(a)+","+JSON.stringify(c)...
      ^
    in function "d" called from line 1 col 16
    {e=void 0;d&&d()}
                    ^
    in function called from system
    

    which in turn is again the same error as in all previous tests.

    I'll put together another pico/esp8266 to see what that gives.

    ====================================================

    Serial2.setup(9600, { rx: A3, tx : A2 });
    var wifi = require("ESP8266WiFi").connect(Serial2, function(err) {
      if (err) throw err;
      wifi.reset(function(err) {
        if (err) throw err;
          //your code to be executed after 1 seconds
          wifi.connect("solarsystem","tmpjoimc", print);
      }); //wifi.reset
    }); //require
    
    >reset();
    =undefined
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v79 Copyright 2015 G.Williams
    >echo(0);
    =undefined
    WiFi connect failed: áF¨ÿ#Êýi££¡òëâkeü×Lû
    > 
    
About