esp8266 软 AP 显示错误名称

esp8266 soft AP displays the wrong name

设备:esp8266(nodeMCU,esp-12E) 我有一个以前 运行 micropython 的 esp8266。现在我想 return 回到 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”。 那么这里出了什么问题?

在你的草图中,Wifi参数没有更新,因为Wifi密码太短,因此它保留了以前的ssid和密码。 试试这个,现在可以了:祝一切顺利:

布尔结果 = WiFi.softAP("ESPsoftAP", "1234567890")