You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Yep, @Cale is right - since Wifi isn't built in on the Pico, you need to load up an ESP8266 modue to tell it what you're connecting it to:

    Serial2.setup(115200, { rx: A3, tx : A2 });
    var wifi = require("ESP8266WiFi_0v25").connect(Serial2, function(err) {
      //                ^^^^^^^^^^^^^^^^
      //                Use ESP8266WiFi here (and 9600 baud) if you have an ESP8266 with firmware older than 0.25
      if (err) throw err;
      wifi.reset(function(err) {
        if (err) throw err;
        console.log("Connecting to WiFi");
        wifi.connect("WiFi_Name","WPA2_Key", function(err) {
          if (err) throw err;
          console.log("Connected");
          // Now you can do something, like an HTTP request
          require("http").get("http://www.pur3.co.uk/hello.txt", function(res) {
            console.log("Response: ",res);
            res.on('data', function(d) {
              console.log("--->"+d);
            });
          });
        });
      });
    });
    
About

Avatar for Gordon @Gordon started