Yes I think it's something stupid I'm doing. It connects to the WiFi but just won't get anything.
I tried substituting the URL for 172.217.169.14 which I think is the ip for google.com but got the same result.
172.217.169.14
Thanks,
Here's my code:
digitalWrite(B9,1); // enable on Pico Shim V2 Serial2.setup(115200, { rx: A3, tx : A2 }); const http = require("http"); var wifi = require("ESP8266WiFi_0v25").connect(Serial2, function(err) { if (err) throw err; console.log("Connecting to WiFi"); wifi.connect(WIFI_NAME, WIFI_PASS, function(err) { if (err) throw err; console.log("Connected"); fetchData(); }); }); function fetchData() { console.log('Fetching data'); http.get("http://gomako.co.uk/hello.txt", function(res) { var contents = ""; res.on("data", function(data) { contents += data; }); res.on("close", function() { console.log(contents); }); }).on("error", function(e) { console.log("ERROR", e); }); }
@Bennr 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.
Yes I think it's something stupid I'm doing. It connects to the WiFi but just won't get anything.
I tried substituting the URL for
172.217.169.14
which I think is the ip for google.com but got the same result.Thanks,
Here's my code: