Problem: detectLocationtimersset() logic does not seem to work. I know the sub routine is fired but I guess the multiple if else is wrong ?
The the reason for detectLocationtimersset() was to have some logic to ensure multiple timers are not set.
I created the 1st if / else to set the timers based on datatime first then I wrote a second if / else to do the sense check.
detectLocation() has been tested and works in its own right.
var detectLocationtimerset = 0;
var datatime = 1;
function detectLocationtimersset() {    
    // Setup timer to check for new data start
    // check and see if set 
    if (detectLocationtimerset = 0 ) {
        detectLocationtimerset = 1;
        if (datatime == null) {
            datatime = 9;
            milliseconds = (datatime * 60000)
            setInterval(function () {
                detectLocation();
                console.log("detectLocation() timer set");
            }, milliseconds);   
        } else {
                    detectLocationtimerset = 1;
            milliseconds = (datatime * 60000)
            setInterval(function () {
                detectLocation();
                console.log("detectLocation() timer set");
            }, milliseconds);   
        }   
    }
};
 
     
     
    