设备: esp8266 (nodeMCU,esp-12E)我有一个esp8266,它以前在上面运行micropython。现在我想回到arduino编程。使用文档上的示例代码:https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/soft-access-point-examples.html
#include <ESP8266WiFi.h>
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("setting up soft-AP");
boolean result = WiFi.softAP("ESPsoftAP", "11234");
if (result = true)
{
Serial.println("ready!");
}
else
{
Serial.println("failed!");
}
}
void loop(){
Serial.printf("station connected = %d\n", WiFi.softAPgetStationNum());
delay(3000);
}但是出现的接入点名为"MicroPython-7b15141“,密码不起作用。在我看来,这条线
boolean result = WiFi.softAP("ESPsoftAP", "11234");因为某些原因不能完成它的功能。然而,在串行监视器上,文本"station connected = 0“确实显示。那么这里出了什么问题呢?
发布于 2021-09-03 19:59:50
在您的草图中,Wifi参数没有更新,因为Wifi密码太短,因此它保留以前的ssid和密码。试试这个,现在它起作用了:一切顺利:
布尔结果= WiFi.softAP("ESPsoftAP","1234567890")
https://stackoverflow.com/questions/69040548
复制相似问题