• I'm pretty sure the problem is that JavaScript executes asynchronously. Obviously I don't know what is in your startAP/enableWifiScan functions, but usually when you execute a command startAP, it returns immediately and calls a callback when the AP is connected.

    For instance for Espruino Wifi you need:

    wifi.startAP(ssid, options, function() { 
      // this is executed when connected and should start the server
    });
    // this code is executed before it is connected
    

    Also, which device are you using the Wifi on?

About

Avatar for Gordon @Gordon started