Error while compiling nodemcu ESP8266 board

0

I have tried to upload a simple code onto my esp8266 board and I undergo this error :

esptool.py v2.8 Serial port /dev/ttyUSB0 Connecting.... Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: 2c:3a:e8:01:1d:3e Uploading stub... Running stub... Stub running... Configuring flash size... Auto-detected Flash size: 4MB Compressed 267168 bytes to 196959... Writing at 0x00000000... (7 %)Traceback (most recent call last): File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/upload.py", line 65, in esptool.main(cmdline) File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 2938, in main operation_func(esp, args) File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 2374, in write_flash esp.flash_defl_block(block, seq, timeout=DEFAULT_TIMEOUT * ratio * 2) File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 104, in inner return func(*args, **kwargs) File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 672, in flash_defl_block self.ESP_FLASH_DEFL_DATA, struct.pack('<IIII', len(data), seq, 0, 0) + data, self.checksum(data), timeout=timeout) File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 369, in check_command val, data = self.command(op, data, chk, timeout=timeout) File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 337, in command self.write(pkt) File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 300, in write self._port.write(buf) File "/home/tarun/snap/arduino/56/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/serialposix.py", line 552, 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 is the error I undergo. I have checked twice for the port and the baud rate(115200). Kindly help me solve this problem!!

arduino-esp8266
asked on Stack Overflow May 2, 2021 by Tarun-sketch

1 Answer

0

It depends of your board how you can flash it. Here https://www.letscontrolit.com/wiki/index.php/Basics:_Connecting_and_flashing_the_ESP8266 is a very detailed guide about how to flash.

Especially the Section "Some basics about flashing" could solve your problem https://www.letscontrolit.com/wiki/index.php/Basics:_Connecting_and_flashing_the_ESP8266#Some_basics_about_flashing

The ESP has four inputs that manage the startup behaviour. These setting are necessary to flash the chip!

The GPIO15 pin should always be set to "low". Use a 10KOhm resistor between GPIO15 and ground.

GPIO2 should be pulled to "high". Use a 10KOhm resistor between GPIO2 and 3.3V (Vcc).

The GPIO0 setting now decides between run mode and flash mode. Connect a 10 KOhm resistor between 3.3V (Vcc) and GPIO0. This sets the ESP8266 into run mode.

Now you may connect the GPIO0 directly to ground for flashing.

The fourth is the "reset" pin. It should be on "high", so put a 10 KOhm resistor between Vcc and reset pin.

For all ESP's besides nodeMCU and WeMOS there is a "CH-PG" pin. It's an "enable" pin you may use to switch off the whole ESP-Chip. Put a 10KOhm resistor between CH_PG and Vcc to keep the ESP running at all.

Devices with an embedded ESP-Chip (Sonoff basic or 4ch for example) will have these resistors on board. Just GPIO0 has to be set to ground with a jumper bridge or via a pushbutton.

answered on Stack Overflow May 2, 2021 by Hannes

User contributions licensed under CC BY-SA 3.0