Add a channel bandwidth selector to the setup screen.

Required for 900mhz devices to be supported due to band size.

This can also be useful for allowing more devices to fit into the same amount of RF space as nodes may often not need full 20mhz wide channels.

2.4ghz while using standard BBHN SSID is restricted to 20mhz for compatibility.

ref BBHN->ticket:50
This commit is contained in:
Conrad Lara - KG6JEI 2014-07-14 20:40:49 -07:00
parent 1742f8111c
commit 711dbc17f2
12 changed files with 44 additions and 0 deletions

View File

@ -3,6 +3,7 @@ wifi_mode = ap
wifi_ssid = <NODE>
wifi_txpower = 19
wifi_channel = 6
wifi_chanbw = 20
wifi_distance = 0
wifi_hidden = 0

View File

@ -3,6 +3,7 @@ wifi_mode = ap
wifi_ssid = <NODE>
wifi_txpower = 19
wifi_channel = 6
wifi_chanbw = 20
wifi_distance = 0
wifi_hidden = 0

View File

@ -2,6 +2,7 @@ config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
config wifi-iface

View File

@ -5,6 +5,7 @@ wifi_ssid = BroadbandHamnet-v2
wifi_mode = adhoc
wifi_txpower = 19
wifi_channel = 1
wifi_chanbw = 20
wifi_distance = 0
wifi_country = 00

View File

@ -5,6 +5,7 @@ wifi_ssid = BroadbandHamnet-v2
wifi_mode = adhoc
wifi_txpower = 19
wifi_channel = 1
wifi_chanbw = 20
wifi_distance = 0
wifi_country = 00

View File

@ -2,6 +2,7 @@ config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
option country <wifi_country>

View File

@ -3,6 +3,7 @@ wifi_mode = ap
wifi_ssid = <NODE>
wifi_txpower = 19
wifi_channel = 6
wifi_chanbw = 20
wifi_distance = 0
wifi_hidden = 0

View File

@ -3,6 +3,7 @@ wifi_mode = ap
wifi_ssid = <NODE>
wifi_txpower = 19
wifi_channel = 6
wifi_chanbw = 20
wifi_distance = 0
wifi_hidden = 0

View File

@ -2,6 +2,7 @@ config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option distance <wifi_distance>
config wifi-iface

View File

@ -2,6 +2,7 @@ config wifi-device radio0
option type mac80211
option phy phy0
option channel <wifi_channel>
option chanbw <wifi_chanbw>
option disabled 1
config wifi-iface

View File

@ -139,6 +139,25 @@ sub rf_channels_list
}
}
sub is_wifi_chanbw_valid
{
my ($wifi_chanbw,$wifi_ssid) = @_;
my $boardinfo=hardware_info();
if ( ( exists($boardinfo->{'rfband'}) ) && ( $boardinfo->{'rfband'} == "2400" ) && ( $wifi_chanbw != 20 ) )
{
if ( (( length $wifi_ssid >= 33 ) || ( length $wifi_ssid == 0 )) || ( $wifi_ssid =~ /BroadBandHamnet-v.*/i ))
{
# 2.4ghz and default ssid not 20mhz wide -- Invalid chan_bw
return 0;
} else {
# chan_bw valid
return 1;
}
}
# Not 2.4ghz or device is unknown, trust the user submission.
return 1;
}
#weird uhttpd/busybox error requires a 1 at the end of this file
1

View File

@ -179,6 +179,12 @@ if($parms{button_save})
push (@errors, "invalid WiFi channel")
}
if ( !is_wifi_chanbw_valid($wifi_chanbw,$wifi_ssid) )
{
push (@errors, "Invalid WiFi channel width");
$wifi_chanbw = 20;
}
push (@errors, "invalid WiFi distance") if $wifi_distance < 0 or $wifi_distance =~ /\D/;
$wifi_country_validated=0;
@ -523,6 +529,15 @@ if($wifi_proto ne "disabled")
push @hidden, "<input type=hidden name=wifi_channel value='$wifi_channel'>";
}
{
print "<tr><td>Channel Width</td>\n";
print "<td><select name=wifi_chanbw>\n";
selopt("20 MHz","20",$wifi_chanbw);
selopt("10 MHz","10",$wifi_chanbw);
selopt("5 MHz","5",$wifi_chanbw);
print "</select></td></tr>\n";
}
if ($config ne "mesh")
{
print "<tr><td>Country</td>\n";