我尝试使用 AT+CWJAP
将 ESP8266 连接到 wifi 路由器,但遇到问题,无法读取 esp8266 对我的 arduino 的响应。
当我尝试从 arduino 代码发送 AT
到 esp 时,它无法读取 esp8266 的 OK
响应 Serial.find("OK")
不工作。我把波特率改成115200也没用
这是串行捕获:
> 14:04:45.882 -> AT
> 14:04:51.868 -> NOT OK!
> 14:04:51.901 -> AT+CIPSTART="TCP","184.106.153.149",80
> 14:04:54.899 -> AT+CIPSEND=55
> 14:04:55.873 -> AT+CIPCLOSE
这是arduino代码:
void setup()
{
Serial.begin(9600); //or use default 115200.
Serial.println("AT");
delay(5000);
if(Serial.find("OK")){
connectWiFi();
}
else{
Serial.println("NOT OK!");
}
}
它应该运行 ConnectWiFi()
函数,但输出是“NOT OK!”
最佳答案
您的波特率为incorrect 。它应该是115200
。
关于c - 如何修复无法从 esp8266 响应读取serial.find ("OK"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56161207/