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) {
}
continue;
}
//is RF enabled? (default to "on")
$meshRF = "on";
//pull out API version first
$api_version = $result['api_version'];
......@@ -307,6 +309,11 @@ if ($getNodeInfo) {
}else {
$node = $result['node'];
}
if (isset($result['meshrf']['status'])) {
if ($result['meshrf']['status'] == "off") {
$meshRF = "off";
}
}
}else {
$node = $result['node'];
}
......@@ -372,8 +379,16 @@ if ($getNodeInfo) {
else {
$chanbw = "0";
}
if ($meshRF == "off") {
$ssid = "NONE";
}else {
$ssid = $result['meshrf']['ssid'];
}
if ($meshRF == "off") {
$channel = "NONE";
}else {
$channel = $result['meshrf']['channel'];
}
$board_id = $result['node_details']['board_id'];
$firmware_version = $result['node_details']['firmware_version'];
$model = $result['node_details']['model'];
......@@ -473,9 +488,15 @@ if ($getNodeInfo) {
}else {
$lan_ip = "NotAvailable";
}
}elseif ($infInfo['name'] == $wlan) {
}elseif ($infInfo['name'] == $wlan && $meshRF == "on") {
$wlan_ip = $infInfo['ip'];
$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 {
if ($interface == $eth) {
......
......@@ -69,6 +69,8 @@ if($sysinfoJson === FALSE) {
}
exit();
}
//is RF enabled? (default to "on")
$meshRF = "on";
//pull out API version first
$api_version = $result['api_version'];
......@@ -81,6 +83,11 @@ if($sysinfoJson === FALSE) {
}else {
$node = $result['node'];
}
if (isset($result['meshrf']['status'])) {
if ($result['meshrf']['status'] == "off") {
$meshRF = "off";
}
}
}else {
$node = $result['node'];
}
......@@ -146,8 +153,16 @@ if($sysinfoJson === FALSE) {
else {
$chanbw = "0";
}
if ($meshRF == "off") {
$ssid = "NONE";
}else {
$ssid = $result['meshrf']['ssid'];
}
if ($meshRF == "off") {
$channel = "NONE";
}else {
$channel = $result['meshrf']['channel'];
}
$board_id = $result['node_details']['board_id'];
$firmware_version = $result['node_details']['firmware_version'];
$model = $result['node_details']['model'];
......@@ -245,9 +260,15 @@ if($sysinfoJson === FALSE) {
}else {
$lan_ip = "NotAvailable";
}
}elseif ($infInfo['name'] == $wlan) {
}elseif ($infInfo['name'] == $wlan && $meshRF == "on") {
$wlan_ip = $infInfo['ip'];
$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 {
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