Merge branch 'release-3.0.0'

This commit is contained in:
Conrad Lara - KG6JEI 2014-11-25 10:24:33 -08:00
commit c243bfc32b
25 changed files with 253 additions and 19 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

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
config button
option button 'reset'
option action 'released'
option handler '/usr/local/bin/bbhnrecoverymode'
option min '3'
option max '7'
config button
option button 'reset'
option action 'released'
option handler 'firstboot && reboot'
option min '12'
option max '20'

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

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
config button
option button 'reset'
option action 'released'
option handler '/usr/local/bin/bbhnrecoverymode'
option min '3'
option max '7'
config button
option button 'reset'
option action 'released'
option handler 'firstboot && reboot'
option min '12'
option max '20'

View File

@ -1,10 +1,11 @@
wifi_proto = static
wifi_ip = 10.<MAC2>
wifi_mask = 255.0.0.0
wifi_ssid = BroadbandHamnet-v2
wifi_ssid = BroadbandHamnet
wifi_mode = adhoc
wifi_txpower = 19
wifi_channel = 1
wifi_chanbw = 20
wifi_distance = 0
wifi_country = 00

View File

@ -1,10 +1,11 @@
wifi_proto = static
wifi_ip = 10.<MAC2>
wifi_mask = 255.0.0.0
wifi_ssid = BroadbandHamnet-v2
wifi_ssid = BroadbandHamnet
wifi_mode = adhoc
wifi_txpower = 19
wifi_channel = 1
wifi_chanbw = 20
wifi_distance = 0
wifi_country = 00

View File

@ -21,15 +21,20 @@ config LoadPlugin
option library 'olsrd_txtinfo.so.0.1'
option accept '0.0.0.0'
config LoadPlugin
option library 'olsrd_secure.so.0.6'
option keyfile '/etc/olsrd.d/olsrd_secure_key'
#config LoadPlugin
# option library 'olsrd_secure.so.0.6'
# option keyfile '/etc/olsrd.d/olsrd_secure_key'
config LoadPlugin
option library 'olsrd_dot_draw.so.0.3'
option accept '127.0.0.1'
option port '2003'
config LoadPlugin
option library 'olsrd_watchdog.so.0.1'
option file '/tmp/olsrd.watchdog'
option interval '5'
config Interface
list interface 'wifi'

View File

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
config button
option button 'reset'
option action 'released'
option handler '/usr/local/bin/bbhnrecoverymode'
option min '3'
option max '7'
config button
option button 'reset'
option action 'released'
option handler 'firstboot && reboot'
option min '12'
option max '20'

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>
@ -9,7 +10,7 @@ config wifi-iface
option device radio0
option network wifi
option mode <wifi_mode>
option ssid "<wifi_ssid>"
option ssid "<wifi_ssid>-<wifi_chanbw>-v3"
option encryption none
config wifi-iface

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

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
config button
option button 'reset'
option action 'released'
option handler '/usr/local/bin/bbhnrecoverymode'
option min '3'
option max '7'
config button
option button 'reset'
option action 'released'
option handler 'firstboot && reboot'
option min '12'
option max '20'

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

@ -1,3 +1,17 @@
config 'system'
option 'hostname' '<NODE>'
config button
option button 'reset'
option action 'released'
option handler '/usr/local/bin/bbhnrecoverymode'
option min '3'
option max '7'
config button
option button 'reset'
option action 'released'
option handler 'firstboot && reboot'
option min '12'
option max '20'

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

@ -1,3 +1,16 @@
config 'system'
option 'hostname' 'NOCALL'
config button
option button 'reset'
option action 'released'
option handler '/usr/local/bin/bbhnrecoverymode'
option min '3'
option max '7'
config button
option button 'reset'
option action 'released'
option handler 'firstboot && reboot'
option min '12'
option max '20'

View File

@ -0,0 +1,24 @@
. /lib/functions.sh
do_button () {
local button
local action
local handler
local min
local max
config_get button $1 button
config_get action $1 action
config_get handler $1 handler
config_get min $1 min
config_get max $1 max
[ "$ACTION" = "$action" -a "$BUTTON" = "$button" -a -n "$handler" ] && {
[ -z "$min" -o -z "$max" ] && eval $handler
[ -n "$min" -a -n "$max" ] && {
[ $min -le $SEEN -a $max -ge $SEEN ] && eval $handler
}
}
}
config_load system
config_foreach do_button button

View File

@ -18,7 +18,7 @@ if ( $ARGV[0] ) {
}
else
{
$SSIDName= lc "BroadbandHamnet-v2";
$SSIDName= lc "BroadbandHamnet-20-v3";
}

View File

@ -0,0 +1,20 @@
#!/bin/sh
DHCPLANSECTION=`uci show dhcp|grep interface=lan|sed "s/dhcp.\@dhcp\[\(.*\)\].interface=lan/\1/"`
logger "BBHN Recovery: Reseting password to BBHN default"
/usr/local/bin/setpasswd hsmm
logger "BBHN Recovery: Restarting uhttpd"
/etc/init.d/uhttpd restart
if [ "$DHCPLANSECTION" != "" ]
then
logger "BBHN Recovery: Enable DHCP on lan interface"
uci set dhcp.@dhcp\[$DHCPLANSECTION\].ignore=0
uci -q commit
logger "BBHN Recovery: Restart dnsmasq"
/etc/init.d/dnsmasq restart
fi

