Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ap wifi wrong #674

Merged
merged 2 commits into from
Jun 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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