Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esptool.FatalError: Timed out waiting for packet header #407

Closed
sunbearc22 opened this issue Feb 11, 2019 · 22 comments
Closed

esptool.FatalError: Timed out waiting for packet header #407

sunbearc22 opened this issue Feb 11, 2019 · 22 comments

Comments

@sunbearc22
Copy link

I encountered this issue esptool.FatalError: Timed out waiting for packet header while using the get_chip_description() method from the class esptool.ESP32ROM.

Traceback (most recent call last):
  File "~/project/test.py", line 217, in _detect_esp_progress_update_v1
    chip_type = self.esp.get_chip_description()
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 1095, in get_chip_description
    word3 = self.read_efuse(3)
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 1159, in read_efuse
    return self.read_reg(self.EFUSE_REG_BASE + (4 * n))
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 477, in read_reg
    val, data = self.command(self.ESP_READ_REG, struct.pack('<I', addr))
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 334, in command
    p = self.read()
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 279, in read
    return next(self._slip_reader)
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 1888, in slip_reader
    raise FatalError("Timed out waiting for packet %s" % waiting_for)
esptool.FatalError: Timed out waiting for packet header

The strange part of this issue is that the same device is detectable via terminal command (see below). I have tested my code with the get_chip_description() method. It is able to get the description for another similar device. But it constantly fails to work on the same device. How can I overcome this issue?

$ esptool.py --chip esp32 --port /dev/ttyUSB2 flash_id
esptool.py v2.6
Serial port /dev/ttyUSB2
Connecting.....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: xx:xx:xx:xx:xx:xx
Uploading stub...
Running stub...
Stub running...
Manufacturer: ef
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
@sunbearc22
Copy link
Author

Below is a section of my code. After introducing the line self.esp.connect() there, my code worked. Why is this the case? Why is .connect() needed before running .get_chip_description()?

        try:
            self.esp = esptool.ESP32ROM( self.port.get(), self.baud.get(),  )
            self.esp.connect()  #I added this line
        except (esptool.FatalError, OSError) as err:
            self.esp = None
            self.detecting = False
            raise
            print( "{} failed to connect to a Espressif device: {}".format( port, err ) )
        else:
            print( 'self.esp = ', self.esp.__dict__ )
            self.detecting = False
            self.status.set( 'Detected' )

@sunbearc22
Copy link
Author

I also encountered the same Timeout fatal error during the .slip_reader() function when the .write_flash() function is executed. May I know what is causing the Timeout error and how to overcome it? Below is a printout from the .write_flash() function prior to the error.

args.compress =  True

Verify file sizes fit in flash

flash_end = <class 'int'> 4194304
address = <class 'int'> 4096
argfile.tell() = <class 'int'> 1087456

write_flash main loop
Erasing flash...

def pad_to(data, alignment, pad_character=b'ÿ'):
len(data) =  1087456
pad_mod =  0
##Completed pad_to

def _update_image_flash_params(esp, address, args, image):
magic=233, flash_mode=2, flash_size_freq=32
esp.BOOTLOADER_FLASH_OFFSET=4096, address=4096
esp.ESP_IMAGE_MAGIC =  233
flash_mode =  0
flash_freq =  0
flash_size =  32
flash_size =  32
Flash params set to 0x0020
uncsize =  1087456

###Download file to flash Get ratio & block
parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)
compress is True
esp.FLASH_WRITE_SIZE =  1024
esp.IS_STUB =  False
ratio =  1.5819658776156227
num_blocks =  672
erase_blocks =  1062
write_size =  1087488
timeout =  32.62464
Compressed 1087456 bytes to 687408...
Exception in Tkinter callback
 (most recent call last):
  File "~/.pyenv/versions/3.6.7/lib/python3.6/tkinter/__init__.py", line 1705, in __call__
    return self.func(*args)
  File "~/project/test.py", line 451, in _write_flash
    blocks = esp.flash_defl_begin(uncsize, len(image), address)
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 104, in inner
    return func(*args, **kwargs)
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 630, in flash_defl_begin
    timeout=timeout)
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 356, in check_command
    val, data = self.command(op, data, chk, timeout=timeout)
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 334, in command
    p = self.read()
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 279, in read
    return next(self._slip_reader)
  File "~/.local/share/virtualenvs/Esp32-zoIgntnu/bin/esptool.py", line 1890, in slip_reader
    raise FatalError("Timed out waiting for packet %s" % waiting_for)
esptool.FatalError: Timed out waiting for packet header

