Finally - cheap WiFi?

Posted on
Page
of 4
First Prev
/ 4
  • @DrAzzy Thank you for the suggestions. I tried both but it still doesn't work. The code i used was

    Serial2.setup(9600, { rx: B6, tx : B7 });
    var wifi = require("ESP8266WiFi").connect(Serial1, function(err) {
      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);
            });
          });
        });
      });
    });
    

    and to be sure I swaps the pins to

    Serial2.setup(9600, { rx: B7, tx : B6 });
    

    But I still get an error that reads

    echo(0);
    ERROR: Pin B7 is not capable of USART RX
    Suitable pins are:
    A3
    =undefined

  • Ok, it's because you're using Serial2, not Serial1. You did change it in the .connect call though.

    Try:

    Serial1.setup(9600, { rx: B6, tx : B7 });
    //^^^^ this one
    var wifi = require("ESP8266WiFi").connect(Serial1, function(err) {
    ...
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Finally - cheap WiFi?

Posted by Avatar for Gordon @Gordon

Actions