add soft-ap channel option

fix for #345 and #453

Signed-off-by: Bartlomiej Zimon <uzi18@o2.pl>
pull/458/head
Bartlomiej Zimon 5 years ago committed by Thorsten von Eicken
parent 84fd0a3a58
commit 5995df787d
  1. 13
      esp-link/cgiwifi.c
  2. 6
      html/wifi/wifiAp.html
  3. 1
      html/wifi/wifiAp.js

@ -640,6 +640,17 @@ int ICACHE_FLASH_ATTR cgiApSettingsChange(HttpdConnData *connData) {
apconf.ssid_hidden = 0; apconf.ssid_hidden = 0;
} }
} }
// Set channel to be hidden or not
len=httpdFindArg(connData->getArgs, "ap_channel", buff, sizeof(buff));
if(len>0){
int value = atoi(buff);
if(value >= 1 || value <= 13){
apconf.channel = value;
}else{
// If out of range, set by default
apconf.channel = 1;
}
}
// Store new configuration // Store new configuration
wifi_softap_set_config(&apconf); wifi_softap_set_config(&apconf);
@ -659,6 +670,7 @@ int ICACHE_FLASH_ATTR cgiApSettingsInfo(HttpdConnData *connData) {
"\"ap_authmode\": %d, " "\"ap_authmode\": %d, "
"\"ap_maxconn\": %d, " "\"ap_maxconn\": %d, "
"\"ap_beacon\": %d, " "\"ap_beacon\": %d, "
"\"ap_channel\": %d, "
"\"ap_hidden\": \"%s\" " "\"ap_hidden\": \"%s\" "
" }", " }",
apconf.ssid, apconf.ssid,
@ -666,6 +678,7 @@ int ICACHE_FLASH_ATTR cgiApSettingsInfo(HttpdConnData *connData) {
apconf.authmode, apconf.authmode,
apconf.max_connection, apconf.max_connection,
apconf.beacon_interval, apconf.beacon_interval,
apconf.channel,
apconf.ssid_hidden ? "enabled" : "disabled" apconf.ssid_hidden ? "enabled" : "disabled"
); );

@ -69,6 +69,12 @@
<div class="popup">Between 100 - 60000 ms ( default 100ms )</div> <div class="popup">Between 100 - 60000 ms ( default 100ms )</div>
</div> </div>
<div class="pure-form-stacked">
<label>Soft-AP Channel</label>
<input type="text" name="ap_channel" />
<div class="popup">Between 1 - 13 ( default 1 )</div>
</div>
<div class="form-horizontal"> <div class="form-horizontal">
<label><input type="checkbox" name="ap_hidden" />Soft-AP SSID hidden</label> <label><input type="checkbox" name="ap_hidden" />Soft-AP SSID hidden</label>
<div class="popup">Check this box to hide you Soft-AP SSID ( default Not Hidden )</div> <div class="popup">Check this box to hide you Soft-AP SSID ( default Not Hidden )</div>

@ -3,6 +3,7 @@ specials["ap_ssid"] = "SSID name";
specials["ap_password"] = "PASSWORD"; specials["ap_password"] = "PASSWORD";
specials["ap_maxconn"] = "Max Connections number"; specials["ap_maxconn"] = "Max Connections number";
specials["ap_beacon"] = "Beacon Interval"; specials["ap_beacon"] = "Beacon Interval";
specials["ap_channel"] = "Channel";
function changeWifiMode(m) { function changeWifiMode(m) {
blockScan = 1; blockScan = 1;

Loading…
Cancel
Save