@projectgus
Copy link
Contributor

Why is this the case? Why is .connect() needed before running .get_chip_description()?

connect() is required because this is the function which actually resets the chip into the bootloader mode and establishes bootloader communications.

A shortcoming of the Python API (to add to notes in in #208) is that the class itself doesn't track the connection state, so there's no software-side indication that it won't respond to the caller at all.

(Although I suppose in some cases it may be desirable to do this from code, for example if you know for a fact that some other piece of code has established bootloader mode already, and you just need to pass control a new ESPLoader new object instance.)

I also encountered the same Timeout fatal error during the .slip_reader() function when the .write_flash() function is executed. May I know what is causing the Timeout error and how to overcome it?

Without seeing that code that you're calling to make this printout I really can't tell anything.

@sunbearc22
Copy link
Author

sunbearc22 commented Feb 12, 2019

@projectgus I have just uploaded my code here. Appreciate your advice on what is causing the timeout fatal error.

Summarising my issue, I was running esptool.py write_flash() method and encountered the fatal Timeout error. To understand the matter, I replicated the write_flash and a few other relevant esptooly.py functions to my script (see lines 403 to 566) to understand the issue. I traced the issue to originate from line 455. According to python's Exception msgs, the matter is traced to the slip_reader() method.

@sunbearc22
Copy link
Author

sunbearc22 commented Feb 12, 2019

@projectgus May i know the meaning of the following byte value: b'\xc0', b'\xdb', b'\xdc', b'\xdd' used in slip_read() function?? Where is the documentation describing these byte values?

>>> int.from_bytes(b'\xc0', byteorder='little')
192
>>> int.from_bytes(b'\xdb', byteorder='little')
219
>>> int.from_bytes(b'\xdc', byteorder='little')
220
>>> int.from_bytes(b'\xdd', byteorder='little')
221

Update:
I found 2 definitions but could not make out the other 2:
b'\xc0' rep end of packet.
b'\xdb' rep start of escape sequence.
b'\xdc' rep in_escape ???
b'\xdd' rep in_escape ???

@projectgus
Copy link
Contributor

@sunbearc22 SLIP is https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol

  • \xc0 is the packet delimiter.
  • \xdb\xdc is how you represent a literal \xc0 in the stream
  • \xdb\xdd is how you represent a literal \xdb in the stream
  • all other bytes are represented as themselves in the stream

The slip_reader() function is a Python generator that tries to read a full SLIP packet from the input serial stream, decode it, and then yield it to the caller.

As a next step, I suggest you try to enable the equivalent of the --trace option in your code and look for differences in the serial traffic between esptool.py --trace --no-stub write_flash ... and what your code is doing.

@sunbearc22
Copy link
Author

sunbearc22 commented Feb 13, 2019

@projectgus After activating the equivalent of --no-stub in my code, i.e. by setting self.args.no_stub = False in WriteFlash() object, and running esptool.ESPLoader.run_stub() before calling the esptool.write_flash(), the fatal timeout error disappeared and my code was able to write to flash.

However, when access the device via $ picocom /dev/ttyUSB0 -b 115200, I end up seeing an endless trial of the same data (see below). In short, I am able to write to flash now but the writing seem erroneous. Can you tell me what is causing these 1162 mmu set 00010000, pos 00010000? Thanks. I have uploaded my revised code for your consideration. .

$ picocom /dev/ttyUSB0 -b 115200
picocom v1.7

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

Terminal ready
�0x00,hd_drv:0x00,wp_drv:0x00
mode:QIO, clock div:2
load:0x3fff0018,len:4
load:0xcdc72100,len:687535457
1162 mmu set 00010000, pos 00010000
1162 mmu set 00020000, pos 00020000
1162 mmu set 00030000, pos 00030000
1162 mmu set 00040000, pos 00040000
1162 mmu set 00050000, pos 00050000
1162 mmu set 00060000, pos 00060000
1162 mmu set 00070000, pos 00070000
1162 mmu set 00080000, pos 00080000
1162 mmu set 00090000, pos 00090000
1162 mmu set 000a0000, pos 000a0000
1162 mmu set 000b0000, pos 000b0000
1162 mmu set 000c0000, pos 000c0000
1162 mmu set 000d0000, pos 000d0000
1162 mmu set 000e0000, pos 000e0000
1162 mmu set 000f0000, pos 000f0000
1162 mmu set 00100000, pos 00100000
1162 mmu set 00110000, pos 00110000
1162 mmu set 00120000, pos 00120000
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:QIO, clock div:2
load:0x3fff0018,len:4
load:0xcdc72100,len:687535457
1162 mmu set 00010000, pos 00010000
1162 mmu set 00020000, pos 00020000
1162 mmu set 00030000, pos 00030000
1162 mmu set 00040000, pos 00040000
1162 mmu set 00050000, pos 00050000
1162 mmu set 00060000, pos 00060000
1162 mmu set 00070000, pos 00070000
1162 mmu set 00080000, pos 00080000
1162 mmu set 00090000, pos 00090000
1162 mmu set 000a0000, pos 000a0000
1162 mmu set 000b0000, pos 000b0000
1162 mmu set 000c0000, pos 000c0000
1162 mmu set 000d0000, pos 000d0000
1162 mmu set 000e0000, pos 000e0000
1162 mmu set 000f0000, pos 000f0000
1162 mmu set 00100000, pos 00100000
1162 mmu set 00110000, pos 00110000
1162 mmu set 00120000, pos 00120000
ets Jun  8 2016 00:22:57
.
.
.

@projectgus
Copy link
Contributor

Hi @sunbearc22 ,

Glad you sorted out the code.

Flashing the bootloader image with the QIO flash mode set doesn't work, they need to be flashed in DIO mode.

The clue is here:

mode:QIO, clock div:2
load:0x3fff0018,len:4
load:0xcdc72100,len:687535457
1162 mmu set 00010000, pos 00010000

The second load address and length are garbage, because of QIO mode.

A general guide to the messages printed by the bootloader during a (normal) boot can be found here: https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection#later-boot-messages

@sunbearc22
Copy link
Author

sunbearc22 commented Feb 21, 2019

@projectgus Thank you. Flashing in DIO mode worked.

Questions:

  1. According to wiki on Serial Protocol:

    By default, esptool.py uploads a stub "software loader" to the IRAM of the chip. The software loader then replaces the ROM loader for all future interactions. This standardizes much of the behaviour.

    This occurs because args.no_stub=False by default.
    When writing to flash, can args.no_stub=True be used instead? When should one use args.no_stub=True?

  2. What does b'\x07\x07\x12\x20' + 32 * b'\x55' do in the .syn() method?

  3. In Wiki's explanation on Initial Synchronization, it writes:

    The ESP chip is reset into UART bootloader mode. The host starts by sending SYNC commands. These commands have a large data payload which is also used by the ESP chip to detect the configured baud rate. The ESP8266 will initialise at 74800bps with a 26MHz crystal and 115200bps with a 40MHz crystal, and ESP32 always initialises at 115200bps. However the sync packets can be sent at any baud rate, and the UART peripheral will detect this.

    • Am I correct to say that "The ESP chip is reset into UART bootloader mode." is achieved during ._connect_attempt() method via Line 418 to 434? Is the UART bootloader the same as the ROM bootloader mention in the quote in question 1? If not, then can you explain what is "UART bootloader mode"?
    • Am I correct to say that the rest of the above quote describes what the .syn() method do?

    esptool.py then (by default) uses the "RAM Download" sequence to upload software stub loader code to IRAM of the chip. The MEM_END command contains the entry-point address to run the software loader. The software loader then sends a custom SLIP packet of the sequence OHAI (0xC0 0x4F 0x48 0x41 0x49 0xC0), indicating that it is now running. This is the only unsolicited packet ever sent by the ESP. If the --no-stub argument is supplied to esptool.py, this entire step is skipped.

  4. I am confuse with which device does the input and output in lines 438 and 439 refer to. Can you help clarify? Does input refers to the ESP32 device UART buffer and output refers to the computer(i.e. host) UART buffer? Or is it the other way round?

@projectgus
Copy link
Contributor

  1. This occurs because args.no_stub=False by default.
    When writing to flash, can args.no_stub=True be used instead? When should one use > args.no_stub=True?

There are some operations which are only supported by the stub loader. But you can write flash with or without using the stub loader. The stub loader is faster, though.

  • What does b'\x07\x07\x12\x20' + 32 * b'\x55' do in the .syn() method?

I'm actually not sure what the first 4 bytes signify, I think the chip will echo them back (although I think esptool doesn't actually check what gets echoed back).

The 0x55s are useful for auto-bauding (the sync packets are dual purpose: the ROM in the chip will use the chip UART auto-baud feature to sync with whatever the incoming baud rate is, and then after this happens it will try to receive a sync packet). 0x55 is close to a square wave in terms of alternating bits.

  • Am I correct to say that "The ESP chip is reset into UART bootloader mode." is achieved during ._connect_attempt() method via Line 418 to 434?

Yes.

Is the UART bootloader the same as the ROM bootloader mention in the quote in question 1? If not, then can you explain what is "UART bootloader mode"?

Yes, this is sloppy terminology. The bootloader mode is implemented in mask ROM and communicates using the UART, so it gets called both things.

  • Am I correct to say that the rest of the above quote describes what the .syn() method do?

Yes.

* Am I correct to say that the above description occurs when [.run_stub() method](https://github.com/espressif/esptool/blob/master/esptool.py#L576) is activated and not during the [.connect() method](https://github.com/espressif/esptool/blob/master/esptool.py#L452)?

Yes.

  • I am confuse with which device does the input and output in lines 438 and 439 refer to. Can you help clarify? Does input refers to the ESP32 device UART buffer and output refers to the computer(i.e. host) UART buffer? Or is it the other way round?

These are from the point of view of the computer's serial interface.

Input = bytes received on serial interface (sent from the ESP32, we hope).

Output = bytes sent on the serial interface (received by the ESP32, we hope).

Hope this helps clarify some things. :)

