我如何解决ESP8266的此错误:“警告:ESPCOMM_SYNC失败错误:ESPCOMM_OPEN失败错误:ESPCOMM_UPLOAD_MEM失败&quot”?
我正在使用ESP8266-01进行项目。这就是我将其与PL2303的连接方式:
pl2303 ---> ESP8266
3.3V ---> VCC,CH_PD
TXD ---> rx
rxd ---> Tx
gnd ---> GPIO0,GND
接下来,我打开了Arduino IDE(版本1.8.19),并将此代码添加到我的草图中(我使用的是ESP8266库2.1.0):
#include <ESP8266WiFi.h>
const char *ssid = "ESP AP";
const char *password = "12345";
void setup() {
Serial.begin(115200);
WiFi.softAP(ssid, password);
Serial.print("Access Point: ");
Serial.print(ssid);
Serial.println(" started");
Serial.print("IP address: ");
Serial.println(WiFi.softAPIP());
}
void loop() {}
这些是我在工具选项卡上的选择:
董事会:“通用ESP8266模块”
上传速度:“ 115200”
CPU频率:“ 80 MHz”
闪光大小:“ 512k(64k spiffs)”
闪存模式:“ dio”
频率:“ 40 MHz”
上传使用:“序列”
重置方法:“ CK”
调试端口:“禁用”
调试级别:“无”
端口:“ com13”(我的PL2303 com端口)
程序员:该板上没有程序员
然后,我将PL2303连接到计算机(Windows 10)并击中上传。它的编译还不错,但是我在控制台上登录了此:
Sketch uses 233067 bytes (53%) of program storage space. Maximum is 434160 bytes.
Global variables use 31920 bytes (38%) of dynamic memory, leaving 50000 bytes for local
variables.
Maximum is 81920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed
现在该怎么办来解决此错误?
更新:我用Nodemcu-01 CH340切换了ESP8266V1。我仍在使用上面的草图上传到我的董事会。它在没有错误的情况下上传,但是我看不到该草图创建的WiFi网络的任何结果(我的意思是带有SSID“ ESP AP”的结果,但我只看到一个名为“ farylink_”的怪异WiFi网络(有几个数字) “而且我认为也许是Nodemcu的WiFi网络,但这不是我真正想要的)或在串行显示器上打印的内容。在“工具”选项卡上,我设置了这样的设置(ESP8266库版本3.0.2,Arduino版本1.8.18):
董事会:“ Nodemcu 1.0(ESP-12E模块)”
内置LED:“ 2”
上传速度:“ 115200”
CPU频率:“ 80 MHz”
闪存大小:“ 4MB(FS:2MB OTA:〜1019)”
调试端口:“串行”
调试级别:“无”
IWIP变体:“ V2较低内存”
vtables:“ flash”
C ++例外:“禁用(OOM上的新中断)”
堆栈保护:“禁用”
擦除闪光灯:“只有草图”
SSL支持:“所有SSL密码(最兼容)”
MMU:“ 32KB缓存 + 32KB IRAM(平衡)”
非32位访问:“使用pgm_read宏来iram/progmem”
端口:“ com14”
有人可以帮助我解决我的问题吗?
I'm doing a project with ESP8266-01. This is how I connected it with PL2303:
PL2303 ---> ESP8266
3.3V ---> VCC, CH_PD
TXD ---> RX
RXD ---> TX
GND ---> GPIO0, GND
Next, I opened Arduino IDE (version 1.8.19) and added this code to my sketch (I'm using esp8266 library version 2.1.0):
#include <ESP8266WiFi.h>
const char *ssid = "ESP AP";
const char *password = "12345";
void setup() {
Serial.begin(115200);
WiFi.softAP(ssid, password);
Serial.print("Access Point: ");
Serial.print(ssid);
Serial.println(" started");
Serial.print("IP address: ");
Serial.println(WiFi.softAPIP());
}
void loop() {}
These are my selections on the Tool tab:
Board: "Generic ESP8266 Module"
Upload Speed: "115200"
CPU Frequency: "80 MHz"
Flash Size: "512K(64K SPIFFS)"
Flash Mode: "DIO"
Flash Frequency: "40 MHz"
Upload Using: "Serial"
Reset Method: "ck"
Debug port: "Disabled"
Debug Level: "None"
Port: "COM13" (my PL2303 COM port)
Programmer: No programmers available for this board
Then I connected my PL2303 to my computer (Windows 10) and hit Upload. It compiled just fine, but I got this logged on my console:
Sketch uses 233067 bytes (53%) of program storage space. Maximum is 434160 bytes.
Global variables use 31920 bytes (38%) of dynamic memory, leaving 50000 bytes for local
variables.
Maximum is 81920 bytes.
warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed
What should I do now to fix this error?
Update: I switched ESP8266v1 with NodeMCU-01 CH340. I'm still using the above sketch to upload to my board. It uploads without error, but I can't see any results like the wifi network created by that sketch (I mean the one with the SSID "ESP AP" but I only see a weird wifi network named "FaryLink_(with a few numbers)" and I think that maybe the wifi network of NodeMCU but that doesn't what I really want) or stuff printed on Serial Monitor. On the Tool tab, I set things up like this (esp8266 library version 3.0.2, Arduino version 1.8.18):
Board:"NodeMCU 1.0 (ESP-12E Module)"
Builtin Led:"2"
Upload Speed:"115200"
CPU Frequency:"80 MHz"
Flash Size:"4MB(FS:2MB OTA:~1019)"
Debug port:"Serial"
Debug Level:"None"
IwIP Variant:"v2 Lower Memory"
VTables:"Flash"
C++ Exceptions:"Disabled (new aborts on oom)"
Stack Protection:"Disabled"
Erase Flash:"Only Sketch"
SSL Support:"All SSL ciphers (most compatible)"
MMU:"32KB cache + 32KB IRAM (balanced)"
Non-32-Bit Access:"Use pgm_read macros for IRAM/PROGMEM"
Port:"COM14"
Anyone can help me solving my problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最后,我决定将Arduino版本更改为1.8.8,ESP Library 2.5.0;我已经用另一个草图进行了测试,它起作用了!!!我将在“工具”选项卡上分享我的选择,希望它能帮助某人:
董事会:“ Nodemcu 1.0(ESP-12E模块)”
上传速度:“ 115200”
CPU频率:“ 80 MHz”
闪光灯大小:“ 4MB(3M spiffs)”
调试端口:“串行”
调试级别:“无”
IWIP变体:“ V2较低内存”
vtables:“ flash”
例外:“禁用”
擦除闪光灯:“只有草图”
端口:“ com14”
程序员:“ Arduino as asp”
我使用的草图:
Finally, I decided to change the Arduino version to 1.8.8, esp library version 2.5.0; I've tested with another the sketch and it WORKED!!! I will share my selection on the Tool tab, hope it'll help someone:
Board:"NodeMCU 1.0 (ESP-12E Module)"
Upload Speed:"115200"
CPU Frequency:"80 MHz"
Flash Size:"4MB(3M SPIFFS)"
Debug port:"Serial"
Debug Level:"None"
IwIP Variant:"v2 Lower Memory"
VTables:"Flash"
Exceptions:"Disabled"
Erase Flash:"Only Sketch"
Port:"COM14"
Programmer:"Arduino as ISP"
The sketch I used:
在电路中,GPIO0引脚通过10 K电阻连接到VCC。复位引脚上的电压为1.97V。在正常操作中。
我删除了这位重新者,并手动连接了GPIO0销。
正常操作 - &GT; GPIO0未连接
程序模式 - &GT; GPIO0至GND-&GT;打开VCC - &GT; GPIO0至VCC - &GT;未连接(达到正常操作),
我使用了5个ESP8266模块尝试,这些模块在此修改后都正常运行,并且以前没有。
我用眨眼的例子做了
但是,当我在Arduino中加载另一个程序时,它失败了上传到ESP/为什么?
唯一的区别是串行显示器的上传速度。
Arduino文件:
void setup(){
// serial.begin(115200);
当我评论此Lline时,上传到ESP的工作。 (// serial.begin(115200);)
当我删除它时(序列号(115200);)上传到ESP失败。
因此,一旦Arduino草图开始串行,与ESP的通信失败了。
In the circuit the GPIO0 pin is connected to VCC through a 10 k resistor. The voltage on the reset pin is 1.97V. in normal operation.
I removed this resister and connected the GPIO0 pin manually.
Normal operation--> GPIO0 not connected
Program mode --> GPIO0 to GND--> switch on VCC --> GPIO0 to VCC --> not connected (to normal operation)
I tried it with 5 esp8266 modules which all were functioning properly after this modification and did not before.
I did it with the blink example
But when I loaded another program in the arduino, it failed uploading to the esp/ Why?
The only difference was the upload speed of the serial monitor.
the arduino file:
void setup() {
//Serial.begin(115200);
When i commented this lline, the upload to the esp worked. ( //Serial.begin(115200); )
when I uncommented it, ( Serial.begin(115200); ) the upload to the esp failed.
So as soon as the Arduino sketch has a serial begin, the communication to the ESP fails.