Commit c32015e7 authored by Eric - kg6wxc's avatar Eric - kg6wxc
Browse files

Bug Fix: get-map-info.php, map-display.php

Due to commit before this I also noticed non-nodes were being put into
the database.
There were over a 100 in my database alone.
These are most likely non-node devices and will never be able to be
mapped.
Initially, I opted for a "save and recheck" style of polling, in the
hopes that something was just missed and it would get picked up later.
This is not the case and over time I think can see what is happening.

added a check in get-map-info.php to try and skip these devices if we
reach one, and due to that change, the numbers of shown and not show
node and links at the bottom right of the map is more accuate now (I
hope).

73
parent 8837d7fd
......@@ -314,6 +314,19 @@ if ($getNodeInfo) {
//$node = $GLOBALS['node'] = $result['node'];
$node = $result['node'];
//if it's nothing other than the node name, it's some other device
//or something else entirely...
//people hack things onto the mesh all the time
//
//kg6wxc is *not* guilty of such things... :)
//
//just a few checks for nothing usually catches it.
if ($node && $result['lat'] == "" && $result['lon'] == "" && $result['ssid'] == ""
&& $result['model'] == "" && $result['firmware_mfg'] == ""
&& $result['api_version'] == "") {
continue;
}
//gather lots of other information from OLSRD about the node being polled (we hopefully can use this later)
//this requires a second connection to the node. no way around that.
//but only if we have a firmware version >= than 3.16.0 (or "develop-16")
......
......@@ -410,7 +410,9 @@ echo "</div>\n";
//just using this for now.
//it is still giving the wrong number WXC -april 2018
$numNodes = wxc_getMySql("SELECT COUNT(*) as nodesWithLocations FROM node_info where (lat is not null or 0 or '') and (lon is not null or 0 or '')");
//changing this based on other changes to get-map-info - may 2018
//$numNodes = wxc_getMySql("SELECT COUNT(*) as nodesWithLocations FROM node_info where (lat is not null or 0 or '') and (lon is not null or 0 or '')");
$numNodes = wxc_getMySql("SELECT COUNT(*) as nodesWithLocations FROM node_info where (lat != '0') and (lon != '0')");
$numNodes = $numNodes['nodesWithLocations'];
$numNodesTotal = count($NodeList);
......@@ -420,7 +422,9 @@ $numMarkers = count($MarkerList);
//$numLinks = count($TopoList); // WXC change: probably the same thing going on here too
//just using this for now
//same here, probably still giving the wrong number WXC - april 2018
$numLinks = wxc_getMySql("SELECT COUNT(*) as linksWithLocations FROM topology WHERE (nodelat is not null or 0 or '' or '0') and (nodelon is not null or 0 or '' or '0') or (linklat is not null or 0 or '' or '0') and (linklon is not null or 0 or '' or '0')");
//changing this based on other changes to get-map-info - may 2018
//$numLinks = wxc_getMySql("SELECT COUNT(*) as linksWithLocations FROM topology WHERE (nodelat is not null or 0 or '' or '0') and (nodelon is not null or 0 or '' or '0') or (linklat is not null or 0 or '' or '0') and (linklon is not null or 0 or '' or '0')");
$numLinks = wxc_getMySql("SELECT COUNT(*) as linksWithLocations FROM topology WHERE (nodelat != '0') and (nodelon != '0') or (linklat != '0') and (linklon != '0')");
$numLinks = $numLinks['linksWithLocations'];
$numLinksTotal = count($TopoList);
......
Markdown is supported
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