Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "SerialTimeoutException: Write timeout" error with NodeMCU and arduino ide

I was trying to build a simple IoT product using a nodemcu, an LED, and the blynk app. This is the most basic thing you can do with a nodemcu. However, when I was uploading the example from the Blynk library, I was getting this error.

It seems to be a port error but I still can't comprehend any of it.

The error messages are as follows:

Arduino: 1.8.9 (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"

Sketch uses 279792 bytes (26%) of program storage space. Maximum is 1044464 bytes.
Global variables use 28848 bytes (35%) of dynamic memory, leaving 53072 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.6
2.6
esptool.py v2.6
Serial port COM3
Connecting...
Traceback (most recent call last):
  File "C:\Users\saumi\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.1/tools/upload.py", line 25, in <module>
    esptool.main(fakeargs)
  File "C:/Users/saumi/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/saumi/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py", line 460, in connect
    last_error = self._connect_attempt(mode=mode, esp32r0_delay=False)
  File "C:/Users/saumi/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py", line 440, in _connect_attempt
    self.sync()
  File "C:/Users/saumi/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py", line 379, in sync
    timeout=SYNC_TIMEOUT)
  File "C:/Users/saumi/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py", line 322, in command
    self.write(pkt)
  File "C:/Users/saumi/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py", line 285, in write
    self._port.write(buf)
  File "C:/Users/saumi/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/pyserial\serial\serialwin32.py", line 323, in write
    raise writeTimeoutError
serial.serialutil.SerialTimeoutException: Write timeout
The selected serial port serial.serialutil.SerialTimeoutException: Write timeout does not exist or your board is not connected

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
like image 897
Saumit Paul Avatar asked May 18 '19 08:05

Saumit Paul


3 Answers

Change your Upload speed from 115200 to 9600! I did this, and it worked fine

like image 133
Sina Mirshafiei Avatar answered Oct 06 '22 17:10

Sina Mirshafiei


Changing the USB cable worked for me!!!

like image 27
Venkat Papana Avatar answered Oct 06 '22 18:10

Venkat Papana


The boards will program the first time, but after that you get a range of errors. Reading up on the ESP8266 I found that GPIO0 pin is used for a range of things and to re-program the chip you need to get into program mode. To do this remove power, then ground GPIO0 pin, then power up the board again, remove the gnd from GPIO0 pin and the IDE will download again. So you need to get the MCU into flash mode.

Better still, remove power from the board. Press and hold the flash button, power up the nodeMCU and then it will download again from the IDE.

like image 28
Jedak22 Avatar answered Oct 06 '22 16:10

Jedak22