It shouldn't really be an issue, but it might be because you're calling getIP and then createserver right after (rather than using callbacks).
You could try the following and see if that works better:
function onInit() { wifi = require("EspruinoWiFi"); wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(e) { if (e) { console.log("Connection Error: "+e); return; } wifi.getIP(function(f,ip) { config.macaddress = ip.mac; config.ipaddress = ip.ip; console.log("Connected: ",config); require("http").createServer(function(req,res) { console.log(req); res.writeHead(200); res.end("Hello World"); }).listen(80); }); }); }
Let me know how you get on - if that's the issue I'll see what I can do to fix it in the driver
@Gordon started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It shouldn't really be an issue, but it might be because you're calling getIP and then createserver right after (rather than using callbacks).
You could try the following and see if that works better:
Let me know how you get on - if that's the issue I'll see what I can do to fix it in the driver