Skip to content

Commit

Permalink
Merge pull request #674 from KipK/#673
Browse files Browse the repository at this point in the history
fix ap wifi wrong
  • Loading branch information
glynhudson authored Jun 12, 2023
2 parents 4c8e64e + c9ec582 commit b8d1add
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/net_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ void NetManagerTask::wifiStartAccessPoint()

String softAP_ssid;

if (!ap_ssid) {
// Create Unique SSID e.g "emonESP_XXXXXX"
if (ap_ssid.length() < 2) {
// Create Unique SSID e.g "OpenEVSE_XXXXXX"
softAP_ssid = String(_softAP_ssid) + "_" + ESPAL.getShortId();
}
else {
softAP_ssid = ap_pass;
softAP_ssid = ap_ssid;
}

// Use the existing channel if set
Expand All @@ -115,7 +115,7 @@ void NetManagerTask::wifiStartAccessPoint()
channel = (random(3) * 5) + 1;
}
DBUGVAR(channel);
WiFi.softAP(softAP_ssid.c_str(), ap_pass?ap_pass.c_str():_softAP_password, channel);
WiFi.softAP(softAP_ssid.c_str(), ap_pass.length()>=8?ap_pass.c_str():_softAP_password, channel);

// Setup the DNS server redirecting all the domains to the apIP
_dnsServer.setErrorReplyCode(DNSReplyCode::NoError);
Expand Down

0 comments on commit b8d1add

Please sign in to comment.