Merge branch 'release-3.15.1.0' into develop

Conflicts:
	files/www/cgi-bin/mesh
This commit is contained in:
Conrad Lara - KG6JEI 2015-12-22 08:45:09 -08:00
commit 2dfc911df7
5 changed files with 115 additions and 45 deletions

View File

@ -22,6 +22,7 @@
/etc/config.router/_setup.ports
/etc/dropbear/dropbear_dss_host_key
/etc/dropbear/dropbear_rsa_host_key
/etc/dropbear/authorized_keys
/etc/firewall.user
/etc/group
/etc/hosts

18
files/etc/banner Normal file
View File

@ -0,0 +1,18 @@
_____ ______ _____ _ _
/\ | __ \| ____| __ \| \ | |TM
/ \ | |__) | |__ | | | | \| |
/ /\ \ | _ /| __| | | | | . ` |
/ ____ \| | \ \| |____| |__| | |\ |
/_/ \_\_| \_\______|_____/|_| \_|
AMATEUR RADIO EMERGENCY DATA NETWORK
Release 3.15.1.0
-----------------------------------------------
BASED ON OpenWRT BARRIER BREAKER r42549
-----------------------------------------------
* 1 Battery Connect all devices
* 2 POE injectors Upgrade firmware to AREDN
* 3 cat5 cables Setup with your callsign
* 1 UBNT NanoStation Point the Antenna
* 1 ipCam Welcome to the Mesh!
-----------------------------------------------

View File

@ -1,9 +1,40 @@
#!/usr/bin/perl
#
# GPL V2 or greater
# work around Atheros ANI overly attenuating recieve chain with tendency to become stuck
# Joe Ayers AE6XE ae6xe@arrl.net 2015-10-29
=for commnet
Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks
Copyright (C) 2015 Joe Ayers ae6xe@arrl.net
See Contributors file for additional contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional Terms:
Additional use restrictions exist on the AREDN(TM) trademark and logo.
See AREDNLicense.txt for more info.
Attributions to the AREDN Project must be retained in the source code.
If importing this code into a new or existing project attribution
to the AREDN project must be added to the source code.
You must not misrepresent the origin of the material contained within.
Modified versions must be modified to attribute to the original source
and be marked in reasonable ways as differentiate it from the original
version.
=cut
# Joe Ayers AE6XE ae6xe@arrl.net 2015-12-08
# work around Atheros ANI overly attenuating recieve chain with tendency to become stuck
# A receive chain may go deaf at noise prone sites and some neighbors may drop out.
# The wireless driver poorly tunes and treats these neighbors as noise in error.
# This is a workaround until root cause driver updates occur.
@ -11,7 +42,7 @@
$now=`cat /proc/uptime | cut -f1 -d" "`;
chomp $now;
exit 0 unless $now > 120;
exit 0 unless $now > 119;
$iface = "wlan0" ; # wireless interface
$datfile = "/tmp/rssi.dat";
@ -58,6 +89,17 @@ sub getRSSI
}
}
sub getChannelScan
{
$chnum = `uci get wireless.radio0.channel`;
$chnum += 1;
if ($chnum == 8 or $chnum == 12 or $chnum == 100 or $chnum == 185) { $chnum -= 2; }
if ($chnum == 0) { $chnum = 1; }
$freq = `iw list | grep "\\\[$chnum\\\]" | head -1`;
$freq =~ /([\d]+)[ \t]+MHz[ \t]+/;
$freq = $1;
}
$antnum=`iw list | grep "Configured Antennas: TX" | cut -f6 -d" "`;
chomp $antnum;
if ($antnum eq "0x1")
@ -98,6 +140,14 @@ $ofdm_level = `cat /sys/kernel/debug/ieee80211/phy0/ath9k/ani | grep "OFDM LEVEL
$now=`cat /proc/uptime | cut -f1 -d" "`;
chomp $now;
if ($now < 750 and $now > 119 )
{
# avoid node going deaf while trying to obtain 'normal' statistics of neighbor strength
# in first few minutes after boot
getChannelScan();
system("/usr/sbin/iw $iface scan freq $freq passive > /dev/null");
}
getRSSI() ;
for (keys %rssi)
@ -106,15 +156,15 @@ for (keys %rssi)
{
$hit = 0 ;
$sdH3 = int(3 * $rssiHist{$_}{"sdH"} + .5);
# is the RSSI attenuated and 3 standard deviations away? Test is only 1 chain has dropped, not both.
if ($rssiHist{$_}{"aveH"} - $rssi{$_}{"Hrssi"} > $sdH3) { $hit += 1; }
# is the RSSI attenuated and 3 standard deviations away?
if (abs ($rssiHist{$_}{"aveH"} - $rssi{$_}{"Hrssi"}) > $sdH3) { $hit += 1; }
if ( $antnum )
{
$sdV3 = int(3 * $rssiHist{$_}{"sdV"} + .5);
if ($rssiHist{$_}{"aveV"} - $rssi{$_}{"Vrssi"} > $sdV3) { $hit += 1; }
if (abs ( $rssiHist{$_}{"aveV"} - $rssi{$_}{"Vrssi"}) > $sdV3) { $hit += 1; }
}
if ($rssiHist{$_}{"num"} > 9 and $ofdm_level <= 2 and $hit == 1)
if ($rssiHist{$_}{"num"} > 9 and $ofdm_level <= 2 and $hit > 0)
{ # Overly Attenuated Chain Suspected
$datestring = localtime();
if ($antnum)
@ -164,7 +214,7 @@ for (keys %rssi)
$rssiHist{$_}{"aveH"} = $aveH;
$rssiHist{$_}{"sdH"} = $sdH;
$rssiHist{$_}{"last"} = $now;
if ($rssiHist{$_}{"num"} < 60 )
if ($rssiHist{$_}{"num"} < 60 )
{
# keep statistics to 60 sample (minute) moving window
$rssiHist{$_}{"num"} += 1;
@ -191,13 +241,7 @@ for (keys %rssi)
if ($amac or not $neighborCount)
{
$chnum = `uci get wireless.radio0.channel`;
$chnum += 1;
if ($chnum == 8 or $chnum == 12 or $chnum == 100 or $chnum == 185) { $chnum -= 2; }
if ($chnum == 0) { $chnum = 1; }
$freq = `iw list | grep "\\\[$chnum\\\]" | head -1`;
$freq =~ /([\d]+)[ \t]+MHz[ \t]+/;
$freq = $1;
getChannelScan();
if ($amac)
{
@ -223,7 +267,7 @@ if ($amac or not $neighborCount)
$falpos = 0;
if ($antnum)
{
if (abs ( $beforeH - $rssi{$amac}{"Hrssi"} ) <= 2 and
if (abs ( $beforeH - $rssi{$amac}{"Hrssi"} ) <= 2 and
abs ( $beforeV - $rssi{$amac}{"Vrssi"} ) <= 2 ) { $falpos = 1; }
}
elsif (abs ( $beforeH - $rssi{$amac}{"Hrssi"} ) <= 2 ) { $falpos = 1; }
@ -231,7 +275,7 @@ if ($amac or not $neighborCount)
if ( $falpos )
{
# if a false-positive (within 2dB change after a reset), then add data point to statistics
$aveH = (($rssiHist{$amac}{"aveH"}*$rssiHist{$amac}{"num"})+ $beforeH )
$aveH = (($rssiHist{$amac}{"aveH"}*$rssiHist{$amac}{"num"})+ $beforeH )
/ ($rssiHist{$amac}{"num"} + 1 );
$sdH = sqrt((($rssiHist{$amac}{"num"}-1)*($rssiHist{$amac}{"sdH"}**2) +
(($beforeH-$aveH)*($beforeH-$rssiHist{$amac}{"aveH"})))
@ -240,10 +284,10 @@ if ($amac or not $neighborCount)
chomp $sdH;
$rssiHist{$amac}{"aveH"} = $aveH;
$rssiHist{$amac}{"sdH"} = $sdH;
if ($antnum)
{
$aveV = (($rssiHist{$amac}{"aveV"}*$rssiHist{$amac}{"num"})+ $beforeV ) /
$aveV = (($rssiHist{$amac}{"aveV"}*$rssiHist{$amac}{"num"})+ $beforeV ) /
($rssiHist{$amac}{"num"} + 1 );
$sdV = sqrt((($rssiHist{$amac}{"num"}-1)*($rssiHist{$amac}{"sdV"}**2) +
(($beforeV-$aveV)*($beforeV-$rssiHist{$amac}{"aveV"}))) /
@ -254,13 +298,13 @@ if ($amac or not $neighborCount)
$rssiHist{$amac}{"sdV"} = $sdV;
}
if ($rssiHist{$amac}{"num"} < 60 )
if ($rssiHist{$amac}{"num"} < 60 )
{
# keep statistics to 60 sample (minute) moving window
$rssiHist{$amac}{"num"} += 1;
}
$rssiHist{$amac}{"last"} = $now + 5 ;
$datestring = localtime();
print $lfh "$datestring: $amac Possible valid data point, adding to statistics.\n";
}
@ -291,7 +335,7 @@ exit 0 unless -s $logfile > $MAXSIZE + 1024;
@ARGV = $logfile;
undef $/;
$^I = "";
while (<>)
while (<>)
{
substr($_, 0, length() - $MAXSIZE) = "";
s/.*\n//;

View File

@ -953,7 +953,7 @@ sub hardware_info
'TP-Link CPE210 v1.0' => {
'name' => 'TP-Link CPE210 v1.0',
'comment' => '',
'supported' => '-2',
'supported' => '1',
'maxpower' => '23',
'pwroffset' => '0',
'usechains' => 1,
@ -963,7 +963,7 @@ sub hardware_info
'TP-Link CPE510 v1.0' => {
'name' => 'TP-Link CPE510 v1.0',
'comment' => '',
'supported' => '-2',
'supported' => '1',
'maxpower' => '23',
'pwroffset' => '0',
'usechains' => 1,
@ -996,7 +996,7 @@ sub hardware_info
'0xe005' => {
'name' => 'NanoStation M5',
'comment' => 'NanoStation M5',
'supported' => '-2',
'supported' => '1',
'maxpower' => '22',
'pwroffset' => '5',
'usechains' => 1,
@ -1022,8 +1022,8 @@ sub hardware_info
},
'0xe035' => {
'name' => 'NanoStation M3',
'comment' => 'NanoStation M3 in testing',
'supported' => '-2',
'comment' => 'NanoStation M3',
'supported' => '1',
'maxpower' => '22',
'pwroffset' => '3',
'usechains' => 1,
@ -1076,8 +1076,8 @@ sub hardware_info
},
'0xe1c3' => {
'name' => 'Rocket M3',
'comment' => 'In Testing',
'supported' => '-2',
'comment' => 'Rocket M3',
'supported' => '1',
'maxpower' => '22',
'pwroffset' => '3',
'usechains' => 1,
@ -1120,7 +1120,7 @@ sub hardware_info
'rfband' => '5800ubntus',
},
'0xe232' => {
'name' => 'NannoBridge M2',
'name' => 'NanoBridge M2',
'comment' => 'NanoBridge M2',
'supported' => '1',
'maxpower' => '21',
@ -1129,7 +1129,7 @@ sub hardware_info
'rfband' => '2400',
},
'0xe239' => {
'name' => 'NannoBridge M9',
'name' => 'NanoBridge M9',
'comment' => 'NanoBridge M9',
'supported' => '1',
'maxpower' => '22',
@ -1147,9 +1147,9 @@ sub hardware_info
'rfband' => '2400',
},
'0xe243' => {
'name' => 'NannoBridge M3',
'name' => 'NanoBridge M3',
'comment' => 'Not Tested',
'supported' => '-2',
'supported' => '1',
'maxpower' => '22',
'pwroffset' => '3',
'usechains' => 1,
@ -1164,6 +1164,15 @@ sub hardware_info
'usechains' => 0,
'rfband' => '2400',
},
'0xe245' => {
'name' => 'airGrid M5 HP',
'comment' => 'airGrid M5',
'supported' => '1',
'maxpower' => '19',
'pwroffset' => '6',
'usechains' => 0,
'rfband' => '5800ubntus',
},
'0xe255' => {
'name' => 'airGrid M5 HP',
'comment' => 'airGrid M5',
@ -1174,7 +1183,7 @@ sub hardware_info
'rfband' => '5800ubntus',
},
'0xe2b5' => {
'name' => 'NannoBridge M5',
'name' => 'NanoBridge M5',
'comment' => 'NanoBridge M5',
'supported' => '1',
'maxpower' => '22',
@ -1183,7 +1192,7 @@ sub hardware_info
'rfband' => '5800ubntus',
},
'0xe2c2' => {
'name' => 'NannoBeam M2 International',
'name' => 'NanoBeam M2 International',
'comment' => 'NanoBeam M2 International -- XW board unsupported at this time',
'supported' => '-1',
'maxpower' => '18',
@ -1219,7 +1228,7 @@ sub hardware_info
'rfband' => '2400',
},
'0xe4e5' => {
'name' => 'NannoBeam M5 International',
'name' => 'NanoBeam M5 International',
'comment' => 'NanoBeam M5 International XW series unsuported at this time',
'supported' => '-1',
'maxpower' => '22',
@ -1247,8 +1256,8 @@ sub hardware_info
},
'Ubiquiti Nanostation M XW' => {
'name' => 'NanoStation M5 XW',
'comment' => 'NanoStation M5 XW 0xe855 (In Testing)',
'supported' => '-2',
'comment' => 'NanoStation M5 XW',
'supported' => '1',
'maxpower' => '22',
'pwroffset' => '5',
'usechains' => 1,

View File

@ -40,6 +40,7 @@ $debug = 0;
BEGIN {push @INC, '/www/cgi-bin'};
use perlfunc;
use ucifunc;
$config = nvram_get("config");
$node = nvram_get("node");
@ -172,11 +173,8 @@ if($parms{button_reset} or not $parms{reload})
# get the dhcp range
# assume that the lan setup is the only one that exists
foreach(`cat /etc/config/dhcp`)
{
$dhcp_start = $1 if /option start\s+(\d+)/;
$dhcp_limit = $1 if /option limit\s+(\d+)/;
}
($rc, $dhcp_start) = &uci_get_indexed_option("dhcp","dhcp","0","start");
($rc, $dhcp_limit) = &uci_get_indexed_option("dhcp","dhcp","0","limit");
$dhcp_end = $dhcp_start + $dhcp_limit - 1;