You are reading a single comment by @tve and its replies. Click here to read the full conversation.
  • Please check out this draft tutorial http://microcosm.app/out/uvYYg for setting up your wireless so you can remove the wifi.connect stuff from your code. Then you start you code with the require("http") and http.creaseServer. You don't need to wait for the esp to actually connect to your wifi to start the http server.

  • @tve. I tried to put

    var wifi = require("Wifi");
    wifi.connect("myssid", {password:"mypass"}, function(err){
      console.log("connected? err=", err, "info=", wifi.getIP());
    });
    wifi.stopAP();
    wifi.save();
    

    And i'm connected, but next time i do reset() cycle and i try to write a wifi.getIP() i get this response

    >wifi.getIP()
    Uncaught ReferenceError: "wifi" is not defined
     at line 1 col 5
    wifi.getIP()
        ^
    

    It looks like the code is not stored into the flash

About

Avatar for tve @tve started