Avatar for magore

magore

Member since Oct 2013 • Last active Jan 2017
  • 1 conversations
  • 3 comments

Most recent activity

  • in General
    Avatar for magore

    HI Gordon,
    I can check for you to see what 0.94 does.
    Thanks for the tip about using the Linux/Espruino - that may help however at the moment I find that recompile to new firmare takes under 30 seconds at the moment.
    I have been switching between controlling the device directly via USB ftdi232 converter and via the Espruino and with the espurino code for testing. (I made a lttitle test board that has a ESP8266 socket, reset and ESP8266 flash mode enable jumpter and a ftdi232 device - that makes rapid switching easy during debugging. I have also been using JS serial read/write code on the Espurino to talk with the device without using the connection methods. I will have way more time tomorrow night and this weekend - I really hope to get it all working. I will be sure to try a few different versions of the ESP8266 firmware and report my results.

  • in General
    Avatar for magore

    Yes 0.9.5 (b1) is the latest offical firmware
    I am getting closer to working code aftre making a few more changes and fixing a broken test. I am now stuck with a new bug that AT+CIPSEND=NN,XX drops all \r characters over the network (this is really only a ESP8266 0.9.5 (b1) code bug) causing the sent size to mismatch and timeout waiting for more characters.
    See: http://www.esp8266.com/viewtopic.php?f=1­3&t=1610

    Once I work this out everything should start working and I can post diffs to network_esp8266.c - just in cases others don't want to wait for an offical fix by the Author.

    This is what I am now getting after the CWJAP command "OK" response - see first post
    (the last SEND OK is actually from the IPCLOSE command not the send)

    ESP8266> ""
    ESP8266> "OK"
    >>>> "AT+CIFSR\r"
    ESP8266> "AT+CIFSR"
    ESP8266> "+CIFSR:STAIP,\"192.168.200.232\""
    ESP8266> "+CIFSR:STAMAC,\"18:fe:34:9e:2d:29\""
    ESP8266> ""
    ESP8266> "OK"
    Connected
    >>> "AT+CIPSTART=0,\"TCP\",\"192.168.200.1\"­,80\r"
    ESP8266> "AT+CIPSTART=0,\"TCP\",\"192.168.200.1\"­,80"
    ESP8266> "0,CONNECT"
    ESP8266> ""
    ESP8266> "OK"
    >>> "AT+CIPSEND=0,64\r"
    ESP8266> "AT+CIPSEND=0,64"
    ESP8266> ">"
    ERROR: Socket error -1 while sending
    >>> "AT+CIPCLOSE=0\r"
    Uncaught Error: Send failed
    ESP8266> " GET / HTTP/1.0User-Agent: Espruino 1v74Connection: close
    ESP8266> ""
    ESP8266> "SEND OK"
    
  • in General
    Avatar for magore

    I just debugged a problem with ESP8266 v0.95(b1) firmware and the latest Espurino build in file network_esp8266.c:
    1) Sending the command AT+CWJAP="",""
    now longer seems to work, so this code now always fails:

      libs/network/esp8266/network_esp8266.c:  JsVar *cmd = jsvNewFromString("AT+CWJAP=\"\",\"\"\r\n­");
    

    I changed this command to AT+CWQAP for now to test

    2) Sending any AT commands with \r\n fails - use \r only when sending to the esp8266

    3) Looks like the esp8266_connect() timeout of 500ms is way way to fast especially when connecting to an AP (should be over 5 seconds, ie 10000)
    Adding -dESP8266_DEBUG to the defines section of the Makefile helps watch the progress of the failures

    Code I used to test: (note I have an STM32F4 (407) Discovery board)

    Serial4.setup(9600, { rx: A1, tx : A0 });
    console.log("Connecting to ESP8266");
    var wifi = require("ESP8266").connect(Serial4, function() {
     console.log("Connecting to WiFi");
      wifi.connect("your_ssid_here","your_pass­word", function() {
        console.log("Connected");
        require("http").get("http://192.168.1.1"­, function(res) {
          console.log("Response: ",res);
          res.on('data', function(d) {
            console.log("--->"+d);
          });
        });
      });
    });
    

    Debug Log so far all timeouts updated to 10000 in libs/network/esp8266/network_esp8266.c

    >Serial4.setup(9600, { rx: A1, tx : A0 });
    =undefined
    >console.log("Connecting to ESP8266");
    Connecting to ESP8266
    =undefined
    >var wifi = require("ESP8266").connect(Serial4, function() {
    :  console.log("Connecting to WiFi");
    :  wifi.connect("your_ssid_here","your_pass­word_here", function() {
    :    console.log("Connected");
    :    require("http").get("http://192.168.200.­1", function(res) {
    :      console.log("Response: ",res);
    :      res.on('data', function(d) {
    :        console.log("--->"+d);
    :      });
    :    });
    :  });
    :});
    >>> "AT+CWQAP\r"
    ={  }
    ESP8266> "AT+CWQAP"
    ESP8266> ""
    ESP8266> "OK"
    >>> "AT+CWMODE=1\r"
    ESP8266> "AT+CWMODE=1"
    ESP8266> ""
    ESP8266> "OK"
    >>> "AT+RST\r"
    ESP8266> "AT+RST"
    ESP8266> ""
    ESP8266> "OK"
    ESP8266> "D�I\x11�H\x112�\x00�a�k#��'��\"\b\x11\x­00���"
    ESP8266> ""
    ESP8266> "Vendor:http://www.ai-thinker.com"
    ESP8266> ""
    ESP8266> "SDK Version:0.9.5(b1)"
    ESP8266> "Compiled @:Dec 25 2014, 21:50:58"
    ESP8266> "ready"
    >>> "AT+CIPMUX=1\r"
    ESP8266> "AT+CIPMUX=1"
    ESP8266> ""
    ESP8266> "OK"
    Connecting to WiFi
    >>> "AT+CWJAP=\"your_ssid_here\",\"your_pass­word_here\"\r"
    ESP8266> "AT+CWJAP=\"your_ssid_here\",\"your_pass­word_here\""
    ESP8266> ""
    ESP8266> "OK"
    >>>> "AT+CIFSR\r"
    ESP8266> "AT+CIFSR"
    ESP8266> "+CIFSR:STAIP,\"192.168.200.232\""
    ESP8266> "+CIFSR:STAMAC,\"18:fe:34:9e:2d:29\""
    ESP8266> ""
    ESP8266> "OK"
    Uncaught Error: WiFi network connection failed
    

    You can see the connection works - but the return status is wrong

Actions