Commit 058a3e7b authored by Eric - kg6wxc's avatar Eric - kg6wxc
Browse files

bugfix: restore links for node when RF gets turned off

When RF was turned off there was no longer a wlan_ip to go off to build the links.
There is actually still a psuedo IP, the mapping script just wasn't looking for it.
Now it will find this IP if it detects "meshrf = off" in the json file.
parent 61646a0f
...@@ -295,6 +295,8 @@ if ($getNodeInfo) { ...@@ -295,6 +295,8 @@ if ($getNodeInfo) {
} }
continue; continue;
} }
//is RF enabled? (default to "on")
$meshRF = "on";
//pull out API version first //pull out API version first
$api_version = $result['api_version']; $api_version = $result['api_version'];
...@@ -307,6 +309,11 @@ if ($getNodeInfo) { ...@@ -307,6 +309,11 @@ if ($getNodeInfo) {
}else { }else {
$node = $result['node']; $node = $result['node'];
} }
if (isset($result['meshrf']['status'])) {
if ($result['meshrf']['status'] == "off") {
$meshRF = "off";
}
}
}else { }else {
$node = $result['node']; $node = $result['node'];
} }
...@@ -372,8 +379,16 @@ if ($getNodeInfo) { ...@@ -372,8 +379,16 @@ if ($getNodeInfo) {
else { else {
$chanbw = "0"; $chanbw = "0";
} }
$ssid = $result['meshrf']['ssid']; if ($meshRF == "off") {
$channel = $result['meshrf']['channel']; $ssid = "NONE";
}else {
$ssid = $result['meshrf']['ssid'];
}
if ($meshRF == "off") {
$channel = "NONE";
}else {
$channel = $result['meshrf']['channel'];
}
$board_id = $result['node_details']['board_id']; $board_id = $result['node_details']['board_id'];
$firmware_version = $result['node_details']['firmware_version']; $firmware_version = $result['node_details']['firmware_version'];
$model = $result['node_details']['model']; $model = $result['node_details']['model'];
...@@ -473,9 +488,15 @@ if ($getNodeInfo) { ...@@ -473,9 +488,15 @@ if ($getNodeInfo) {
}else { }else {
$lan_ip = "NotAvailable"; $lan_ip = "NotAvailable";
} }
}elseif ($infInfo['name'] == $wlan) { }elseif ($infInfo['name'] == $wlan && $meshRF == "on") {
$wlan_ip = $infInfo['ip']; $wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac']; $wifi_mac_address = $infInfo['mac'];
}elseif ($infInfo['name'] == $wlan && $meshRF == "off") {
$wifi_mac_address = $infInfo['mac'];
}elseif ($meshRF == "off") {
if (strpos($infInfo['name'], ".3975") !== false) {
$wlan_ip = $infInfo['ip'];
}
} }
}else { }else {
if ($interface == $eth) { if ($interface == $eth) {
......
...@@ -69,6 +69,8 @@ if($sysinfoJson === FALSE) { ...@@ -69,6 +69,8 @@ if($sysinfoJson === FALSE) {
} }
exit(); exit();
} }
//is RF enabled? (default to "on")
$meshRF = "on";
//pull out API version first //pull out API version first
$api_version = $result['api_version']; $api_version = $result['api_version'];
...@@ -81,6 +83,11 @@ if($sysinfoJson === FALSE) { ...@@ -81,6 +83,11 @@ if($sysinfoJson === FALSE) {
}else { }else {
$node = $result['node']; $node = $result['node'];
} }
if (isset($result['meshrf']['status'])) {
if ($result['meshrf']['status'] == "off") {
$meshRF = "off";
}
}
}else { }else {
$node = $result['node']; $node = $result['node'];
} }
...@@ -146,8 +153,16 @@ if($sysinfoJson === FALSE) { ...@@ -146,8 +153,16 @@ if($sysinfoJson === FALSE) {
else { else {
$chanbw = "0"; $chanbw = "0";
} }
$ssid = $result['meshrf']['ssid']; if ($meshRF == "off") {
$channel = $result['meshrf']['channel']; $ssid = "NONE";
}else {
$ssid = $result['meshrf']['ssid'];
}
if ($meshRF == "off") {
$channel = "NONE";
}else {
$channel = $result['meshrf']['channel'];
}
$board_id = $result['node_details']['board_id']; $board_id = $result['node_details']['board_id'];
$firmware_version = $result['node_details']['firmware_version']; $firmware_version = $result['node_details']['firmware_version'];
$model = $result['node_details']['model']; $model = $result['node_details']['model'];
...@@ -245,9 +260,15 @@ if($sysinfoJson === FALSE) { ...@@ -245,9 +260,15 @@ if($sysinfoJson === FALSE) {
}else { }else {
$lan_ip = "NotAvailable"; $lan_ip = "NotAvailable";
} }
}elseif ($infInfo['name'] == $wlan) { }elseif ($infInfo['name'] == $wlan && $meshRF == "on") {
$wlan_ip = $infInfo['ip']; $wlan_ip = $infInfo['ip'];
$wifi_mac_address = $infInfo['mac']; $wifi_mac_address = $infInfo['mac'];
}elseif ($infInfo['name'] == $wlan && $meshRF == "off") {
$wifi_mac_address = $infInfo['mac'];
}elseif ($meshRF == "off") {
if (strpos($infInfo['name'], ".3975") !== false) {
$wlan_ip = $infInfo['ip'];
}
} }
}else { }else {
if ($interface == $eth) { if ($interface == $eth) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment