Skip to content

Commit b8d1add

Browse files
authored
Merge pull request #674 from KipK/#673
fix ap wifi wrong
2 parents 4c8e64e + c9ec582 commit b8d1add

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/net_manager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ void NetManagerTask::wifiStartAccessPoint()
9999

100100
String softAP_ssid;
101101

102-
if (!ap_ssid) {
103-
// Create Unique SSID e.g "emonESP_XXXXXX"
102+
if (ap_ssid.length() < 2) {
103+
// Create Unique SSID e.g "OpenEVSE_XXXXXX"
104104
softAP_ssid = String(_softAP_ssid) + "_" + ESPAL.getShortId();
105105
}
106106
else {
107-
softAP_ssid = ap_pass;
107+
softAP_ssid = ap_ssid;
108108
}
109109

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

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

0 commit comments

Comments
 (0)