Avatar for user122293

user122293

Member since Dec 2020 • Last active Dec 2020
  • 1 conversations
  • 1 comments

Most recent activity

  • Avatar for user122293

    Hey there,

    I'm trying to run the wifi shield example, but I'm getting this error:

    Uncaught Error: Function "getSerial" not found!
     at line 2 col 11
      Serial1.getSerial();
              ^
    in function "go" called from line 48 col 4
    go();
    

    Not sure where to go, I don't see any other errors like this on the forum

    Full Code:

    var WIFI_NAME = "The LAN Before Time";
    var WIFI_PASS = "redact";
    var wifi;
    
    function getPage() {
      require("http").get("http://www.pur3.co.­uk/hello.txt", function(res) {
        console.log("Response: ",res);
        res.on('data', function(d) {
          console.log("--->"+d);
        });
      });
    }
    
    function go() {
      Serial1.setup(115200,{rx:D0,tx:D1});
      Serial1.getSerial();
      wifi = require("ESP8266WiFi_0v25").connect(Seri­al1, function(err) {
        if (err) console.log(err);
        console.log("Connecting to WiFi");
        wifi.connect(WIFI_NAME, WIFI_PASS, function(err) {
          if (err) console.log(err);
          console.log("Connected");
          // Now you can do something, like an HTTP request
          getPage();
        });
      });
    }
    
    function onInit() {
      Terminal.setConsole();
    }
    
    go();
    
Actions