You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I've just made some changes and it is possible to do HTTP requests now with:
    https://github.com/espruino/EspruinoDocs­/blob/master/devices/ESP8266WiFi.js

    This isn't live on espruino.com yet, but:

    var WIFI_NAME = "";
    var WIFI_PASS = "";
    D9.set(); // power on
    Serial1.setup(115200,{rx:D0,tx:D1});
    var wifi = require("https://raw.githubusercontent.c­om/espruino/EspruinoDocs/master/devices/­ESP8266WiFi.js").connect(Serial1, 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");
        // Now you can do something, like an HTTP request
        require("http").get("https://www.pur3.co­.uk/hello.txt", function(res) {
          console.log("Response: ",res);
          res.on('data', function(d) {
            console.log("--->"+d);
          });
        });
      });
    });
    

    Does actually work for me as long as the ESP8266 module firmware is up to date (the code is for a Pixl.js Multicolour, but it's easy enough to change)

About

Avatar for Gordon @Gordon started