ESP8266: CIFSR failed

Posted on
  • I've just updated my ESP8266 to 0.25.0.0(Jun 12 2015 20:26:28) (returned by AT+GMR) so I guess I'm on the current version.

    I connected the ESP8266 to my Pico's Serial1 port and use a 10uF Cap between the 3.3V and GND on the ESP. When I ran the test script I got a CIPSTART fail, but after reading http://forum.espruino.com/conversations/265995/ I added a timeout before making the call.

    Serial1.setup(115200, { rx: B7, tx : B6 });
    var wifi = require("ESP8266WiFi").connect(Serial1, function(err) {
      if (err) throw err;
      wifi.at.debug();
      wifi.reset(function(err) {
        if (err) throw err;
        console.log("Connecting to WiFi");
        wifi.connect("myssid","mysecret", function(err) {
          //if (err) throw err;
          console.log("Connected");
          setTimeout(function (){
              wifi.getIP(function(err, ip) {
                console.log(err);
                console.log("ip");
                console.log(ip);
                require("http").get("http://www.pur3.co.uk/hello.txt", function(res) {
                  console.log("Response: ",res);
                  res.on('data', function(d) {
                  console.log("--->"+d);
              });
              });
           });
          },6000);
        });
      });
    });
    

    I get the following output:

    ["\r\nAT+RST\r\n"
    ] "\r\nERROR\r\n\r\nOK\r" <--- "\r\nERROR\r\n\r\nOK\r"
    ] "\n" <--- "\n"
    ] "\r" <--- "\r"
    ] "\n ets Jan  8 2013,rst cause:1, boot" <--- "\n ets Jan  8 2013,rst cause:1, boot"
    ] " ets Jan  8 2013,rst cause:1, boot mode:(3,0)\r\n\r\n" <--- " mode:(3,0)\r\n\r\n"
    ] "load 0x40100000, len 28460, room 16 \r\n" <--- "load 0x40100000, len 28460, room 16 \r\n"
    ] "t" <--- "t"
    ] "tail 12\r\nchksum 0xc3\r\nho 0" <--- "ail 12\r\nchksum 0xc3\r\nho 0"
    ] "ho 0 tail 12 room 4\r\nload 0x3ffe8000, len 3124, room 12 \r\ntail 8\r\nchksum 0xae\r\nlo" <--- " tail 12 room 4\r\nload 0x3ffe8000, len 3124, room 12 \r\ntail 8\r\nchksum 0xae\r\nlo"
    ] "load 0x3ffe8c40, len 8476, room 0 \r\ntail 12\r\nchksum 0x49\r\ncsum 0x49\r\n" <--- "ad 0x3ffe8c40, len 8476, room 0 \r\ntail 12\r\nchksum 0x49\r\ncsum 0x49\r\n"
    ] "r" <--- "r"
    ] "rlƒsô" <--- "lƒsô"
    ] "rlƒsô\r" <--- "\r"
    ] "\n\r\n\r\nFirmware builder: esp8266.ru\r\n\r\nready\r\n" <--- "\n\r\n\r\nFirmware builder: esp8266.ru\r\n\r\nready\r\n"
    ["ATE0\r\n"
    ] "AT" <--- "AT"
    ] "ATE0\r\r\n\r\nOK\r\n" <--- "E0\r\r\n\r\nOK\r\n"
    ["AT+CIPMUX=1\r\n"
    ] "\r\nOK\r\n" <--- "\r\nOK\r\n"
    Connecting to WiFi
    ["AT+CWMODE=1\r\n"
    ] "\r\nOK\r\n" <--- "\r\nOK\r\n"
    ["AT+CWJAP=\"myssid\",\"secret\"\r\n"
    ] "W" <--- "W"
    ] "WIFI CONNECTED\r\n" <--- "IFI CONNECTED\r\n"
    Connected
    ] "W" <--- "W"
    ] "WIFI GOT IP\r\n" <--- "IFI GOT IP\r\n"
    ] "\r" <--- "\r"
    ] "\nOK\r\n" <--- "\nOK\r\n"
    ["AT+CIFSR\r\n"
    ] "+CIFSR:STAIP,\"192.168.192.25\"\r\n+CIFSR:S" <--- "+CIFSR:STAIP,\"192.168.192.25\"\r\n+CIFSR:S"
    ] "+CIFSR:STAMAC,\"18:fe:34:a2:68:97\"\r\n\r\nOK\r\n" <--- "TAMAC,\"18:fe:34:a2:68:97\"\r\n\r\nOK\r\n"
    CIFSR failed: +CIFSR:STAMAC,"18:fe:34:a2:68:97"
    ip
    undefined
    ["AT+CIPSTART=0,\"TCP\",\"http://www.pur3.co.uk\",80\r\n"
    ] "0," <--- "0,"
    ] "0,CONNECT\r\n\r\nOK\r\n" <--- "CONNECT\r\n\r\nOK\r\n"
    ] "0,CLOSED" <--- "0,CLOSED"
    ] "0,CLOSED\r\n" <--- "\r\n"
    > 
    

    I can ping the module on IP provided by CIFSR:STAIP but I don't get a response from the GET call.

    So I wonder what the error exactly means and how I can fix it. Thanks!

  • Ahh, ok. I think your issue is you're not using the right module for the ESP8266 firmware - unfortuntely the two are different enough that a different module is needed. Try:

    var wifi = require("ESP8266WiFi_0v25").connect(Serial2, function(err) {
    ...
    });
    
  • Thanks @Gordon! That did the trick and now it works like a charm :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ESP8266: CIFSR failed

Posted by Avatar for chrigu @chrigu

Actions