ESP8266 Troubleshooting Guide

The ESP8266 has a few common issues, specially when you are trying to flash a new firmware or uploading scripts.

This is a companion guide to the Home Automation using ESP8266 and Password Protected Web Server eBooks.

Here’s a compilation with some of the most common problems with the ESP8266 and how to fix them.

ESP8266 Troubleshooting – NodeMCU Flasher

Where do I download the NodeMCU flasher?

Go to the NodeMCU flasher GitHub repository and download the flasher for your Windows PC bit version by clicking the button that says “Raw”:

Which settings should I use with the NodeMCU flasher?

The NodeMCU flasher already comes with the right settings by default.

If you have changed some of the settings, I highly recommend that you re-download the NodeMCU flasher.

Here’s my current settings:

nodemcu flasher

After I press the “Flash” button nothing happens, the NodeMCU flasher doesn’t start the flashing process 

If you pressed the “Flash” button and nothing happens… It means one of these two things:

  • Problem 1 – Your ESP isn’t in flash mode (double-check if GPIO 0 is connected to GND on power up)
  • Problem 2 – Your FTDI Programmer can’t supply enough current to your ESP

nothing happens

Problem 1 – How to make your ESP go into flash mode:

  1. Close the NodeMCU flasher window
  2. Remove power from your ESP8266
  3. Having your ESP connected like this (double check that GPIO 0 is connected to GND)
  4. Apply power to your ESP8266 and open the NodeMCU flasher
  5. Press the “Flash” button

If it’s still saying “Waiting MAC”, then try the following:

  1. Having the NodeMCU flasher still open
  2. Connect a wire from your ESP8266 reset pin to GND
  3. Remove that wire from GND and connect to VCC

Repeat steps 2 and 3 a few times until your ESP reboots and hopefully the NodeMCU flasher can detect your ESP and start the flashing process.

Problem 2 – If your FTDI can’t supply enough current, you might need to buy a new FTDI programmer or power your ESP8266 with an external power supply.

NodeMCU flasher gets stuck at a certain percentage

nodemcu stuck

  1. Remove power from your ESP+FTDI:
  2. Close the NodeMCU flasher window
  3. Plug your ESP+FTDI to your computer again
  4. Open NodeMCU flasher and try the 19200 baud rate

If this process fails, please repeat the same procedure for the next baud rates (38400, 57600, 74880 and 115200).

I don’t know why, but at least 5 people faced the same problem and this trick solved it. So at a baud rate of 57600 or 115200 I think it will flash 100%. I don’t have any logical explanation, since this is not very common.

How does the NodeMCU flasher should look after a successful flash?

It should have a green arrow in the bottom left.

nodemcu flasher flashed

Unbricking the FTDI Programmer on Windows PC

If you have a brand new FTDI Programmer and you need to install your FTDI drivers on Windows, visit this website for the official drivers: http://www.ftdichip.com/Drivers/VCP.htm.

In alternative, you can contact the seller that sold you the FTDI Programmer.

If you’re having trouble installing the FTDI drivers on Windows 7/8/8.1/10 it’s very likely that FTDI is bricked.

Follow this tutorial to fix that: http://youtu.be/SPdSKT6KdF8.

In the video I mentioned earlier, the guy tells you to download the drivers from the FTDI website, read carefully the YouTube description of his video to find all the links. Here’s the drivers you need: http://www.ftdichip.com/Drivers/CDM/CDM%20v2.12.00%20WHQL%20Certified.zip

ESP8266 Troubleshooting – ESPlorer IDE

ESPlorer IDE Error: only one tcp server allowed

This means that you tried to upload multiple scripts and you ESP is still running the old script with a web server. To fix it, you simply need to send these commands to delete all the files and restart your ESP:

  1. file.format()
  2. node.restart()

Upload the script again and name it ‘init.lua’ and you shouldn’t see that error again.

ESPlorer IDE Error: can’t autodetect firmware

and

ESPlorer IDE Error: Waiting answer from ESP – Timeout reached. Command aborted.Waiting answer from ESP – Timeout reached. Command aborted.

can't autodetect firmware

This sounds like your ESP it’s still in flash mode. How to make your ESP go into user mode:

  1. Close the ESPlorer IDE connection
  2. Remove power from your ESP8266
  3. Having your ESP with GPIO 0 connected to VCC
  4. Apply power to your ESP8266 and re-establish the connection with ESPlorer IDE

If it’s still saying “can’t autodetect firmware”, then try the following:

  1. Having the ESPlorer IDE connection still printing “…..”
  2. Connect a wire from your ESP8266 reset pin to GND
  3. Remove that wire from GND and connect to VCC

Repeat steps 2 and 3 a few times until your ESP reboots and hopefully the ESPlorer IDE can detect your ESP.

My code disappears when I restart the ESP8266

If you upload a script to your ESP and when you restart it your ESP doesn’t do anything. It means that your ESP couldn’t find the script or it occurred a memory issue.

This can be solved like this:

  1. You didn’t save your script with this exact name ‘init.lua’. Re-uploading the same script, but with the ‘init.lua’ name should solve your problem
  2. It can be a memory issue. Re-flashing the ESP with NodeMCU flasher usually solves that problem

Finding the ESP8266 IP Address

Before you start make sure you check these two items:

  1. Verify that the script uploaded to your ESP has the right network credentials
  2. Make sure your ESP is near your router

Here’s what you can do to find the IP address:

Solution 1 – Sending a command with the ESPlorer IDE

  1. Send the command “print(wifi.sta.getip())” with the ESPlorer IDE and it should print your IP Address

ESP IP Address

Solution 2 – Install an IP Scanner Software

  1. An IP Scanner software searches for all the devices in your network
  2. Download this free software:
    1. Windows PC: www.advanced-ip-scanner.com
    2. MAC OS X, Windows or Linux: http://angryip.org
  3. Install one of these softwares (while having your ESP running with that web server script)
  4. Open the IP Scanner software and click “Scan”
  5. Let that process finish (it can take a couple of minutes)

In my case, it found my ESP. Now if I type 192.168.1.95 in my browser I can see the ESP web server.

advanced ip scanner

ESP8266 Troubleshooting – Arduino IDE

I can’t upload scripts to my ESP8266 using the Arduino IDE

How to make your ESP go into upload mode when using the Arduino IDE:

  1. Remove power from your ESP8266
  2. Having your ESP connected like this (double check that GPIO 0 is connected to GND)
  3. Apply power to your ESP8266 and open the Arduino IDE
  4. Press the “Upload” button

Did you experience other problems?

Please leave a comment below, so I can update the troubleshooting guide with more problems and solutions.

Thanks for reading,

-Rui Santos


Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »

Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »


Enjoyed this project? Stay updated by subscribing our weekly newsletter!

106 thoughts on “ESP8266 Troubleshooting Guide”

  1. I observed irratic behavior as few mentioned by u, and the solution I observed with NodeMcu dev board was insufficient current capacity of 3.3volt from Dev board. On using 3.3 volt supply from external sourcesolved all such problems. Making system reliable.
    Expecting more work from u for NodeMcu with Lua.
    Thnx

      • Hi Rui. I got that : ¤üFatal exception (0):
        epc1=0x40220142, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
        Fatal exception (0):

        when i tried to use esplorer… any idea?
        Thank YOu!
        Marc.

        • Hi Marc!
          Do you have Java installed on your computer? Make sure you install Java first, then re-download the ESPlorer IDE and try to run it again.

          I hope this solves your issue,
          Rui

  2. When I had my esp8266 programmed in wifi.SOFTAP mode, I connected to it with four cell phones at once (to show my friends how it worked). a few minutes later it was smoking and burned out. I’m not sure if this was because of the multiple connections to it via wifi causing the chip to overload or if this was simply because the chip wasn’t built well.

  3. Great comilation Rui!
    You may or not remember trying to assist me with these very issues; ufortunately to no avail in my case. You might remember that I had several different types of modules (ESP-07, ESP-12, ESP-03).My plan was to wait for reciept of several more ESP-12 modules to arrive in an effort to prove or disprove the failure of the one module. Those have still not arrived after 2 months. In the mean time several thoughts come to mind and I’m wondering if something in the internal memory could have been overwritten in one of the failed attempts to “brick” the module. (perhaps something like a bootstrap loader?) Not understanding some of the terms used such as “room” etc. I don’t fully understand the make up of the memory map. Keeping in mind that the module failed not only in flashing nodeMCU, but also would not flash the original AT command firmware using the Electrodragon flash tool (with similar results), I am wondering if that indeed could be an issue.

    • Hi John,
      Thank you. Yes, I do remember your problem and I don’t a good explanation why that happen and how to fix it.
      Sometimes my flashing process has failed, but if I try a next time I can immediately flash the ESP8266 again. I’ve never experience the problem o bricking the ESP8266…
      What happens when you try to flash the NodeMCU firmware again? Does it never start or stop in the middle?

      I personally think that the problem that you are facing is with your FTDI programmer and not with the ESPs.
      But I’m not sure

  4. I have searched through several available projects but unfortunately I can’t make it work: Controlling some GPIO’s of an Arduino UNO connected with an ESP8266!
    How hard can it be…?
    Continuously no RX-TX communication between the Arduino and the ESP and similar difficulties. ( yes, I know well about the 3.3V complication)
    I’ve found “100’s” different schematics. Everybody does it differently.
    Can somone offer me a real simple basic working example ( + Arduino code) please?

  5. I would add a few things i have seen here and there:

    GPIO0, GPIO2 should be high at startup for running code.
    GPIO0 should be low, GPIO2 should be high at at startup for flashing firmware.
    GPIO15 should be low all the time.
    Also these pins are not ideal for switching things.

    CHPD, RST also should be high, There should be a 100nF cap right next to the ESP’s pins connecting VCC and ground.

    What i am not sure about is that how to pull high the pins. I’ve seen a lot of posts/articles etc. stating that pins should be pulled high with resistors, not just a simple wire/pcb track and i’ve seen all kinds of values ranging from 3k to 15k. I am confused about that one.

  6. As noted FTDI boards can become “Bricked” due to FTDI efforts to stop counterfeits. For great explanation see
    youtube.com/watch?v=eU66as4Bbds
    Also as don’t seem to be very robust. I’ve had two boards burn up a couple of months usage. I’ve much better results with:
    CP2102 $1.27
    CH340G $0.57
    From Aliexpress
    Hope others find this useful

  7. PORT OPEN 115200

    Communication with MCU…
    ……….
    ……….
    ……….

    this is what I get when trying to connect with FTDI and windows 7.
    Will not connect to the ESP8266-01

  8. Can you show me the way to use DTS and RTS of the Ft232 adapter to auto programming for esp8266 without reset button and proggraming switch?

  9. Using ESP8266 V2 Development board, Due to (LuaLoader) coding error hanged the board and no reponse, unable to communicate even. Need to find the right firmware from which can be program use of LuaLoader and flash it. Seek directions sir!

  10. Hello Mr. Santos,

    I have bought your Book and two NODEMCU-V09 Devkits. Power supply: 5Vdc/2A.
    I have succeeded to flash them (nodemcu_integer_0.9.6-dev_20150704.bin)
    But to load some Scripts with the Esplorer is not possible. I am receiving only these answers:
    *************************++++
    PORT OPEN 9600

    Communication with MCU…
    ……….
    ……….
    ……….
    ……….
    ………Got answer! AutoDetect firmware…

    Can’t autodetect firmware, because proper answer not received.
    “I˜;\ŸUploading to ESP file init.lua…Waiting answer from ESP – Timeout reached. Command aborted.Waiting answer from ESP – Timeout reached. Command aborted.
    ***************************+++
    I have tried to repeat et least 5-7 times the connection Reset-> Gnd->Vcc. It does not help at all. I have tried to re-flash these two DevKits. It doesn’t help at all.

    I am trying to get these modules to work, since 2 days. No chance. I haven’t found for these DevKits any description (only pinouts and 2-3 Youtube -clips, but wit no practical use at all)

    Have you ever tried to use these DevKits? If yes, could you please help me?

    Best Regards from Germany,

    Alex

      • Thanks a lot for the fast answer, but I haven’t received anything yet.
        I am waiting to receive your Email.

        I have checked all the voltages.
        The 3,3V is: 3.333V
        TxD=3.334V
        RxD=3.629V
        EN=3.330V
        RST=3.333V
        The 5V=5.02V.

        Until then!

      • Any solution on this ? As even i got such kind of message from esplorer with Java 1.8 version installed in my win7.

        PORT OPEN 115200

        Communication with MCU…
        ……….
        ……….
        Got answer! AutoDetect firmware…
        Communication with MCU established.
        Can’t autodetect firmware, because proper answer not received (may be unknown firmware).
        Please, reset module or continue.

          • I have tried every baud rate 9600, 115200 , 74880 etc.
            I have been using nodemcu_integer_0.9.5_20150318.bin flashed at 0x000.

            But i’m stuck at same place.

            PORT OPEN 9600

            Communication with MCU…
            ……….
            Got answer! AutoDetect firmware…
            Communication with MCU established.
            Can’t autodetect firmware, because proper answer not received (may be unknown firmware).
            Please, reset module or continue.
            �‡‚‚þ‡‚Žþ‡þw{cw{cw{cw{cw{cw{cw{c

            I tried your troubleshooting step of Esplorer, closed esplorer, discnnected the ESP power and than reconnected it. But nothing is working.

          • I’m able to flash and program properly with AT binaries but not with NodeMCU.
            I’ve tried using nodemcu_integer_0.9.5_20150318.bin and nodemcu_integer_0.9.6-dev_20150331.bin

          • During flashing GPIO0 was connected to GND, and it flashed properly. Now for programming (user mode) GPIO0 is connected to Vcc (3.3V).

  11. I purchased your book and was able to get my esp8266 up and running. I had the 2 leds controlled by the web working for about 30 minutes then it stopped working and the blue light has come on and stayed on. I have ben able to flash it but when i try to connect to it all i get is garbage characters back. This has happened on 2 esp8266. They work then after 30 minutes or so they seem to freeze up. Any help would be great.
    Thanks

    • Hi Brad,
      Thank you for supporting my work! How are you powering your ESP8266?
      Do you have a stable power connection? That might be a power spike that makes your ESP disconnect and needing a reset.

      Thanks,
      Rui

      • I ran it off the usb power originally and everything worked for 30 minutes or so. I ran it off a power supply and it is doing the same thing. I’m able to flash it but I can’t get it to connect to the ESPlorer. The red and blue light are on all the time after resetting after a new flash.
        I found this on the net and wandering if this could be the problem.

        “Looks like you do not use a controller to send your data to. ESP tries to upload data but cannot connect to a controller this results in the ConnectionFailures counter to be added by 1. Every minute ESP gets a new ConnectFailure resulting in the counter reaching 30 after about half an hour.
        Then the program reboots itself.

        If you uncheck the ‘Send Data’ box in all your device tabs (Edit and under Task Settings) then ESP will stop trying to send data to a controller and no ConnectionFailures are counted.

        edit: If you do use a controller then double check if you have given the right Controller IP and Controller Port in the Main Settings tab.”

        Any help would be great,
        Thanks

  12. Hello Rui!
    I’m facing the same problem where my nodemcu firmware update stops midway (right under the P of COM port where the progress is shown) I’ve tried at he method you have mentioned there to tackle it, but with no progress at all. Previously I’ve used the same ESP8266 and the FTDI232 to implement communication between ESP and a browser using the STAIP successfully. I think this means my FTDI and the ESP are working well (right?!). I’m stuck at this point now(firmware update). Any help would be appreciated!

    • Hi Can you please post the log message from the NodeMCU flasher (in the log tab).
      Probably it might be write or address timeout.
      Address timeout is generally because of the wrong configurations.

      You can try with these advanced configuration in NodeMCU.

      flash size : 8Mbyte
      flash speed : 40MHz
      SPI Mode : DIO

  13. i followed your tutorial to the letter, but i get this error when i try to compile your program:
    exit status 1
    ‘D1’ was not declared in this scope

  14. Hi,what are the other buttons for on ESPlorer IDE some buttons are save to and some buttons are save to ans some buttons are the same? i dont get why?there are two save and compile and there are two view buttons on esp,( save to) (upload to) and (send to) whats the differance,realy ime confused and they never work half the time,i cant find a manual for the ide eather that explains “everything”

  15. I had the issue you discribed at “NodeMCU flasher gets stuck at a certain percentage”. Changing the baud rate did not work for me. BUT, fortunantly, my notebook has an USB 2.0 port (beside all the USB 3.0 ports). I plugged the FTDI to the USB 2.0 port and it worked perfectly!

    Have fun!

  16. Hi Rui,

    Any experience with this board:
    smartarduino.com/esp8266-wifi-web-sever-shield-for-arduino_p94660.html

    Biggest question…how to turn this into a webserver..using the IDE ?????

    Wim

      • Does anyone know why this sketch does not comile because of the <meta ………. line.
        I just want the temp to be send every 2 seconds to my browser and a line feed betwenn the temperature Digits.
        PLEASE HELP I am nearly there I think.

        // Connect to WiFi network
        WiFi.begin(ssid);
        Serial.print("\n\r \n\rWorking to connect");

        // Wait for connection
        while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
        }
        Serial.println("");
        Serial.println("DHT Weather Reading Server");
        Serial.print("Connected to ");
        Serial.println(ssid);
        Serial.print("IP address: ");
        Serial.println(WiFi.localIP());
        ;

        // server.on(“/”, handle_root);

        server.on(“/temp”, [](){ // if you add this subdirectory to your webserver call, you get text below 🙂
        gettemperature(); // read sensor
        webString=”Temperature: “+String((int)temp_t)+” C”; // Arduino has a hard time with float to string
        server.send(200, “text/plain”, webString); // send to someones browser when asked
        });

        /* server.on(“/humidity”, [](){ // if you add this subdirectory to your webserver call, you get text below 🙂
        gettemperature(); // read sensor
        webString=”Humidity: “+String((int)humidity)+”%”;
        server.send(200, “text/plain”, webString); // send to someones browser when asked
        });
        */
        server.begin();
        Serial.println(“HTTP server started”);
        Serial.println();//Wiederholung http
        // Serial.println(());
        }

        void loop(void)
        {
        server.handleClient();

        }

        void gettemperature() {
        // Wait at least 2 seconds seconds between measurements.
        // if the difference between the current time and last time you read
        // the sensor is bigger than the interval you set, read the sensor
        // Works better than delay for things happening elsewhere also
        unsigned long currentMillis = millis();

        if(currentMillis – previousMillis >= interval) {
        // save the last time you read the sensor
        previousMillis = currentMillis;

        // Reading temperature for humidity takes about 250 milliseconds!
        // Sensor readings may also be up to 2 seconds ‘old’ (it’s a very slow sensor)
        humidity = dht.readHumidity(); // Read humidity (percent)
        temp_t = dht.readTemperature(); // Read temperature as Fahrenheit
        // Check if any reads failed and exit early (to try again).
        if (isnan(humidity) || isnan(temp_t)) {
        Serial.println(“Failed to read from DHT sensor!”);
        return;
        }
        }
        }

        • Sorry got the copy wrong. This is now correct.
          #include
          #include
          #include
          #include
          #define DHTTYPE DHT22
          #define DHTPIN 2

          const char* ssid = “ESP8266”;
          const char* password = “”;

          ESP8266WebServer server(80);

          // Initialize DHT sensor
          // NOTE: For working with a faster than ATmega328p 16 MHz Arduino chip, like an ESP8266,
          // you need to increase the threshold for cycle counts considered a 1 or 0.
          // You can do this by passing a 3rd parameter for this threshold. It’s a bit
          // of fiddling to find the right value, but in general the faster the CPU the
          // higher the value. The default for a 16mhz AVR is a value of 6. For an
          // Arduino Due that runs at 84mhz a value of 30 works.
          // This is for the ESP8266 processor on ESP-01
          DHT dht(DHTPIN, DHTTYPE, 11); // 11 works fine for ESP8266

          float humidity, temp_t; // Values read from sensor
          String webString=””; // String to display
          // Generally, you should use “unsigned long” for variables that hold time
          unsigned long previousMillis = 0; // will store last temp was read
          const long interval = 2000; // interval at which to read sensor

          void handle_root() {
          server.send(200, “text/plain”, “Hello from the weather esp8266, read from /temp or /humidity”);
          delay(100);
          }

          void setup(void)
          {
          // You can open the Arduino IDE Serial Monitor window to see what the code is doing
          Serial.begin(115200); // Serial connection from ESP-01 via 3.3v console cable
          dht.begin(); // initialize temperature sensor

          // Connect to WiFi network
          WiFi.begin(ssid);
          Serial.print(“\n\r \n\rWorking to connect”);

          // Wait for connection
          while (WiFi.status() != WL_CONNECTED) {
          delay(500);
          Serial.print(“.”);
          }
          Serial.println(“”);
          Serial.println(“DHT Weather Reading Server”);
          Serial.print(“Connected to “);
          Serial.println(ssid);
          Serial.print(“IP address: “);
          Serial.println(WiFi.localIP());
          ;

          // server.on(“/”, handle_root);

          server.on(“/temp”, [](){ // if you add this subdirectory to your webserver call, you get text below 🙂
          gettemperature(); // read sensor
          webString=”Temperature: “+String((int)temp_t)+” C”; // Arduino has a hard time with float to string
          server.send(200, “text/plain”, webString); // send to someones browser when asked
          });

          /* server.on(“/humidity”, [](){ // if you add this subdirectory to your webserver call, you get text below 🙂
          gettemperature(); // read sensor
          webString=”Humidity: “+String((int)humidity)+”%”;
          server.send(200, “text/plain”, webString); // send to someones browser when asked
          });
          */
          server.begin();
          Serial.println(“HTTP server started”);
          Serial.println();//Wiederholung http
          // Serial.println(());
          }

          void loop(void)
          {
          server.handleClient();

          }

          void gettemperature() {
          // Wait at least 2 seconds seconds between measurements.
          // if the difference between the current time and last time you read
          // the sensor is bigger than the interval you set, read the sensor
          // Works better than delay for things happening elsewhere also
          unsigned long currentMillis = millis();

          if(currentMillis – previousMillis >= interval) {
          // save the last time you read the sensor
          previousMillis = currentMillis;

          // Reading temperature for humidity takes about 250 milliseconds!
          // Sensor readings may also be up to 2 seconds ‘old’ (it’s a very slow sensor)
          humidity = dht.readHumidity(); // Read humidity (percent)
          temp_t = dht.readTemperature(); // Read temperature as Fahrenheit
          // Check if any reads failed and exit early (to try again).
          if (isnan(humidity) || isnan(temp_t)) {
          Serial.println(“Failed to read from DHT sensor!”);
          return;
          }
          }
          }

  17. Hi Rui,
    I am new to the ESP8266 and using Wifi related applications. Is it possible to use the esp8266 and an dht22 to send temperature data continiously to a Tablet (without a browser refresh) (android) and to see the data in real temp and as a graph? Must I have a router or the Internet involved? I thought this sketch might work but I think I Need the SSID of my Internet modem and router for it to work..

      • Hi Rui,
        Thanks for the quick answer. I don’t think I ask the qestion correctly. If I want to send a stream of temperature readings from the esp8266 to my tablet do I HAVE to have connection to the Internet? If not could you direct me to some code that does this, I could then add to it to make a graph etc. as I have written. My knowledge is not enough to start such a Project from scratch.Hope you can help me.

        • Hi Paul,

          Is it an option to use an Arduino and a shield?
          for example an Arduino Uno and this shield: smartarduino.com/esp8266-wifi-web-sever-shield-for-arduino_p94660.html
          It is very easy to setup. You can connect the Temperature Sensor to the Arduino via the webshield interfaces and the Arduino can send via de Serial port the data to the Shield. The shield can then send via wifi the data as udp package to any IP address. no programming required for the esp8266. Example code is available.

          Regards, Wim

          • Hi Wim,
            I think there must be an easier way. I Need to Keep the DHT22 and ESP8266 small. I have now found code which sends the Temperature and Humidity (which I don’t Need) to my tablet via a Hot Spot which I Setup on my Tablet. I still have to write the IP address in the browser and /temp and the Temperature is sent to the Tablet. Now I just Need this to happen as a stream without have to call the Temperature everytime. I will try the code that Rui sent me for a constant feed to the browser. I was looking for a solution which does not need the hotspot. Thank you for your Suggestion, I will be looking at this product a bit nearer.

  18. A few weeks ago I bought the Home automation using ESP8266 ebook.
    I tried it out now.
    I successfully flash NodeMCU. When opening ESplorer and pressing open, the terminal only shows following output:

    PORT OPEN 9600

    Communication with MCU..

    no additional

    • Hi Nico.
      Did you try to follow the “ESPlorer IDE Error: Waiting answer from ESP – Timeout reached. Command aborted.Waiting answer from ESP – Timeout reached. Command aborted.” section in this blog post?
      It sounds like your ESP is not going into upload mode…

  19. Hi Rui,

    Just a request.

    I have seen that even CSS and javascript can be included in Lua script.
    Can you please post a tutorial for the same as i couldn’t find a good tuts on it, how to incorporate it and make my server more user-friendly.

  20. Hi Rui,

    nodemcu_integer_0.9.5_20150318.bin : 0x000
    esp_init_data_default.bin : 0xfc000
    blank.bin : 0xfe000

    Java version : build 1.8.0_51-b16

    Getting error :

    PORT OPEN 115200

    Communication with MCU…
    ……….
    ……….
    Got answer! AutoDetect firmware…
    Communication with MCU established.
    Can’t autodetect firmware, because proper answer not received (may be unknown firmware).
    Please, reset module or continue.

    Please help

    Thanks

    • If you flashed your ESP8266 with the NodeMCU version I’ve recommended, you must set the baud rate to 9600.
      Otherwise you’ll not be able to establish a serial communication with your ESP8266.

      Thanks,
      Rui

      • Hi Rui,

        Thanks for replying.
        Actually i’ve tried every baud rate.

        I keep on getting this :

        PORT OPEN 9600

        Communication with MCU…
        ……….
        ……….
        ……….

        Than at this point i need to bring CH_PD HIGH -> LOW -> HIGH after which communication seems established but than i get (even @9600baud)

        Got answer! AutoDetect firmware…
        Communication with MCU established.
        Can’t autodetect firmware, because proper answer not received (may be unknown firmware).
        Please, reset module or continue.
        �‡‚‚þ‡‚Žþ‡þw{cw{cw{cw{cw{cw{cw{c

  21. I have the issue “NodeMCU flasher gets stuck at a certain percentage”. I have tried all the bauds rates with the configuration suggested. No results. Is there an other trick to succeed to solve this problem ?

    • If your ESP has built-in programmer, you don’t need to worry about any connections…

      If your ESP-12 has not programmer, you can follow the same connection diagram shown in this blog post

  22. I am using esp8266-1 modules and the ESP8266Flasher that has 0.9.5 bundled with it. I am able to flash the built in 0.9.5 with no problems. I found there are some issues with the timer code in 0.9.5, and told it was resolved in 0.9.6, so I got the last revision of that NodeMCU 0.9.6 build 20150704, and that will flash just fine. However any of the custom builds that I have tried fail, They seem to flash OK, you can see the bargraph tick along. You get the checkmark at the end like all is well, but when you power them back up in user mode, you get nothing but endless lines of goop out the serial port.

    I have tried every memory size. I have seen references to having to set up to blank some areas in the memory map and upload some other file (no idea where that comes from..) to another area. Does anybody have the definitive fix for this?

  23. I use ESP to control some lamps in my home. ESP uses a webserver that provide a page with two buttons – ON and OFF.
    In LAN network, everything is fine. I can turn the lamp on and off a thousand times and the ESP works 100%, but when I’m accessing ESP from outside my LAN network, using a DDNS server and port forward in modem, ESP crashes, and does not respond to commands anymore until I reboot it.
    Any Idea?
    Thanks!

  24. Hi,

    I have an ESP8266 with usb connection (CP2102 USB interface).
    When I connect to my machine (a linux) I get the lines bellow in dmesg (I attempted to make connection on Raspberry as well as my laptop without success). Hence there is no way to get the console connected to the device via USB.
    I seems to me the USB died. In the mean time other 2 ESPs are working.
    QUESTION: Any idea how to delete everything from the chip inorder to go back to the seller for an exchange? Or do you have any idea how to fix it? I was thinking on RX/TX line + USB to serial converter, but not sure if I can do anything via those lines.
    The chip itself seems to work so it is running the scripts inside (I see the LED changing when go into deep sleep).
    [69348.252458] usb 1-1.3: new full-speed USB device number 6 using dwc_otg
    [69348.332457] usb 1-1.3: device descriptor read/64, error -32
    [69348.522449] usb 1-1.3: device descriptor read/64, error -32
    [69348.712468] usb 1-1.3: new full-speed USB device number 7 using dwc_otg
    [69348.792469] usb 1-1.3: device descriptor read/64, error -32
    [69348.982464] usb 1-1.3: device descriptor read/64, error -32
    [69349.172446] usb 1-1.3: new full-speed USB device number 8 using dwc_otg
    [69349.592464] usb 1-1.3: device not accepting address 8, error -32
    [69349.672455] usb 1-1.3: new full-speed USB device number 9 using dwc_otg
    [69350.092483] usb 1-1.3: device not accepting address 9, error -32
    [69350.092666] usb 1-1-port3: unable to enumerate USB device

    Zoli

    • I’ve never seen that error before. Are you able to detect your device? Or a driver is missing??
      Reflashing the ESP8266 with a new firmware should make it work again… You’ll need to use an external programmer instead…

  25. After successfully getting 3 ESP8266’s to take some LUA code and execute, they then stop being able to be connected to by ESPlorer. I get the message “Communication with MCU..Waiting answer from ESP – Timeout reached” The code does execute on the ESPs either. I reflash successfully, but it still appears bricked. I tried moving GPIO back and forth from Ground to VCC, but it still doesn’t work. Any thoughts?

    • Are you able to flash the ESP with NodeMCU?
      That will unbrick your ESP8266. Then, open the ESPlorer with the ESP having GPIO 0 disconnected from GND on boot up and try to upload code.

  26. This is regrading the mangoose OS installation .
    If any mismatch please let me know .
    I am following same procedure shown below .
    Procedure :
    1. Connect CP2101 to USB port ( it detect as COM3)
    2. Download mangoose software from (https://mongoose-iot.com)
    3. Press GPIO0 button , then press Rest button release reset button then release GPIO0button
    4. Open cmd prompt change directory to where I have kept mos exe
    5. Set MOS_PORT=COM3
    6. Type oms ( same folder where I have down load )
    Mangoose OS installer :
    1. Connect device , select COM3
    2. https://mongoose-iot.com/downloads/fw-esp8266.zip
    3. setup wifi
    Setup wifi am getting error :
    Error error connecting to the device via serial://COM3: Access is denied

  27. First, Rui, I thank you for the huge amount of work you have done to simplify the tool chain for this very frustrating chip. I am so close to having a working board now. Please consider the following situation and tell me what you think:

    1) I get a success message after flashing NodeMCU with your tool. My chip is 16M; it is on the Espressif ESP Launcher board, which I think is a newer dev kit. From all appearances, everything goes perfectly.

    2) I put the chip back into run mode via a switch they provide for GP0, and open the port with ESPlorer at 9600 baud. I receive a message that communication with the MCU is successful.

    3) A second message tells me “can’t autodetect firmware”…followed by a few nonsense characters. I have seen this before, though, when running the AT firmware, which otherwise runs without issue. However, in this case, I cannot seem to upload the init.lua script. It acts like it takes, but then when I reboot the chip, I get the message “Waiting answer from ESP – Timeout reached”

    **
    I do not think there is a problem with your tools. I just do not know what to check, and would appreciate any insight you may offer. I will gladly send you a screenshot if you think that might help; just provide an address. Thanks

    • Thanks for reading.
      While having the ESP connected to your computer and the ESPlorer IDE open. Try to press the ESP reset button, restarting the ESP should make it go into upload mode and remove that error.
      GPIO 0 must be disconnected or connected to VCC on boot, so that your ESP goes into upload mode with the ESPlorer IDE

  28. I am using node mcu v3 lua based esp8266.It is flashing successfully,but while opening in esplorer it is unable to communicate with mcu.
    Please give me solution

  29. I live of the grid and the ISP dictates that I use a static IP and port forwarding to access cameras and other devices with in my LAN. I must assign a static IP for each device. Can I implement this with the ESP to use a web server?
    John

  30. I was never able to use custom node MCU lua firmware. I use window 64 bit programmer , which shows completed (green check mark + ready) but my webserver which runs perfectly on the previous firmware (supplied by the website where I got webserver example from) does not run on the firmware with additional modules. It happened to me twice, I tried two different examples which run ok , but not with my custom builds of firmwares

  31. I was used my esp as AP mode and controlled home lamps… Its working well few hours after that its not working… And i did reset my esp but its not worked but mobile was connected. And i redumped the same code still not work… Finally 1st i am dump different code that code working after i came back redump old code(without any changes) this time its work.. I was faced 3 times this problem… Plz help me

      • I had the same exact problem with a lamp controller that I wrote. I used a -01 module with 8Mb or 1MB flash. I used one GPIO to run a relay board and the other for a local on/off toggle as it would be a pain in the ass to have to use a computer every time I want to turn a light on or off. The web interface has on/off buttons and the lamp itself has a push button that toggles it’s current state.

        Anyway, after a while the thing would just stop working and need to be rebooted, just like you are seeing. I had already went from flash 0.95 to 0.96 because the timer is broken in 0.95, and I moved from 0.96 to 1.54 (after a lot of fighting to get it to flash) and that solved the not working after a while problem for me.

        Lemme know if it helps ya!

  32. My USB chip is PL2303HX. will your FTDI program work.? I am using win 10 and its hell to see the port . It comes up with a yellow triange and a message saying it does not work.
    Thanks for your response.

  33. I searched a bit more and got a driver that worked. It seem to be an old version. I tried your fdti but it did not work. Sorry I did not find a solution earlier.

  34. Hi Rui
    This is shishir.I saw your post you did Great job for us. I have problem with node mcu esp 8266 wifi. For relay on off and it working fine with local ip but after few time I lost my ip and its not working until that reset again. Why its happens I could not find.please help me.
    Shishir

    • I’m not sure which code are you running and that’s very general problem. Make sure you are powering the ESP8266 with a stable power supply that can provide enough current to power your project…

  35. Hi Rui Santos,
    thank you very much for your tutorial, its very useful, but i have problem when upload your program in arduino IDE to NodeMCU. I can’t compile your sketch. This error message like that:

    wifi:144:1: error: stray ‘\302’ in program

    can you help me to fix it?
    thank you Rui Santos

    • Hi.
      I’ve never faced that error, but after a quick search, it seems you have a weird character hidden in your code.
      I think the answer is on the following link:
      arduino.stackexchange.com/questions/30581/stray-302-in-program-error-when-compiling
      Let us know if that solved your problem.
      Regards,
      Sara 🙂

  36. Hi Rui. i had problems with the uploading but is now fixed. my problem now is another one. i get stuck on the “newclient” and i can´t access the web server…. any ideas??? thanks.

  37. I am using Node MCU board. facing issues for uploading code. Its coming error as follows:
    Please provide me solution

    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_upload_mem failed
    error: espcomm_upload_mem failed

    • Hi.
      It can be one of the following problems:
      – The ESP8266 is not in flashing mode.To enable ESP8266 firmware flashing GPIO0 pin must be pulled low before the device is reset. For a normal boot, GPIO0 must be pulled high or floating.
      – It is not properly connected to the serial adapter (if you’re using an ESP8266). Double check the connections and the pinout.
      – You’re not providing enough power. For example if you’re using an ESP-01, using 3.3V from an Arduino might not provide enough current. Use an external power supply.
      – You’re not using a USB cable with data wires (many usb cables from chargers don’t have data wires).
      I hope this helps.
      Regards,
      Sara

  38. I purchased two identical ESP8266MOD based dev boards. I couldn’t do much with them so I flashed them with the default firmware in NodeMCU Flasher. They both worked fine. Then I UpLoaded an Arduino program to one of them. That worked fine. Then I flashed both of them with a custom built firmware from GitHub. The one that had the Arduino program just loops the intro screen when I reset it. The other one still works fine, and has had two other custom firmwares flashed into it since then. The only way to make the ‘bad’ one work is to re-flash it with the default NodeMCU FW that doesn’t have floating point math, and several other useful modules.
    Here are the boot screens I get:
    ====================================================
    -=-=-= Output from NodeMCU _default_ FirmWare =-=-=-

    PORT OPEN 74880

    ets Jan 8 2013,rst cause:2, boot mode:(3,6)

    load 0x40100000, len 28740, room 16
    tail 4
    chksum 0xcd
    load 0x3ffe8000, len 2888, room 4
    tail 4
    chksum 0xbc
    load 0x3ffe8b50, len 15252, room 4
    tail 0
    chksum 0x4f
    csum 0x4f

    ====================================================
    Output from NodeMCU _custom_ FirmWare that does NOT work.

    PORT OPEN 74880

    ets Jan 8 2013,rst cause:2, boot mode:(3,7)

    load 0x40100000, len 28652, room 16
    tail 12
    chksum 0x03
    ho 0 tail 12 room 4
    load 0x3ffe8000, len 2364, room 12
    tail 0
    chksum 0x66
    load 0x3ffe893c, len 136, room 8
    tail 0
    chksum 0xfb
    csum 0xfb
    rf_cal[0] !=0x05,is 0x00

    ets Jan 8 2013,rst cause:2, boot mode:(3,7)

    load 0x40100000, len 28652, room 16
    tail 12
    chksum 0x03
    ho 0 tail 12 room 4
    load 0x3ffe8000, len 2364, room 12
    tail 0
    chksum 0x66
    load 0x3ffe893c, len 136, room 8
    tail 0
    chksum 0xfb
    csum 0xfb
    rf_cal[0] !=0x05,is 0x00

    ets Jan 8 2013,rst cause:2, boot mode:(3,7)

    It just repeats over and over.

    ===================================================
    Output from NodeMCU _custom_ FirmWare that does work on other ESP8266MOD.

    PORT OPEN 74880

    ets Jan 8 2013,rst cause:2, boot mode:(3,7)

    load 0x40100000, len 28652, room 16
    tail 12
    chksum 0x03
    ho 0 tail 12 room 4
    load 0x3ffe8000, len 2364, room 12
    tail 0
    chksum 0x66
    load 0x3ffe893c, len 136, room 8
    tail 0
    chksum 0xfb
    csum 0xfb
    rf cal sector: 1019
    freq trace enable 0
    rf[112] : 00
    rf[113] : 00
    rf[114] : 01

    SDK ver: 2.2.1(6ab97e9) compiled @ Jun 7 2018 13:59:14
    phy ver: 1136_0, pp ver: 10.2

    ===================================================
    It looks like the rf_calibration is the problem, But I don’t know how to fix it.
    T.I.A.
    Stephen

    • Hi Stephen.
      What code are you running on your “bad” ESP8266? It may be a code that crashes the ESP8266 and it keeps resetting.
      You can also have some sort of hardware problem. It’s often related to one of the following issues:
      Poor quality USB cable;
      USB cable is too long;
      Board with some defect (bad solder joints);
      Bad computer USB port;
      Or not enough power provided by the computer USB port.
      If it is an hardware problem, I advise you to try a different shorter USB cable (with data wires), try a different computer USB port or use a USB hub with an external power supply.
      I hope this helps.
      Regards,
      Sara

  39. i followed instructions for the webserver and sensor(one im using is am2301) and the flashed sonoff th16 (esp8266) device . it is saying sensor reading failed, any thoughts?

    • Hi.
      It can be:
      – not enough power
      – you’re not giving enough time for the sensor to take readings (make sure you have a delay between sensor readings)
      – wires not properly connected

  40. Hey there Rui!
    I have a LoLin v3 Node MCU Dev Board.
    The blue light doesn’t flash/blink anymore on connection to power source or during flashing.
    So I have no indication whether the board is working or not.

    I tried connecting the D4 pin (built-in blue LED) to GND and it glows constantly.

    Other than that, nothing seems to work.
    I can’t flash the board, the process doesn’t start, always waiting for MAC; I’ve tried connecting the pins to GND as well.

    Please help me out.

  41. This is the error I get on the Arduino IDE when I try to upload any code. I can’t seem to upload any code.

    Arduino: 1.8.5 (Windows 10), Board: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200”

    Build options changed, rebuilding all
    Archiving built core (caching) in: C:\Users\MUKUL\AppData\Local\Temp\arduino_cache_549157\core\core_esp8266_esp8266_nodemcuv2_xtal_80,vt_flash,exception_disabled,ssl_all,eesz_4M,ip_lm2f,dbg_Disabled,lvl_None__,wipe_none,baud_115200_65e50a5fad0627179c7c4d2e008fc25d.a
    Sketch uses 257716 bytes (24%) of program storage space. Maximum is 1044464 bytes.
    Global variables use 26576 bytes (32%) of dynamic memory, leaving 55344 bytes for local variables. Maximum is 81920 bytes.
    esptool.py v2.6
    2.6
    esptool.py v2.6
    Serial port COM10
    Connecting……..__….._….._….._….._….._…..___Traceback (most recent call last):
    File “C:\Users\MUKUL\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.1/tools/upload.py”, line 25, in
    esptool.main(fakeargs)
    File “C:/Users/MUKUL/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py”, line 2653, in main
    esp.connect(args.before)
    File “C:/Users/MUKUL/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py”, line 468, in connect
    raise FatalError(‘Failed to connect to %s: %s’ % (self.CHIP_NAME, last_error))
    esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
    _
    the selected serial port _
    does not exist or your board is not connected

Leave a Comment

Download our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.