mirror of https://github.com/aredn/aredn.git
Merge branch 'DefaultChannel' into develop
Allows nodes to default to a common channel that is in the most common bandplan space for Part 97 usage. Local cordination is still needed by users to make sure the channel matches the local deployment. Defaults are as follows: Band : Channel Freq : Bandwidth 900 : 912MHz : 5MHz 2400 : 1 2412MHz : 20MHz 3400 : 3420MHz : 5MHz 5800 : 149 5745MHz : 5MHz 2.4GHz keeps channel 1 at 20MHz because it is the standard deployment. All other bands are still 'new' and no standard exist so we are creating one. 5MHz chosen because it better fits the emcomm goal. Smaller width should be stronger allowing for better networks. Local networks can change as they see fit.
This commit is contained in:
commit
dff687eed7
|
@ -1,4 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
uci set wireless.radio0.channel=`perl -I/www/cgi-bin -e 'use channelmaps; $channels = rf_channels_list(); foreach $channelnumber (sort {$a <=> $b} keys %{$channels} ) { print $channelnumber; exit 0;}'`
|
||||
uci -q commit
|
|
@ -261,6 +261,43 @@ sub is_wifi_chanbw_valid
|
|||
return 1;
|
||||
}
|
||||
|
||||
|
||||
sub rf_default_channel
|
||||
{
|
||||
|
||||
my %default_rf = (
|
||||
'900' => {
|
||||
chanbw => "5",
|
||||
channel => "5",
|
||||
},
|
||||
'2400' => {
|
||||
chanbw => "20",
|
||||
channel => "1",
|
||||
},
|
||||
'3400' => {
|
||||
chanbw => "5",
|
||||
channel => "84",
|
||||
},
|
||||
'5800ubntus' => {
|
||||
chanbw => "5",
|
||||
channel => "149",
|
||||
},
|
||||
);
|
||||
|
||||
$boardinfo=hardware_info();
|
||||
#We know about the band so lets use it
|
||||
if ( exists($boardinfo->{'rfband'}))
|
||||
{
|
||||
return $default_rf{$boardinfo->{'rfband'}};
|
||||
}
|
||||
else {
|
||||
# Somewhat "expensive" in that it duplicates calls made above, but rare to be used.
|
||||
my $channels = rf_channels_list();
|
||||
foreach $channelnumber (sort {$a <=> $b} keys %{$channels}) {
|
||||
return { chanbw => "5", channel => $channelnumber };
|
||||
}
|
||||
}
|
||||
}
|
||||
#weird uhttpd/busybox error requires a 1 at the end of this file
|
||||
1
|
||||
|
||||
|
|
|
@ -530,6 +530,14 @@ else
|
|||
}
|
||||
if($wifi_proto ne "disabled")
|
||||
{
|
||||
|
||||
# Reset wifi channel/bandwidth to default
|
||||
if ( -f "/etc/config/unconfigured" || $parms{button_reset} ) {
|
||||
my $defaultwifi = rf_default_channel();
|
||||
$wifi_channel = $defaultwifi->{'channel'};
|
||||
$wifi_chanbw = $defaultwifi->{'chanbw'};
|
||||
}
|
||||
|
||||
print "<tr><td>SSID</td>\n";
|
||||
print "<td><input type=text size=15 name=wifi_ssid value='$wifi_ssid'>";
|
||||
if ($config eq "mesh")
|
||||
|
|
Loading…
Reference in New Issue