@sunbearc22
Copy link
Author

sunbearc22 commented Feb 28, 2019

@projectgus Thank you for your advices. Here is the link to the GUI application that I have developed. I have mentioned you in my acknowledgement. Can you try it and share with me your comments? Cheers.

@juan98mg
Copy link

@sunbearc22 Hello, hey friend I figured out the solution. http://arduinoamuete.blogspot.com/2015/12/reiniciar-nodemcu-en-windows.html on this link you can see the solve problem it worked for me, just remember while is started flash you need to press down flash button and keep it down until the program finish. and then your board is gonna work

@juan98mg
Copy link

Hello, hey friend I figured out the solution. http://arduinoamuete.blogspot.com/2015/12/reiniciar-nodemcu-en-windows.html on this link you can see the solve problem it worked for me, just remember while is started flash you need to press down flash button and keep it down until the program finish. and then your board is gonna work

@juan98mg
Copy link

@sunbearc22 read my answer above

@Shahrizanijan7
Copy link

D:\Arduino Apps\Arduino\arduino-builder -dump-prefs -logger=machine -hardware D:\Arduino Apps\Arduino\hardware -hardware C:\Users\Asus\AppData\Local\Arduino15\packages -tools D:\Arduino Apps\Arduino\tools-builder -tools D:\Arduino Apps\Arduino\hardware\tools\avr -tools C:\Users\Asus\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino Apps\Arduino\libraries -libraries C:\Users\Asus\Documents\Arduino\libraries -fqbn=esp8266:esp8266:espresso_lite_v2:xtal=80,vt=flash,exception=disabled,ssl=all,eesz=4M,ResetMethod=ck,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -ide-version=10805 -build-path C:\Users\Asus\AppData\Local\Temp\arduino_build_624871 -warnings=none -build-cache C:\Users\Asus\AppData\Local\Temp\arduino_cache_332387 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9 -prefs=runtime.tools.python.path=C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\python\3.7.2-post1 -prefs=runtime.tools.mkspiffs.path=C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\2.5.0-3-20ed2b9 -verbose D:\Iot_Workshop\Iot_Workshop.ino
D:\Arduino Apps\Arduino\arduino-builder -compile -logger=machine -hardware D:\Arduino Apps\Arduino\hardware -hardware C:\Users\Asus\AppData\Local\Arduino15\packages -tools D:\Arduino Apps\Arduino\tools-builder -tools D:\Arduino Apps\Arduino\hardware\tools\avr -tools C:\Users\Asus\AppData\Local\Arduino15\packages -built-in-libraries D:\Arduino Apps\Arduino\libraries -libraries C:\Users\Asus\Documents\Arduino\libraries -fqbn=esp8266:esp8266:espresso_lite_v2:xtal=80,vt=flash,exception=disabled,ssl=all,eesz=4M,ResetMethod=ck,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -ide-version=10805 -build-path C:\Users\Asus\AppData\Local\Temp\arduino_build_624871 -warnings=none -build-cache C:\Users\Asus\AppData\Local\Temp\arduino_cache_332387 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9 -prefs=runtime.tools.python.path=C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\python\3.7.2-post1 -prefs=runtime.tools.mkspiffs.path=C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\2.5.0-3-20ed2b9 -verbose D:\Iot_Workshop\Iot_Workshop.ino
Using board 'espresso_lite_v2' from platform in folder: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2
Using core 'esp8266' from platform in folder: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2
Detecting libraries used...
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/lwip2/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\Users\Asus\AppData\Local\Temp\arduino_build_624871/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK221=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10805 -DARDUINO_ESP8266_ESPRESSO_LITE_V2 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESPRESSO_LITE_V2" -DFLASHMODE_DIO -DESP8266 "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\variants\espresso_lite_v2" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\sketch\Iot_Workshop.ino.cpp" -o "nul"
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/lwip2/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\Users\Asus\AppData\Local\Temp\arduino_build_624871/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK221=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10805 -DARDUINO_ESP8266_ESPRESSO_LITE_V2 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESPRESSO_LITE_V2" -DFLASHMODE_DIO -DESP8266 "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\variants\espresso_lite_v2" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\sketch\Iot_Workshop.ino.cpp" -o "nul"
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/lwip2/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\Users\Asus\AppData\Local\Temp\arduino_build_624871/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK221=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10805 -DARDUINO_ESP8266_ESPRESSO_LITE_V2 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESPRESSO_LITE_V2" -DFLASHMODE_DIO -DESP8266 "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\variants\espresso_lite_v2" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src" "-IC:\Users\Asus\Documents\Arduino\libraries\blynk-library-master\src" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\sketch\Iot_Workshop.ino.cpp" -o "nul"
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\BearSSLHelpers.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\CertStoreBearSSL.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFi.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFiAP.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFiGeneric.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFiMulti.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFiSTA-WPS.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFiSTA.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFiScan.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiClient.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiClientSecureAxTLS.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiClientSecureBearSSL.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiServer.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiServerSecureAxTLS.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiServerSecureBearSSL.cpp
Using cached library dependencies for file: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiUdp.cpp
Using cached library dependencies for file: C:\Users\Asus\Documents\Arduino\libraries\blynk-library-master\src\utility\BlynkDebug.cpp
Using cached library dependencies for file: C:\Users\Asus\Documents\Arduino\libraries\blynk-library-master\src\utility\BlynkHandlers.cpp
Using cached library dependencies for file: C:\Users\Asus\Documents\Arduino\libraries\blynk-library-master\src\utility\BlynkTimer.cpp
Using cached library dependencies for file: C:\Users\Asus\Documents\Arduino\libraries\blynk-library-master\src\utility\utility.cpp
Generating function prototypes...
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/lwip2/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\Users\Asus\AppData\Local\Temp\arduino_build_624871/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK221=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10805 -DARDUINO_ESP8266_ESPRESSO_LITE_V2 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESPRESSO_LITE_V2" -DFLASHMODE_DIO -DESP8266 "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\variants\espresso_lite_v2" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src" "-IC:\Users\Asus\Documents\Arduino\libraries\blynk-library-master\src" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\sketch\Iot_Workshop.ino.cpp" -o "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\preproc\ctags_target_for_gcc_minus_e.cpp"
"D:\Arduino Apps\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/lwip2/include" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\Users\Asus\AppData\Local\Temp\arduino_build_624871/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK221=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10805 -DARDUINO_ESP8266_ESPRESSO_LITE_V2 -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_ESPRESSO_LITE_V2" -DFLASHMODE_DIO -DESP8266 "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\variants\espresso_lite_v2" "-IC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src" "-IC:\Users\Asus\Documents\Arduino\libraries\blynk-library-master\src" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\sketch\Iot_Workshop.ino.cpp" -o "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\sketch\Iot_Workshop.ino.cpp.o"
Compiling libraries...
Compiling library "ESP8266WiFi"
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\BearSSLHelpers.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\CertStoreBearSSL.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFi.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFiAP.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFiGeneric.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFiMulti.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFiSTA-WPS.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFiSTA.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFiScan.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\WiFiClient.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\WiFiClientSecureAxTLS.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\WiFiClientSecureBearSSL.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\WiFiServer.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\WiFiServerSecureAxTLS.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\WiFiServerSecureBearSSL.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\WiFiUdp.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFi.a
Compiling library "blynk-library-master"
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\blynk-library-master\utility\BlynkDebug.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\blynk-library-master\utility\BlynkHandlers.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\blynk-library-master\utility\BlynkTimer.cpp.o
Using previously compiled file: C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\blynk-library-master\utility\utility.cpp.o
Compiling core...
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\python\3.7.2-post1/python" "C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/signing.py" --mode header --publickey "D:\Iot_Workshop/public.key" --out "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/core/Updater_Signing.h"
Using precompiled core
Linking everything together...
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-gcc" -CC -E -P -DVTABLES_IN_FLASH "C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/local.eagle.app.v6.common.ld"
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-gcc" -fno-exceptions -Wl,-Map "-Wl,C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/Iot_Workshop.ino.map" -g -w -Os -nostdlib -Wl,--no-check-sections -u app_entry -u printf_float -u scanf_float -Wl,-static "-LC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/lib" "-LC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/lib/NONOSDK221" "-LC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/ld" "-LC:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/sdk/libc/xtensa-lx106-elf/lib" "-Teagle.flash.4m.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read -o "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/Iot_Workshop.ino.elf" -Wl,--start-group "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\sketch\Iot_Workshop.ino.cpp.o" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\ESP8266WiFi\ESP8266WiFi.a" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\blynk-library-master\utility\BlynkDebug.cpp.o" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\blynk-library-master\utility\BlynkHandlers.cpp.o" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\blynk-library-master\utility\BlynkTimer.cpp.o" "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871\libraries\blynk-library-master\utility\utility.cpp.o" "C:\Users\Asus\AppData\Local\Temp\arduino_cache_332387\core\core_esp8266_esp8266_espresso_lite_v2_xtal_80,vt_flash,exception_disabled,ssl_all,eesz_4M,ResetMethod_ck,ip_lm2f,dbg_Disabled,lvl_None__,wipe_none,baud_115200_52794491092482462641d96d5fab32b3.a" -lhal -lphy -lpp -lnet80211 -llwip2-536-feat -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc -Wl,--end-group "-LC:\Users\Asus\AppData\Local\Temp\arduino_build_624871"
"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\python\3.7.2-post1/python" "C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/elf2bin.py" --eboot "C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/bootloaders/eboot/eboot.elf" --app "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/Iot_Workshop.ino.elf" --flash_mode dio --flash_freq 40 --flash_size 4M --path "C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin" --out "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/Iot_Workshop.ino.bin"
Creating BIN file "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/Iot_Workshop.ino.bin" using "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/Iot_Workshop.ino.elf"

