Skip to content

Commit

Permalink
fix: softAP IP issue(#118)
Browse files Browse the repository at this point in the history
* The order of the soft AP commands needed to be switched
* If there is no delay after `softAPConfig` it is possible that the client will not get an IP

Co-authored-by: Chris McKeever <[email protected]>
  • Loading branch information
cgmckeever and Chris McKeever authored Dec 24, 2021
1 parent eb9d4aa commit a2c4bc6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,16 @@ void ConfigManager::startAP() {
DebugPrintln(F("Starting Access Point"));

WiFi.mode(WIFI_AP);
WiFi.softAP(apName, apPassword);

delay(500); // Need to wait to get IP

IPAddress ip(192, 168, 1, 1);
IPAddress NMask(255, 255, 255, 0);
WiFi.softAPConfig(ip, ip, NMask);

// Need to wait on config
delay(500);

WiFi.softAP(apName, apPassword);

DebugPrint("AP Name: ");
DebugPrintln(apName);

Expand Down

0 comments on commit a2c4bc6

Please sign in to comment.