• @julian: Yes, it will take some time for the network interface to establish a connection with the access point; the E.init will trigger immediately after a power cycle (or save() invocation).

    Change your code to this:

    var Wifi = require('Wifi');
    E.on("init", function () {
      Wifi.on('connected', function(){
        var http = require("http");
        http.createServer(function (req, res) {
        res.writeHead(200);
        res.end("Hello World");
        }).listen(8080);
      });
    });
    

    The doc for the Wifi class has a number of events that are emitted on specific situations that you can utilize to your advantage.

About

Avatar for pthieu @pthieu started