"C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\tools\python\3.7.2-post1/python" "C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/signing.py" --mode sign --privatekey "D:\Iot_Workshop/private.key" --bin "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/Iot_Workshop.ino.bin" --out "C:\Users\Asus\AppData\Local\Temp\arduino_build_624871/Iot_Workshop.ino.bin.signed"
Multiple libraries were found for "BlynkSimpleEsp8266.h"
Used: C:\Users\Asus\Documents\Arduino\libraries\blynk-library-master
Not used: C:\Users\Asus\Documents\Arduino\libraries\Blynk
Not used: C:\Users\Asus\Documents\Arduino\libraries\Blynk
Not used: C:\Users\Asus\Documents\Arduino\libraries\Blynk
Not used: C:\Users\Asus\Documents\Arduino\libraries\Blynk
Using library ESP8266WiFi at version 1.0 in folder: C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi
Using library blynk-library-master at version 0.6.1 in folder: C:\Users\Asus\Documents\Arduino\libraries\blynk-library-master
Sketch uses 279788 bytes (26%) of program storage space. Maximum is 1044464 bytes.
Global variables use 28844 bytes (35%) of dynamic memory, leaving 53076 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.6
2.6
esptool.py v2.6
Serial port COM6
Connecting......................................_____
Traceback (most recent call last):
File "C:\Users\Asus\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2/tools/upload.py", line 25, in
esptool.main(fakeargs)
File "C:/Users/Asus/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 2653, in main
esp.connect(args.before)
File "C:/Users/Asus/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.2/tools/esptool\esptool.py", line 468, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

