简体   繁体   English

ESP8266 esptool.FatalError:无法连接到 ESP8266:等待数据包 header 超时

[英]ESP8266 esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

I have the ESP8266 and have already tried the versions 2.6.2, 2.7.3, and 2.7.4.我有 ESP8266,并且已经尝试过 2.6.2、2.7.3 和 2.7.4 版本。 Nothing worked and all got was the same error:没有任何效果,得到的都是同样的错误:

Serial port COM3
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
  File "C:\Users\mauru\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.2/tools/upload.py", line 65, in 
    esptool.main(cmdline)
  File "C:/Users/mauru/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.2/tools/esptool\esptool.py", line 2890, in main
    esp.connect(args.before)
  File "C:/Users/mauru/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.6.2/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
Ungültige Bibliothek C:\Users\mauru\Documents\Arduino\libraries\hardware in keine Header-Dateien (.h) in C:\Users\mauru\Documents\Arduino\libraries\hardware gefunden gefunden

I already tried reinstalling the versions.我已经尝试重新安装版本。

I had the same problem with nodeMCU V3.我对nodeMCU V3有同样的问题。 Holding the Flash button and press RST once solves the problem.按住 Flash 按钮并按一次 RST 即可解决问题。

I think I know what's your problem, I had a very similar one: You have to keep pressing one of the two ESP8266 buttons (it's called boot I think (I was wrong, it's called flash)) next to the USB plug while uploading (I wrote this before I realised that there are no buttons and no USB plug).我想我知道你的问题是什么,我有一个非常相似的问题:你必须在上传时按住 USB 插头旁边的两个 ESP8266 按钮之一(我认为它称为启动(我错了,它称为闪存))(我在意识到没有按钮和没有 USB 插头之前写了这个)。 That's a problem that is mostly there on cheap chinese devices I think.我认为这是一个主要存在于廉价中国设备上的问题。

Edit: Now that I know the exact board (I just assumed it was a NodeMCU for some reason) it turned out that that board doesn't have such a flash button, but that doesn't mean that you can't make one yourself:编辑:现在我知道确切的电路板(出于某种原因,我只是假设它是 NodeMCU)结果证明该电路板没有这样的 flash 按钮,但这并不意味着你不能自己制作一个:

电路板的引脚排列

(image fromthis site ) (图片来自本站

GPIO0, the pin that is grounded by the flash button, is accessable, so it should be possible to just ground it.通过 flash 按钮接地的引脚 GPIO0 是可访问的,因此应该可以将其接地。

enter image description here just for that add a pushbutton for flash code在此处输入图像描述只是为 flash 代码添加按钮

Interesting observation I have seen is that it will give the above error when the 5v pin is being used for a sensor or some other purpose.我看到的有趣观察是,当 5v 引脚用于传感器或其他用途时,它会出现上述错误。 Disconnect the 5v pin from any external device / sensor, and amazingly it will flash.从任何外部设备/传感器断开 5v 引脚,令人惊讶的是它会 flash。

Usually this problem is in the form of port problems or connection problems.通常这个问题是端口问题或连接问题的形式。

Then make sure you make the connections as described above.然后确保按照上述方式进行连接。 Finally, be sure to reconnect the GPIO0 section to Ground (GND) when assigning code.最后,在分配代码时,务必将 GPIO0 部分重新连接到地 (GND)。 (extra connect) Otherwise, the ESP will act as flash and will not allow you to code. (额外连接)否则,ESP 将充当 flash 并且不允许您编码。

And you should update ESP boards to 3.0.0你应该将 ESP 板更新到 3.0.0

Your RX/TX pins are connected to something, remove them and reconnect after upload您的 RX/TX 引脚已连接到某物,删除它们并在上传后重新连接

try changing the uploading speed and baud rate.... mine was 3000000 and it showed the same error, then i changed it to 152000 then it worked!!!尝试更改上传速度和波特率....我的是 3000000 并显示相同的错误,然后我将其更改为 152000 然后它工作!

If you enter ssid or password using space for example例如,如果您使用空格输入 ssid 或密码

const char* ssid = "Realme 5 pro"

Then remove the space or change the name to something else for example然后删除空格或将名称更改为其他名称,例如

const char* ssid = "Realme"

It's worked for me.它对我有用。

it solved when i connected to another port of my laptop当我连接到笔记本电脑的另一个端口时它解决了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM