Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Darren Humphrey
#78221 I am using the softAP functionality to start a SoftAP with a custom name (i.e. "MyApName"). This is working fine. But sometimes I see an AP named ESP_XXYYZZ, where XXYYZZ is the last 3 bytes of the MAC address.

Is there a way to prevent ESP_XXYYZZ from appearing? I can't find any reference to it anywhere.
User avatar
By Darren Humphrey
#78235
Pablo2048 wrote:Show us your code, where you are setting WiFi class (probably in your setup()).


Here it is. Some of the code may be unneeded. I was having a lot of trouble with wifi reliability and was trying some of the solutions I found online.

// This generates a string based on the mac address: like MyAp_XXYYZZ
String apName = MakeAccessPointName();

// Shut down Wifi first
WiFi.persistent(false);
WiFi.disconnect(true);
WiFi.mode(WIFI_OFF);
delay(100);

// disable modem sleep to prevent wifi disconnects
WiFi.setSleepMode(WIFI_NONE_SLEEP);

WiFi.hostname( apName.c_str() );

bool success = WiFi.softAP(apName.c_str(), _apPassword->Value().c_str());

if (!success)
{
Serial.printf("SoftAP Failed To Start");
}
else
{
WiFi.mode(WIFI_AP);
Serial.printf("Started SoftAP '%s"),apName.c_str());

IPAddress ipAddr(192,168,4,1);

WiFi.softAPConfig( ipAddr, ipAddr, IPAddress(255, 255, 255, 0));

delay(500);

}
User avatar
By Pablo2048
#78238 The problem can be in sequence of calls to SoftAP initialization IMHO. I'm using this:
Code: Select allWiFi.persistent(true);
WiFi.mode(WIFI_AP);
boolean result = WiFi.softAP("SoftAP_xxyy", "admin");

There is no need to set AP mode after .softAP() call IMHO and softAPConfig has to be called after delay(100).