@mirospacek
Copy link

At the "esptool.FatalError: Timed out waiting for packet header" error.
Using a J-DEAL® NodeMCU LUA WiFi Module Internet Based on ESP8266 Development Board New Version from amazon.
Hold down the FLASH button while uploading. Release it when done.
Then unplug USB cable. Then plug USB cable back in.
The uploaded program should start running.

@sudarkce
Copy link

#441 (comment). esptool fatal error solved through this method.

@Damiortiz
Copy link

I tried all the things I saw on the Internet. The only solution that worked was this.

Press the flash and RST button at the same time for a few seconds.
Release only the RST button
Without releasing the FLASH button upload the code with NodeMCU version 1.0

I hope someone will use it!

@MNRPATIL
Copy link

esptool.py v2.8
Serial port COM2
Connecting......................................____Traceback (most recent call last):
File "C:\Users\kec\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3/tools/upload.py", line 65, in
esptool.main(cmdline)
File "C:/Users/kec/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 2890, in main
esp.connect(args.before)
File "C:/Users/kec/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 483, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

@mmors01
Copy link

mmors01 commented Feb 27, 2020

Hi! how to solve this problem? thank you :)
I'm using Arduino to program ESP8266 - ESP-01

An error occurred while uploading the sketch
esptool.py v2.8
Serial port COM8
Connecting........
..............................___
Traceback (most recent call last):
File "C:\Users\acer\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3/tools/upload.py", line 65, in
esptool.main(cmdline)
File "C:/Users/acer/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 2890, in main
esp.connect(args.before)
File "C:/Users/acer/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool\esptool.py", line 483, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