View File

@ -3,17 +3,21 @@
# wait for the watchdog file to appear
while(not -e "/tmp/olsrd.watchdog") { sleep 15 }
$stamp = 0;
$failcount = 0;
$last_olsrstamp = 0;
while(1)
{
$last_stamp = $stamp;
$stamp = time;
chomp ($olsr = `cat /tmp/olsrd.watchdog`);
$olsr = 0 unless $olsr;
# avoid false restarts due to changes in system time
if($stamp - $last_stamp < 20 and $stamp - $olsr > 20)
if ( $olsr && $olsr ne $last_olsrstamp ){
$failcount = 0;
} else {
$failcount += 1;
}
if( $failcount >= 3 )
{
($uptime) = `cat /proc/uptime` =~ /^(\d+)/;
$date = `date`;
@ -21,5 +25,7 @@ while(1)
system "/etc/init.d/olsrd restart";
}
sleep 15;
$last_olsrstamp = $olsr;
sleep 10;
}

View File

@ -269,6 +269,7 @@ while(1)
}
if($line =~ /\bESSID: "(.*)"/) { $ssid = $1 }
if($line =~ /\bESSID: unknown/) { $ssid = "unknown" }
if($line =~ /\bMode: (\S+)/) { $mode = $1 }
if($line =~ /\bChannel: (\d+)/) { $chan = $1 }
if($line =~ /\bSignal: ([\d-]+)/) { $signal = $1 }

View File

@ -8,6 +8,12 @@ use perlfunc;
sub rf_channel_map
{
%channellist = (
'900' => {
4 => "(907)",
5 => "(912)",
6 => "(917)",
7 => "(922)",
},
'2400' => {
1 => "1 (2412)",
2 => "2 (2417)",
@ -139,6 +145,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/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

@ -911,6 +911,17 @@ sub hardware_info
'usechains' => 0,
'rfband' => '2400',
},
'0xe009' => {
'name' => 'NanoStation Loco M9',
'comment' => 'NanoStation Loco M9',
'supported' => '1',
'maxpower' => '22',
'pwroffset' => '6',
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity" },
'defaultant' => 3,
'usechains' => 1,
'rfband' => '900',
},
'0xe012' => {
'name' => 'NanoStation M2',
'comment' => '',
@ -955,6 +966,17 @@ sub hardware_info
'usechains' => 1,
'rfband' => '5800ubntus',
},
'0xe1b9' => {
'name' => 'Rocket M9',
'comment' => 'Rocket M9',
'supported' => '1',
'maxpower' => '22',
'pwroffset' => '6',
'antennas' => { 1 => "Chain0", 2 => "Chain1", 3 => "Diversity"},
'defaultant' => 3,
'usechains' => 1,
'rfband' => '900',
},
'0xe202' => {
'name' => 'Bullet M2 HP',
'comment' => '',
@ -999,6 +1021,17 @@ sub hardware_info
'usechains' => 1,
'rfband' => '2400',
},
'0xe239' => {
'name' => 'NannoBridge M9',
'comment' => 'NanoBridge M9',
'supported' => '1',
'maxpower' => '22',
'pwroffset' => '6',
'antennas' => { 1 => "Horizontal", 2 => "Vertical", 3 => "Diversity" },
'defaultant' => 3,
'usechains' => 1,
'rfband' => '900',
},
'0xe242' => {
'name' => 'airGrid M2 HP',
'comment' => 'airGrid M2 HP',

View File

@ -85,8 +85,8 @@ if($dmz_mode)
}
# derive values which are not explicitly defined
$parms{dhcp_limit} = $dhcp_limit = $dhcp_end - $dhcp_start;
$parms{dmz_dhcp_limit} = $dmz_dhcp_limit = $dmz_dhcp_end - $dmz_dhcp_start;
$parms{dhcp_limit} = $dhcp_limit = $dhcp_end - $dhcp_start + 1;
$parms{dmz_dhcp_limit} = $dmz_dhcp_limit = $dmz_dhcp_end - $dmz_dhcp_start + 1;
#
# get the active wifi settings on a fresh page load
@ -172,13 +172,24 @@ if($parms{button_save})
}
}
if ($config eq "mesh"){
push (@errors, "invalid WiFi SSID") unless length $wifi_ssid <= 27;
} else
{
push (@errors, "invalid WiFi SSID") unless length $wifi_ssid <= 32;
}
if ( is_channel_valid($wifi_channel) != 1 )
{
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;
@ -482,7 +493,14 @@ else
if($wifi_proto ne "disabled")
{
print "<tr><td>SSID</td>\n";
print "<td><input type=text size=15 name=wifi_ssid value='$wifi_ssid'></td></tr>\n";
print "<td><input type=text size=15 name=wifi_ssid value='$wifi_ssid'>";
if ($config eq "mesh")
{
print "-$wifi_chanbw-v3</td></tr>\n";
} else
{
print "</td></tr>\n";
}
if($wifi_mode eq "ap")
{
@ -523,6 +541,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";