I have a NodeMCU and I struggled for a long while getting "espcomm_sync failed" but I found that I should hold the flash button, then reset, then release flash, and it seems to have made it accept my uploads.
However, the sketch doesn't seem to run. All I have is the NodeMCU connected via USB. When I press upload, the "writing flash" shows for a long time, and the LED blinks for maybe 20 seconds, but then when it's ready, nothing blinks.
I'm using the Arduino IDE, but I tried using Deviot too, but I still get the "espcomm_sync failed" in there.
The brand of the NodeMCU is Hysiry, looks a little bit larger than AI-Thinker which seems to be the more common one. Not sure if it's broken or something.
Here's my sketch and build output:
Blink.ino
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Build output
Build options changed, rebuilding all
Archiving built core (caching) in: /var/folders/48/59_lz30x1sz9qdxt5db0qj4c0000gn/T/arduino_cache_409699/core/core_esp8266_esp8266_generic_CpuFrequency_80,FlashFreq_40,FlashMode_dio,UploadSpeed_115200,FlashSize_512K64,ResetMethod_nodemcu,Debug_Disabled,DebugLevel_None_____1484efb33042dc08697d88ee21bc3886.a
Sketch uses 219443 bytes (50%) of program storage space. Maximum is 434160 bytes.
Global variables use 31136 bytes (38%) of dynamic memory, leaving 50784 bytes for local variables. Maximum is 81920 bytes.
/Users/niclas/Library/Arduino15/packages/esp8266/tools/esptool/0.4.8/esptool -vv -cd nodemcu -cb 115200 -cp /dev/cu.wchusbserial1460 -ca 0x00000 -cf /var/folders/48/59_lz30x1sz9qdxt5db0qj4c0000gn/T/arduino_build_694141/Blink.ino.bin
esptool v0.4.8 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 115200
setting port from /dev/tty.usbserial to /dev/cu.wchusbserial1460
setting address from 0x00000000 to 0x00000000
espcomm_upload_file
espcomm_upload_mem
opening port /dev/cu.wchusbserial1460 at 115200
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
setting character timeout 0
done
setting character timeout 1
done
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
setting character timeout 0
done
setting character timeout 1
done
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
Uploading 223584 bytes from to flash at 0x00000000
erasing flash
size: 036960 address: 000000
first_sector_index: 0
total_sector_count: 55
head_sector_count: 16
adjusted_sector_count: 39
erase_size: 027000
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
setting timeout 15000
setting character timeout 150
done
setting timeout 1
setting character timeout 1
done
espcomm_send_command: receiving 2 bytes of data
writing flash
...
starting app without reboot
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
closing bootloader
I appreciate any ideas to get it working! ![]()