You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • Dug up the ESP8266 (black PCB) and connected it to a Pixl.js

    This is the code I used to detect the baud rate, and this then get the hello page.

    // blewifi.js
    // Pixl - ESP8266 ESP-01
    //
    // Pixl    Color  ESP8266  Run   Pgm
    //                (ESP-01) Mode3 Mode1
    // -----------------------------------
    // RX D0  - YEL - UTXD                
    // TX D1  - BLU - URXD                
    // GND    - BLK - GND                 
    // 3.3V   - RED - VCC                 
    //    D8  - WHT - RST      H     H
    //    D9  - BRN - GPIO0    H|F   L
    //    D10 - GRN - GPIO2    H     H
    //    D11 - ORG - CH_PD    H|3.3 H|3.3
    //
    // *F=Float, 3.3=3.3V,
    //  H/L w/ Resistor to rail or MC pin
    //
    pinMode(D8 ,"output"); D8.set();
    pinMode(D9 ,"output"); D9.set();
    pinMode(D10,"output"); D10.set();
    pinMode(D11,"output"); D11.set();
    var serial=Serial1
      , pins={rx:D0,tx:D1}
      , baud=115200 // 76800
      , wifi,wifiMod=require("ESP8266WiFi_0v25")­
    //  Use ESP8266WiFi here  ^^^^^^^^^^^^^^^^ (and 9600 baud)
    //  if you have an ESP8266 with firmware older than 0.25 (?)
      , WIFI_NAME="mySSID"
      , WIFI_PASS="myPassword"
      ;
    
    function hello(altBaud) { // for run
      altBaud=altBaud||baud;
      serial.setup(altBaud, pins);
      console.log("Connecting to ESP8266");
      Terminal.println("Connecting to ESP8266");
      wifi=wifiMod.connect(serial, function(err) {
        if (err) throw err;
        console.log("Connecting to WiFi");
        Terminal.println("Connecting to WiFi");
        wifi.connect(WIFI_NAME, WIFI_PASS, function(err) {
          if (err) throw err;
          console.log("Connected");
          Terminal.println("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);
              Terminal.println("--->"+d);
             });
          });
        });
      });
    }
    
    function pgm() {
      D9.reset();
      D8.reset();D8.set(); // reset
    }
    
    function test() {
      setTimeout(function() { test0(  9600); }, 4000);
      setTimeout(function() { test0(115200); }, 8000);
      setTimeout(function() { test0( 76800); },12000);
      setTimeout(function() { test0( 57600); },16000);
      setTimeout(function() { test0( 74880); },20000);
      setTimeout(function() { console.log("Done!"); },24000);
    }
    
    function test0(baud) {
      serial.removeAllListeners();
      var l="";
      serial.on('data', function(d) {l+=d;});
      serial.setup(baud, pins);
      D8.reset();D8.set(); // reset
      setTimeout(function(){
        serial.write("AT+GMR\r\n");
        setTimeout(function(){
          console.log(baud,":",JSON.stringify(l));­
          Terminal.println(baud,":",JSON.stringify­(l));
          },1000);
      },200);
    }
    

    After upload of the code, I enter in the IDE console: test().

    And get this back:

    >test()
    =undefined
    9600 : ""
    115200 : "AT+GMR\r\r\nAT version:0.40.0.0(Aug  8 2015 14:45:58)\r\nSDK version:1.3.0\r\nAi-Thinker Technology Co.,Ltd.\r\nBuild:1.3.0.2 Sep 11 2015 11:48:04\r\nOK\r\n"
    76800 : "\xAB\xE5\xF0"
    57600 : "eEC\xF8"
    74880 : "\xAA\xA5\xFD"
    Done!
    > 
    

    Because 'clear' shows with 115200 baud, I enter hello(115200), and get this back:

    >hello(115200)
    Connecting to ESP8266
    =undefined
    Connecting to WiFi
    Connected
    Response:  httpCRs: { "hdrs": true,
      "headers": {
        "Date": "Mon, 16 Nov 2020 13:52:53 GMT",
        "Server": "Apache/2.4.18 (Ubuntu)",
        "Last-Modified": "Fri, 15 Nov 2013 15:42:26 GMT",
        "ETag": "\"d-4eb390b887c80\"",
        "Accept-Ranges": "bytes",
        "Content-Length": "13",
        "Connection": "close",
        "Content-Type": "text/plain"
       },
      "cRcv": 0,
      "httpVersion": "1.1",
      "statusCode": "200",
      "statusMessage": "OK"
     }
    --->Hello World!
    > 
    

    Unfortunately, I have no plain ESP-12X for testing, but I have another ESP-01 (blue PCB) with even older firmware. I'll try to update it. test() returns:

    >test()
    =undefined
    9600 : "\xFE"
    115200 : "\x10\2"
    76800 : "\r\n ets Jan  8 2013,rst cause:2, boot mode:(3,6)\r\n\r\no"
    57600 : "GDZ\x98Q(`\xC9h\v\xCC\xBB\xC9@Pu\xA8u\x­1DP\x11\5T\xFD"
    74880 : "\r\n ets Jan  8 2013,rst cause:2, boot mode:(3,6)\r\n\r\nload 0x40100000, len 28460, room 16 \r\ntail 12\r\nchksum 0xc3\r\nho 0 tail 12 room 4\r\nload 0x3ffe8000, len 3124, room 12 \r\ntail 8\r\nchksum 0xae\r\nload 0x3ffe8c40, len 8476, room 0 \r\ntail 12\r\nchksum 0x49\r\ncsum 0x49\r\nRTD"
    Done!
    >
    

    And it never got beyond Uncaught No 'ready' after AT+RST exception when connecting to the ESP8266 module, even though it worked when I used it 5+ years ago.

    >hello(74880)
    Connecting to ESP8266
    =undefined
    Uncaught No 'ready' after AT+RST
    >
    

    (PS: Screen shot of PixleJS w/ test() with a different sequence and no 74880 baud check.)


    1 Attachment

    • BLE_WiFi_PixlJS_ESP8266_ESP-01_black.jpg
About

Avatar for allObjects @allObjects started