title: WeMos D1 Mini esptool.FatalError: Timed out waiting for packet header
body: <p>I have a <strong>WeMos D1 Mini</strong>. Here is the board information:</p>
  
  <pre><code>Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "LOLIN(WEMOS) D1 R2 &amp; mini, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
  </code></pre>
  
  <p>I am trying to upload the blink program but getting the following error:</p>
  
  <pre><code>Executable segment sizes:
  
  
  IROM   : 228360          - code in flash         (default or ICACHE_FLASH_ATTR) 
  
  
  IRAM   : 26564   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 
  
  
  DATA   : 1236  )         - initialized variables (global, static) in RAM/HEAP 
  
  
  RODATA : 1520  ) / 81920 - constants             (global, static) in RAM/HEAP 
  
  
  BSS    : 24896 )         - zeroed variables      (global, static) in RAM/HEAP 
  
  
  Sketch uses 257680 bytes (24%) of program storage space. Maximum is 1044464 bytes.
  Global variables use 27652 bytes (33%) of dynamic memory, leaving 54268 bytes for local variables. Maximum is 81920 bytes.
  esptool.py v2.8
  Serial port COM5
  Connecting....
  Chip is ESP8266EX
  Features: WiFi
  Crystal is 26MHz
  MAC: 38:2b:78:04:7a:c0
  Uploading stub...
  Running stub...
  Stub running...
  Configuring flash size...
  Traceback (most recent call last):
    File "C:\Users\adiba\OneDrive\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.6.1/tools/upload.py", line 69, in &lt;module&gt;
      esptool.main(cmdline)
    File "C:/Users/adiba/OneDrive/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 2933, in main
      detect_flash_size(esp, args)
    File "C:/Users/adiba/OneDrive/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 2241, in detect_flash_size
      flash_id = esp.flash_id()
    File "C:/Users/adiba/OneDrive/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 607, in flash_id
      return self.run_spiflash_command(SPIFLASH_RDID, b"", 24)
    File "C:/Users/adiba/OneDrive/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 853, in run_spiflash_command
      old_spi_usr = self.read_reg(SPI_USR_REG)
    File "C:/Users/adiba/OneDrive/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 490, in read_reg
      val, data = self.command(self.ESP_READ_REG, struct.pack('&lt;I', addr))
    File "C:/Users/adiba/OneDrive/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 347, in command
      p = self.read()
    File "C:/Users/adiba/OneDrive/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 292, in read
      return next(self._slip_reader)
    File "C:/Users/adiba/OneDrive/Documents/ArduinoData/packages/esp8266/hardware/esp8266/2.6.1/tools/esptool\esptool.py", line 2045, in slip_reader
      raise FatalError("Timed out waiting for packet %s" % waiting_for)
  esptool.FatalError: Timed out waiting for packet header
  esptool.FatalError: Timed out waiting for packet header
  
  This report would have more information with
  "Show verbose output during compilation"
  option enabled in File -&gt; Preferences.
  </code></pre>
  
  <p>Is there any solution for this? My friend has tried this board on his computer and it seems to work just fine. Thanks for any support.</p>