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

get-map-info, map_display and map_functions updated.

Added "ini_set('memory_limit', '128M') to get-map-info and map_display.
If you have a large network, you may need to increase the amount of
memory needed. 128M should be more than enough in most cases, unless you
have a "Mega Mesh" like N2MH does. :)

Added "last_seen" info to the station popups (map_functions.inc)

Also added (hopefully) a catch in get-map-info to find a "stalled" node
polling run.
Sometimes the node polling portion of the script never completes and it
never gets a chance to unset the "currently_running" bit in the
database.
There is now a check so that if the "currently_running" bit is 1 and the
time the script last polled the node is greater than 3 * the
"node_polling_interval" (from the ini file), then the script will just
go out and poll the nodes as normal.
If it completes, it will unset the "currently_running" bit and will
update the timestamp.

These changes have all been suggested by N2MH. Thanks Mark! I finally
got to it!
parent 29338826
#!/usr/bin/env php
<?php $mtimeStart = microtime(true);
//testing
/*************************************************************************************
* get-map-info script v2 by kg6wxc\eric satterlee kg6wxc@gmail.com
* This script is the heart of kg6wxcs' mesh map system.
......@@ -46,6 +45,9 @@ require $INCLUDE_DIR . "/scripts/wxc_functions.inc";
//the "@" just suppresses any errors if the file is not found, the file is optional
@include $INCLUDE_DIR . "/custom.inc";
//Increase PHP memory limit to 128M (you may need more if you are connected to a "Mega Mesh" :) )
ini_set('memory_limit', '128M');
/***********************************************************************
*DO NOT CHANGE ANYTHING BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING!!!!
************************************************************************/
......@@ -101,11 +103,6 @@ if ($TEST_MODE_NO_SQL) {
$getNodeInfo = 0;
}
//this is probably missing for you, do not worry about it.
//It just contains very site specific things, you don't need it.
//@include $INCLUDE_DIR . "/wxc_custom.inc";
//$wxc_custom = 0;
//(WiP)checks for some things we need to run
//(currently only really checks for the mysqli php extension
wxc_checkConfigs();
......@@ -114,16 +111,6 @@ wxc_checkConfigs();
date_default_timezone_set($USER_SETTINGS['localTimeZone']);
$currentTime = wxc_getCurrentDateTime();
//this just tells the script if kg6wxc's custom stuff is there or not
//it should not effect your site at all.
//It's safe to leave it here unless you have major problems because of it.
//That shouldn't really happen. Don't change unless you know what you are doing.
//foreach (get_included_files() as $filename) {
// if (strpos($filename, 'wxc_custom.inc')) {
// $wxc_custom = 1;
// }
//}
$sql_db_tbl = $USER_SETTINGS['sql_db_tbl'];
$sql_db_tbl_node = $USER_SETTINGS['sql_db_tbl_node'];
$sql_db_tbl_topo = $USER_SETTINGS['sql_db_tbl_topo'];
......@@ -198,6 +185,13 @@ if ($do_sql) {
//if ($currently_polling_nodes['script_last_run'])
$getNodeInfo = 0;
}
//hopefully catch a stalled polling run after 3 * node_polling_interval has expired.
//something may have gone wonky and the node polling run never completed and never had a chance
//to unset the "currently_running" bit in the DB,
//this *should* catch that and and just run the node polling again
if ($currently_polling_nodes['currently_running'] == 1 && $intervalNodeInMinutes >= intval($USER_SETTINGS['node_polling_interval']) * 3) {
$getNodeInfo = 1;
}
}
//check for old outdated node info (intervals will be set in the ini file)
......
......@@ -498,6 +498,7 @@ function build_Marker($node_info, $node_ServiceList, $node_LinkedList, $node_Fir
"', icon: " . $icon . "}).bindPopup(\" " . $nodeUrl . " (" . $band . ")<br>" . $node_info['lat'] .
", " . $node_info['lon'] . "<br>SSID: " . $node_info['ssid'] . "<br>Channel: " . $node_info['channel'] .
", Bandwidth: " . $node_info['chanbw'] . "<br>" . $node_info['model'] . "<br>" . $firmware .
"<br>Last Polled: " . $node_info['last_seen'] .
$node_ServiceList . $node_LinkedList . "\").addTo(" . $AssignedLayer . ") ,\n"; // Close out this node
/*
* If Upgrade Suggested add Node to that layer
......
......@@ -107,6 +107,9 @@ $USER_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/user-settings.ini");
global $MESH_SETTINGS;
$MESH_SETTINGS = parse_ini_file($INCLUDE_DIR . "/scripts/meshmap-settings.ini");
//Increase PHP memory limit to 128M (you may need more if you are connected to a "Mega Mesh" :) )
ini_set('memory_limit', '128M');
/*******************************************************
*YOU REALLY SHOULD NOT NEED TO EDIT ANYTHING BELOW HERE*
*******************************************************/
......
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