Are you getting the following errors:
- warning: espcomm_sync failed
- error: espcomm_open failed
- error: espcomm_upload_mem failed
Then here’s 10 ways you can try to fix them!
- Update your Arduino IDE
Make sure you have the latest version. Also, keep your libraries in My Documents or else they will get lost during the update as you have to first uninstall the Arduino IDE.
- Switch boards in the Arduino IDE
Try the NodeMCU 1.0, 0.9 or a Generic ESP8266.
- Change the upload speed
Sometimes the speed might be too fast. Try 9600 and see if that fixes it. Tools -> Upload Speed.
- Using a different USB cable
Maybe the cable is damaged? Make sure the new one is in working order!
- Uploading from a different USB port
Some usb ports coming from the PC might be damaged, or in my case – didn’t deliver enough power for some reason. 3 of my USB ports (2 of which are frontal) couldn’t power the Node properly and I couldn’t get my code on the board until I switched the usb port.
- Try disabling USB power saving from your PC’s power options
There might also be drivers that try to reduce USB power, make sure you disable those.
- Reinstalling drivers
Something may have gone wrong during your last session. Make sure you try this one as it’s an easy fix.
- Uploading from a different PC
There might be drivers, not related to the NodeMCU, that interrupt its work.
- Using the esptool.exe to upload to it from the cmd prompt
Here’s a link, make sure you read the readme – ESPTOOL
- Getting a new board
If everything else fails, think about getting a new board, your current one might be defective.