Is it possible that you're using both of those bits of code together? All you'd need is the second part:
digitalWrite(B9,1); Serial2.setup(115200, { rx: A3, tx: A2 }); var wifi = require("ESP8266WiFi_0v25").connect(Serial2, function(err){ if (err) throw err; console.log("Connecting to WiFi"); wifi.connect("MY_LAN", "PASSWORD", function(err){ if (err) throw err; console.log("Connected"); require("http").get("http://www.pur3.co.uk/hello.txt", function(res){ console.log("Response: ", res); res.on('data', function(d){ console.log("--->"+d); }); }); }); });
@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.
Is it possible that you're using both of those bits of code together? All you'd need is the second part: