nodemcu / nodemcu-devkit-v1.0

MIT License
1.36k stars 383 forks source link

Impossible to flash/communicate #14

Open RataDP opened 8 years ago

RataDP commented 8 years ago

I'm having troubles to flash or connect my devkit v1. It arrived my home 2 days ago and I was not able to flash it or at least communicate with it.

I'm going to describe my case. I connect my devkit v1 via USB to microUSB with the CP2102 USBtoUARP, then the blue led of the ESP8266 blinks twice and stop. After this I can see the SSID "AI_THINKER_DA7E19" and connect to it, I got a 192.168.4.2 and the device .1. It answers to the ping but there is not webserver. Now I try to flash it, first I tried with Linux and ESPTool,

# python2 esptool.py --port /dev/ttyUSB0 write_flash 0x00000 firmware.bin
Connecting...

A fatal error occurred: Failed to connect to ESP8266

Well I read somewhere it could be a bug with ESPtool with high values of baudrate, so I tried with --baud 9600 but the same output also with different baudrates. Meanwhile the program is in the state connecting..., the blue led blinks. I tried to reset with the Flash button pressed and the same result, nothing change. Also I tried wiring the GPIO0 to GND but still the same error.

Now it is the turn for Windows, I tried with the nodemcu-flasher, the driver was correctly install and the port is assigned correctly too. Select the COM port and set the baudrate to 9600 and flash. The log says Begin to find ESP8266 enters in a loop and the blue led blinks every 1/2 seconds. Just to point it out, in the tab operation not appears any mac, it says "Waiting...". Just like before I changed the Baudrate and I tried all of them but nothing happens. (I also press flash and reset like before but nothing)

Screenshot0

After all this troubles I tried to communicate with the devkit via Serial port with putty and Screen. The connection seems to be established but nothing appears in it. Pressing RST it should write something... garbage or some characters but nothing.

I don't know if I'm doing something wrong or the devkit it's broken. Some solution or tip?

Thank you

PD: I posted it in the old devkit repository, now it is in the correct repository.

EDIT: @mrmonteith answered in the other repository.

I'm trying to remember when I first tried this. I think I used the flasher tool. You start the attempt at transfer, hold down the reset and flasher button, release the flasher button and then about a half second or so after release the reset. I don't have my device in front of me to check. Of course I only had to do it one time and I've had mine for about month. Hope it helps anyway. 

I tried too, but no works it.

prob1995 commented 8 years ago

Same issue here... Still can't flash the firmware...

Update: I suggest you to try a new nodemcu. Those annoying errors has gone when I use a new one.

The RX on your nodemcu may broke:

  1. I can receive some messages from nodemcu, such like "Please run file.remove("user.lua") before first use." but doesn't reply me anything when I try to send command, for example: file.remove("user.lua") Maybe RX issue
  2. It always stuck on "Waiting MAC" when I try to flash firmware using firmware flasher. Maybe RX issue
  3. "A fatal error occurred: Failed to connect to ESP8266" when I try to use esptool flashing firmware Maybe RX issue
gbhat618 commented 7 years ago

change the USB cable.. had the same issue, resolved after changing the cable.

KOKONUTCREMEOG commented 7 years ago

And here same issue. I operate PC Windows 10, And Android...,.But it's waiting for mac

ChrisHeerschap commented 7 years ago

Found this page when dealing with the same problem. Swapped out USB cables to no avail. A little bit more searching and I found this which wound up fixing it for me - maybe it might be helpful to others:

http://kig.re/2014/12/31/how-to-use-arduino-nano-mini-pro-with-CH340G-on-mac-osx-yosemite.html

ShakataGaNai commented 6 years ago

I realize this is a year later so unlikely someone still working on it... but in my case for a different board I had this same problem with RST/D0 were connected for deep sleep.

JayPalm commented 6 years ago

Hey, did you ever figure this one out? I'm having pretty much the same issue on a Mac with a nodeMCU Amica board (uses a CP102 USB-UART bridge, installed the SiLab driver, etc). I have tried multiple baud rates but always get the same response: A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header.

I have tried multiple USB cables and multiple NodeMCUs to no avail. Really bummed right now...

ChrisHeerschap commented 6 years ago

@JayPalm did you try the link I listed in my last comment?

Parin810 commented 6 years ago

Facing the same issue.. Anyone found the cause of the problem? or a solution that worked..

mrmonteith commented 6 years ago

Any luck yet? I had a couple of thoughts. Mostly around possibly weak components. Do you have any sort of oscilloscope? I bought a Hantek digital one that connects to the computer and does fairly good. That would go a long ways to checking things like power supply voltages and noise on the lines. But without you can still probably locate the issue. A couple of things you can try. That is put a capacitor between 3v3 and Gnd as an extra filter. USB interfaces are notoriously noisy. There is also an Espressif forum for issues with the ESP8266 and ESP32 devices. You might post there too.

VinayKadalagi commented 5 years ago

Just reconnect the usb cable keeping the flasher open Look for log for below line ->

Note:Detect serial port changed. Note:Auto MAP serial port.Port-->COM5

Then you should be able to flash. Looks like the tool cannot detect already connected device.

ersyncar commented 5 years ago

i had same issue. i change usb cable and tried different values for advanced setting on Nodemcu. and it worked by -Baudrate 9600, -flash size 4Mbyte, -flash speed 26.7mhz, -spi mode DIO

cnnrde commented 5 years ago

Try holding down the GPIO/reset button on your MCU, and then flash whilst still holding down. This worked for me.

Joshverge commented 5 years ago

Same issue. Won't flash

Joshverge commented 5 years ago

Just reconnect the usb cable keeping the flasher open Look for log for below line ->

Note:Detect serial port changed. Note:Auto MAP serial port.Port-->COM5

Then you should be able to flash. Looks like the tool cannot detect already connected device.

Just reconnect the usb cable keeping the flasher open Look for log for below line ->

Note:Detect serial port changed. Note:Auto MAP serial port.Port-->COM5

Then you should be able to flash. Looks like the tool cannot detect already connected device.

That's not the issue, it's able to detect the right com port right from the start

ersyncar commented 5 years ago

That's not the issue, it's able to detect the right com port right from the start

did you try by another usb cable. i had same issue and changed the cable. i tried by my printers cable and it worked :)

and i attached the picture of working settings on my ESP8266 -ESP 01

arduino connections nodemcu

Joshverge commented 5 years ago

Okay I resolved this for me. You just need to hold down the flash button (on the board) until you see the status bar moving forward after pressing flash

horodchukanton commented 4 years ago

Mine was fixed by putting the board to an oven for two minutes. Looks like a weak components issue

Blazer9419 commented 1 year ago

I am also having the same issue. It says “waiting mac” however my FTDI and ESP is flashing red and the ESP was also flashing blue for a couple seconds then stopped. Is there anything I am doing wrong here? 99D870D2-D4B2-4201-9E3B-251BE703811E BB4A4BF0-F4D3-4CF5-A17C-3AF7895D4456

TSRider85 commented 10 months ago

I had the same problem but i solved it, it was my usb port. Looks like it the current of that one was to low. So try a different usb port!