@nazanin97
Copy link

Hi, I have this error, how can I fix it?
I'm using Arduino Uno with esp8266-01

Arduino: 1.8.12 (Mac OS X), Board: "Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/nazanin/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/nazanin/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/nazanin/Documents/Arduino/libraries -fqbn=esp8266:esp8266:generic:xtal=80,vt=flash,exception=legacy,ssl=all,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=40,FlashMode=dout,eesz=1M64,led=2,sdk=nonosdk_190703,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -vid-pid=0X2341_0X0043 -ide-version=10812 -build-path /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774 -warnings=none -build-cache /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_cache_186496 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/mkspiffs/2.5.0-4-b40a506 -prefs=runtime.tools.mkspiffs-2.5.0-4-b40a506.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/mkspiffs/2.5.0-4-b40a506 -prefs=runtime.tools.mklittlefs.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/mklittlefs/2.5.0-4-69bd9e6 -prefs=runtime.tools.mklittlefs-2.5.0-4-69bd9e6.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/mklittlefs/2.5.0-4-69bd9e6 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506 -prefs=runtime.tools.xtensa-lx106-elf-gcc-2.5.0-4-b40a506.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506 -prefs=runtime.tools.python3.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1 -verbose /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/nazanin/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/nazanin/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/nazanin/Documents/Arduino/libraries -fqbn=esp8266:esp8266:generic:xtal=80,vt=flash,exception=legacy,ssl=all,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=40,FlashMode=dout,eesz=1M64,led=2,sdk=nonosdk_190703,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -vid-pid=0X2341_0X0043 -ide-version=10812 -build-path /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774 -warnings=none -build-cache /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_cache_186496 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/mkspiffs/2.5.0-4-b40a506 -prefs=runtime.tools.mkspiffs-2.5.0-4-b40a506.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/mkspiffs/2.5.0-4-b40a506 -prefs=runtime.tools.mklittlefs.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/mklittlefs/2.5.0-4-69bd9e6 -prefs=runtime.tools.mklittlefs-2.5.0-4-69bd9e6.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/mklittlefs/2.5.0-4-69bd9e6 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506 -prefs=runtime.tools.xtensa-lx106-elf-gcc-2.5.0-4-b40a506.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506 -prefs=runtime.tools.python3.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1 -verbose /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
Using board 'generic' from platform in folder: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3
Using core 'esp8266' from platform in folder: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3
Detecting libraries used...
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/lwip2/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/include -I/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10812 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD="ESP8266_GENERIC"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/cores/esp8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/variants/generic /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/sketch/WiFiScan.ino.cpp -o /dev/null
Alternatives for ESP8266WiFi.h: [[email protected]]
ResolveLibrary(ESP8266WiFi.h)
-> candidates: [[email protected]]
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/lwip2/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/include -I/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10812 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD="ESP8266_GENERIC"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/cores/esp8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/variants/generic -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/sketch/WiFiScan.ino.cpp -o /dev/null
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/ESP8266WiFiSTA-WPS.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/ESP8266WiFiScan.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/WiFiClient.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/WiFiServer.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/WiFiServerSecureAxTLS.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp
Using cached library dependencies for file: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/WiFiUdp.cpp
Generating function prototypes...
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/lwip2/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/include -I/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -ffunction-sections -fdata-sections -fno-exceptions -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10812 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD="ESP8266_GENERIC"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/cores/esp8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/variants/generic -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/sketch/WiFiScan.ino.cpp -o /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/preproc/ctags_target_for_gcc_minus_e.cpp
/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/signing.py --mode header --publickey /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/examples/WiFiScan/public.key --out /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/core/Updater_Signing.h
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/lwip2/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/include -I/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10812 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD="ESP8266_GENERIC"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/cores/esp8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/variants/generic -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/sketch/WiFiScan.ino.cpp -o /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/sketch/WiFiScan.ino.cpp.o
Compiling libraries...
Compiling library "ESP8266WiFi"
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++ -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/lwip2/include -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/include -I/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/core -c -w -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10812 -DARDUINO_ESP8266_GENERIC -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD="ESP8266_GENERIC"" -DLED_BUILTIN=2 -DFLASHMODE_DOUT -DESP8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/cores/esp8266 -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/variants/generic -I/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp -o /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/BearSSLHelpers.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/CertStoreBearSSL.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiScan.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiClient.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiServer.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiUdp.cpp.o
Using previously compiled file: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/BearSSLHelpers.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/CertStoreBearSSL.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiAP.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFiScan.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiClient.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiServer.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-ar cru /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/WiFiUdp.cpp.o
Compiling core...
Using precompiled core: /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_cache_186496/core/core_61d41a93f4dbfcc5e4ddca493a9e9b0d.a
Linking everything together...
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-gcc -CC -E -P -DVTABLES_IN_FLASH /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/ld/eagle.app.v6.common.ld.h -o /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/local.eagle.app.v6.common.ld
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-gcc -fno-exceptions -Wl,-Map -Wl,/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.map -g -w -Os -nostdlib -Wl,--no-check-sections -u app_entry -u _printf_float -u _scanf_float -Wl,-static -L/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/lib -L/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/lib/NONOSDK22x_190703 -L/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/ld -L/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sdk/libc/xtensa-lx106-elf/lib -Teagle.flash.1m64.ld -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read -o /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.elf -Wl,--start-group /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/sketch/WiFiScan.ino.cpp.o /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/libraries/ESP8266WiFi/ESP8266WiFi.a /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_cache_186496/core/core_61d41a93f4dbfcc5e4ddca493a9e9b0d.a -lhal -lphy -lpp -lnet80211 -llwip2-536-feat -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc -Wl,--end-group -L/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/elf2bin.py --eboot /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/bootloaders/eboot/eboot.elf --app /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.elf --flash_mode dout --flash_freq 40 --flash_size 1M --path /Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin --out /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.bin
Creating BIN file "/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.bin" using "/var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.elf"
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/signing.py --mode sign --privatekey /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi/examples/WiFiScan/private.key --bin /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.bin --out /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.bin.signed --legacy /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.bin.legacy_sig
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/sizes.py --elf /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.elf --path /Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin
Executable segment sizes:
IROM : 236828 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26900 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1256 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 820 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 25000 ) - zeroed variables (global, static) in RAM/HEAP
Using library ESP8266WiFi at version 1.0 in folder: /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/ESP8266WiFi
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-size -A /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.elf
Sketch uses 265804 bytes (27%) of program storage space. Maximum is 958448 bytes.
Global variables use 27076 bytes (33%) of dynamic memory, leaving 54844 bytes for local variables. Maximum is 81920 bytes.
/Users/nazanin/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 /Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/upload.py --chip esp8266 --port /dev/cu.usbmodem1411 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 /var/folders/11/fjrxwd413yl0rhm04vsfnj7c0000gn/T/arduino_build_295774/WiFiScan.ino.bin
esptool.py v2.8
Serial port /dev/cu.usbmodem1411
Connecting......................................____Traceback (most recent call last):
File "/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/upload.py", line 65, in
esptool.main(cmdline)
File "/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 2890, in main
esp.connect(args.before)
File "/Users/nazanin/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 483, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

_

Thank you.

@priyarithadia
Copy link

hi all,
Executable segment sizes:
IROM : 236328 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 28596 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1260 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 780 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 25712 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 266964 bytes (27%) of program storage space. Maximum is 958448 bytes.
Global variables use 27752 bytes (33%) of dynamic memory, leaving 54168 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port COM3
Connecting......................................____Traceback (most recent call last):
File "C:\Users\PRIYA\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py", line 65, in
esptool.main(cmdline)
File "C:/Users/PRIYA/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 2890, in main
esp.connect(args.before)
File "C:/Users/PRIYA/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 483, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

_
problem please help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests