WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: HamiltonNJWX on November 27, 2022, 02:20:16 PM

Title: Rain Not updating in realtime & error
Post by: HamiltonNJWX on November 27, 2022, 02:20:16 PM
Good Day, all. i just noticed that my dashboard has stopped updating rain in realtime. I must do a refresh to see that. I only have this occurring with the rain - all else seems to be updating properly. I also started getting the error :

Notice: Undefined variable: month_rain in /home/hamilton/www/www/raintodate.php on line 127

figure it has to be related, but cannot see what is causing it.

Thanks in advance!

John
www.hamiltonwx.com (http://www.hamiltonwx.com)
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on November 27, 2022, 03:57:07 PM
I'm not sure where the script raintodate.php is getting the $month_rain number from.  The testtags.php has $monthrn as the variable with the monthly rain number.  That data is also in clientraw[8] (Monthly rain).  I don't know where the script is getting the value .. you'll need to post the script (as .txt) to enable further diagnosis.
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on November 27, 2022, 05:35:20 PM
Thanks again, as always, Ken.  [ You are not allowed to view attachments ]
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on November 27, 2022, 05:37:38 PM
Not sure if that went through, Ken.

Raintodate.php in text format.

<?php
############################################################################
$start_year = 2020; // set to first year of dailynoaareport files available
$rain_places = 2; // set to how many decimal places for rain
$loc = "./"; // set to path of dailynoaareport files
############################################################################
if (isset($_REQUEST['sce']) && ( strtolower($_REQUEST['sce']) == 'view' or
    strtolower($_REQUEST['sce']) == 'show') ) {
   //--self downloader --
   $filenameReal = __FILE__;
   $download_size = filesize($filenameReal);
   header('Pragma: public');
   header('Cache-Control: private');
   header('Cache-Control: no-cache, must-revalidate');
   header("Content-type: text/plain");
   header("Accept-Ranges: bytes");
   header("Content-Length: $download_size");
   header('Connection: close');

   readfile($filenameReal);
   exit;
}

if(!function_exists('getnoaafile')) {
       
 # GETNOAAFILE function
# Developed by TNETWeather.com
#
# Returns an array of the contents of the specified filename
# Array contains days from 1 - 31 (or less if the month has less) and
# the values:
# Day
# Mean Temp
# High Temp
# Time of High Temp
# Low Temp
# Time of Low Temp
# Hot Degree Day
# Cold Degree Day
# Rain
# Avg Wind Speed
# High Wind
# Time High Wind
# Dom Wind Direction
############################################################################

function getnoaafile ($filename) {
    global $SITE;               
   
    $rawdata = array();
   
    $fd = @fopen($filename,'r');
   
    $startdt = 0;
    if ( $fd ) {
   
        while ( !feof($fd) ) {
       
            // Get one line of data
            $gotdat = trim ( fgets($fd,8192) );
           
            if ($startdt == 1 ) {
                if ( strpos ($gotdat, "--------------" ) !== FALSE ){
                    $startdt = 2;
                } else {
                    $foundline = preg_split("/[\n\r\t ]+/", $gotdat );                   
                    $rawdata[intval ($foundline[0]) -1 ] = $foundline;
                }
            }
       
            if ($startdt == 0 ) {
                if ( strpos ($gotdat, "--------------" ) !== FALSE ){
                    $startdt = 1;
                }
            }
        }
        // Close the file we are done getting data
        fclose($fd);
    }   
    return($rawdata);

}

$today = getdate();
$year = $today['year'];
$month = $today['mon'];
$day = $today['mday'];

$alltimeaverage = array($avrainjan,$avrainfeb,$avrainmar,$avrainapr,$avrainmay,$avrainjun,$avrainjul,
                                $avrainaug,$avrainsep,$avrainoct,$avrainnov,$avraindec);

$avg_ytd_rain = 0; 
// Get the total rain averages for the month(s) preceding the current month
    for ($i = 0 ; $i < ($month-1) ; $i++)
        {
        $avg_ytd_rain = $avg_ytd_rain + $alltimeaverage[$i];
        }
       
// Calculate the average rain to date for the current month of previous years         
$avg_mtd_rain = get_mtd_rain ($start_year,$day,$month,$year,$loc);
$avg_mtd_rain = number_format((round($avg_mtd_rain,2)),$rain_places);

$avg_ytd_rain = $avg_ytd_rain + $avg_mtd_rain;                               
$avg_ytd_rain = number_format((round($avg_ytd_rain,2)),$rain_places);
   
########## Functions ##########################################################
 
function get_mtd_rain ($start_year,$day,$month,$year,$loc)
{
$years = $year - $start_year;
$months = 0;   
for ($i = 0 ; $i < $years ; $i++)
    {   
$filename = "dailynoaareport" . ( $month) . ($start_year + $i) . ".htm";

if (file_exists($loc . $filename) )   
    {
    $data[0] = getnoaafile($loc . $filename);
    $months = $months + 1;
    // Now get data from the dailynoaareport for this month from the 1st to today's date'.

    for ($d = 0 ; $d < $day ; $d++)
        {
        $rain = $data[0][$d][8];
        if ($rain != "")
           {
           $month_rain = $month_rain + $rain;
                   
           }   
        }
    }
    }
if ($months == 0) {
    $mtd_rain = 0;
} else {   
        $mtd_rain = $month_rain / $months;   
       }   
return $mtd_rain;   
}

         
############################################################################
# End of Functions
############################################################################

?> 
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on November 27, 2022, 06:35:17 PM
This appears to be reading the dailynoaareport*.htm files for data.  The Undefined message is due to $month_rain being (well) undefined.. no prior statement initializes it.  Also, the dailynoaareport file is only updated once per day at midnight for the prior day's data, so shouldn't be expected to be 'realtime' for today.

Where is this script used? 
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on November 27, 2022, 07:04:35 PM
It was a file in the alternative ajax dashboard ver 6.95b+. As per the directions, it said to load all php files, so i did.  I thought it was for compiling the data in the rain field on the dashboard.

John
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on November 27, 2022, 07:33:35 PM
Not sure if this is of any help to you, but i reloaded another copy of the file directly from the download package and installed it. The error is now gone, but the Nov to Date Avg has gone to zero. Prior to doing this, it had a value of 2.34 in.

John
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on November 28, 2022, 07:06:48 AM
I think I am more concerned about the current rain, rate and totals not updating in realtime. The rain has stopped here, no error is shown, but the month to date totals are also no longer shown.

John
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on November 30, 2022, 04:36:34 PM
I have also noticed that the wind rose does not update. i tried some things to see if i could eliminate or move the issues. i changed the .JS file we are supposed to use from the ajaxWDwx3.JS back to the one used on the regular dashoard (ajaxWDws.JS) and it then updated the windrose, direction text and wind in realtime, but had no effect on the rain. I have since switched it back.
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on December 01, 2022, 09:00:26 AM
Morning!  After taking down the webpages with attempts to correct, i decided to upload fresh files from the alt dashboard files. All is back up, with the following issues:

Rain does not update realtime
Wind direction does not update realtime

If i switch to ajaxWXwd.js , the wind direction will update realtime, but there is no updating on the lower items.

I also realized that i maybe should not be posting this here, but in the sister board. Let me know if you would like me to do that from now on.

Sorry for the inconvenience all.

John
Title: Re: Rain Not updating in realtime & error
Post by: hcorrin on December 02, 2022, 04:20:56 AM
You have double checked that the ajaxWDwd3 is pointing to the clientraw.txt line 320
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on December 02, 2022, 09:07:13 AM
You have double checked that the ajaxWDwd3 is pointing to the clientraw.txt line 320


thanks, yeah. Still digging through things to see if I missed something
Title: Re: Rain Not updating in realtime & error
Post by: andro700 on December 04, 2022, 01:11:11 PM
I have noticed that as well. I have the same thing using ajax 6.95e version.  It worked on the previous version before the update for PHP 8.0.

Chuck
Title: Re: Rain Not updating in realtime & error
Post by: hcorrin on December 04, 2022, 07:18:33 PM
What version of php 8 were you using and what has it been updated too
Title: Re: Rain Not updating in realtime & error
Post by: andro700 on December 04, 2022, 07:31:15 PM
I believe my webhost was on version 8.1.4 and now they are running 8.1.11. I have to reload the page to update the rain data.

Chuck
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on December 04, 2022, 07:42:39 PM
In ajaxWDwx3.js there is
Code: [Select]
      rain        = parseFloat( clientraw[ 7]).convertRain();
and
Code: [Select]
      set_ajax_obs("ajaxrain2"      ,rain   .toFixed(dp.Rain)   +' '+ uom.Rain);
to set the value on the dashboard as
Code: [Select]
<span class="ajax" id="ajaxrain2"><span class="convRain"><?php printf("%8.2f"strip_units($dayrn)); echo $uomRain?></span></span>so if the value is changing in clientraw.txt, it should show up on the ajax-dashboard6.php display.

Title: Re: Rain Not updating in realtime & error
Post by: andro700 on December 05, 2022, 12:50:20 PM
Mine is set up exactly that way but for some reason it does not update in realtime.

Chuck
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on December 05, 2022, 04:48:24 PM
In ajaxWDwx3.js there is
Code: [Select]
      rain        = parseFloat( clientraw[ 7]).convertRain();
and
Code: [Select]
      set_ajax_obs("ajaxrain2"      ,rain   .toFixed(dp.Rain)   +' '+ uom.Rain);
to set the value on the dashboard as
Code: [Select]
<span class="ajax" id="ajaxrain2"><span class="convRain"><?php printf("%8.2f"strip_units($dayrn)); echo $uomRain?></span></span>so if the value is changing in clientraw.txt, it should show up on the ajax-dashboard6.php display.

The first two lines are in ajaxWDwx3.js   --- in ajaxdashboard6 , it has this code

<td valign="middle" style="text-align: center;" >
                        <?php echo "<img src=\"${imagesDir}raindrop.jpg\" alt=\"Current Rain\" />"; ?>
                    </td>
                    <td valign="middle" style="text-align: center; border: 1px solid gray;" >
                        <?php langtrans('Rain'); ?>:<br/>
                        <span style="font-size: 18px" class="ajax" id="ajaxrain">
                        <?php echo strip_units($dayrn) . $uomRain; ?></span>
                    </td>

Is this correct?
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on December 05, 2022, 04:59:47 PM
I believe my webhost was on version 8.1.4 and now they are running 8.1.11. I have to reload the page to update the rain data.

Chuck

I just checked mine.. i had 8.1.11 as well. bumped it down to 8.0.24, tipped the bucket, but didnt register until i did a manual refresh.
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 16, 2023, 03:00:33 PM
Is it possible that the issue is with the Ajax version that is used with the Alt Dashboard? Could it not work with newer versions of PHP? I can only go down to 7.4 on my server. I have tried everything from 7.4 and up and it does not work - it works perfectly if i go to Ken's dashboard with the different ajax version. I know the easy fix would be to drop the alt dashboard, but i really like the layout.
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 16, 2023, 03:16:28 PM
The ajaxWDwx3.js alternative dashboard JavaScript has
Code: [Select]
      rain        = parseFloat( clientraw[ 7]).convertRain();

      set_ajax_obs("ajaxrain"       ,rain   .toFixed(dp.Rain)   +' '+ uom.Rain);
      set_ajax_obs("ajaxrain2"      ,rain   .toFixed(dp.Rain)   +' '+ uom.Rain);
so both instances on the dashboard should update from clientraw[7].
The ajaxWDwx3.js is JavaScript and only runs in the browser, so is not related to PHP version.  The PHP version would be a factor in the ajax-dashboard6.php however.  I see you're running V6.95e and there is a 6.95f version available which supports PHP 7 and PHP8 to PHP 8.2
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 16, 2023, 03:26:34 PM
Thank you, Ken, as always!  I know there is no longer support on this, but do house the 6.95f version on your homepage? I looked rather quickly and did not see it.





The ajaxWDwx3.js alternative dashboard JavaScript has
Code: [Select]
      rain        = parseFloat( clientraw[ 7]).convertRain();

      set_ajax_obs("ajaxrain"       ,rain   .toFixed(dp.Rain)   +' '+ uom.Rain);
      set_ajax_obs("ajaxrain2"      ,rain   .toFixed(dp.Rain)   +' '+ uom.Rain);
so both instances on the dashboard should update from clientraw[7].
The ajaxWDwx3.js is JavaScript and only runs in the browser, so is not related to PHP version.  The PHP version would be a factor in the ajax-dashboard6.php however.  I see you're running V6.95e and there is a 6.95f version available which supports PHP 7 and PHP8 to PHP 8.2
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 16, 2023, 03:29:01 PM
Disregard..... found!
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 16, 2023, 04:41:49 PM
Hey, Ken. I uploaded the new version and all files that accompanied it. I get error messages and blank pages if i try to up my webpages PHP version above 7.4  --- I have also updated all necessary files with your check fetch times tool. still digging. If you have any suggestions it would be very appreciated.

     BTW, the rain and windrose are still not updating no matter what PHP version i choose.
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 16, 2023, 04:50:41 PM
Since I'm older now, and any clairvoyance I may have had has faded, I can't see what error messages you are referring to.

Please copy some from your website error_log and paste as a code section so I can understand what might be wrong with your site on PHP 8.
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 16, 2023, 05:39:36 PM
www.hamiltonwx.com [Thu Feb 16 08:35:48 2023] [error] [pid 20786] apache2_util.c(273): [client 114.119.156.33:33874] [client 114.119.156.33] ModSecurity: Access denied with code 412 (phase 2). Pattern match "PetalBot" at REQUEST_HEADERS:User-Agent. [file "/apache/conf/includes/mod_security2.conf"] [line "453"] [id "425"] [hostname "hamiltonwx.com"] [uri "/wxhistory.php"] [unique_id "Y-4xNMTFlIIN2n1LP9HfpAAAEPk"]
www.hamiltonwx.com [Thu Feb 16 08:41:29 2023] [error] [pid 62226] apache2_util.c(273): [client 114.119.150.186:34256] [client 114.119.150.186] ModSecurity: Access denied with code 412 (phase 2). Pattern match "PetalBot" at REQUEST_HEADERS:User-Agent. [file "/apache/conf/includes/mod_security2.conf"] [line "453"] [id "425"] [hostname "hamiltonwx.com"] [uri "/ajax-images/moon22.gif"] [unique_id "Y-4yiaB-YOqA5Ph7_xFRCgAABS8"]
www.hamiltonwx.com [Thu Feb 16 17:14:10 2023] [error] [pid 46505] mod_cgid.c(1080): [client 190.145.68.131:55626] AH01264: script not found or unable to stat: /home/hamilton/www/www/wp-login.php

I also get a blank page (no errors) with Murray's wxnoaarecords.php

and get a scrolling error for about 30 lines in wxnoaaclimatereports.php that says:

Warning: Undefined variable $year in /home/hamilton/www/www/include-NOAA-reports.php on line 254

Once i switch back to version 7.4, the error goes away and Murray's page shows up.

Let me know if you want me to set it at version 8.0 and you can go and see what I mean.
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 16, 2023, 06:00:06 PM
So the three error_log entries you posted were:
2 entries for a Bot that was denied access to your site by mod_security .. not an update issue.
1 entry for another bot looking for a non-existent page (wp-login.php) .. not an update issue

Murray's wxnoaarecords.php is old code .. likely needs replacement of all ${varname} with {$varname) form and maybe some other errors too.  It's not one of the scripts I distribute (or maintain) from my legacy-scripts area.  I think there may be fixes available .. do a forum search here and on weather-watch.com.

The include-NOAA-reports.php is not a core script on Weather-Display.  The wxnoaaclimatereports.php using that include was likely made for Weather-Display by someone else (Beteljuice?) using some of my NOAA reports scripts I do support for WeatherLink,Cumulus/CumulusMX, and weewx, but not for Weather-Display.
Problems with any of the scripts showing in check-fetch-times.php?show=versions I do fully support .. third-party add-on scripts should be supported by their respective authors.
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 16, 2023, 06:02:16 PM
Thanks, Ken. Would this be contributing to the wind rose not updating and live rain not updating unless you do a refresh?
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 16, 2023, 06:37:25 PM
Are you talking about the wind direction indicator in the second column, first row of the alternative dashboard?  If so, yes, it should be updating as wind direction changes.  Right now you're showing Calm (no direction as no current wind).  The two rain displays (second column, first row, and second column, second row) for Rain/Today should update with ajaxWDwx3.js.  Since it doesn't appear to be raining at your location (no recent bucket tip), can't tell why.

I took a look at your include-NOAA-reports.php (marked as V2.07), but.. my current (non-WD version) being distributed is Version 2.08 - 27-Dec-2022
I do see why PHP 8 gripes about your copy.. the ${variable} all have to be changed to {$variable} syntax as the former syntax was deprecated in PHP 8.1 and removed in PHP 8.2.  Sigh.

I've attached a copy of the include-NOAA-reports.php (your version) fixed for PHP 8 (I think).  Give it a try.

As for the error message about $year, it may just be your noaareportyear$yr.htm file is missing on your site ?!?

Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 17, 2023, 08:31:43 AM
Hey, Ken. Just a follow up.... I still had the errors on the reports after your file was updated. Thank you so much for the work you do.  I ditched the alt dashboard and went back to yours and it works fine.  This morning with it raining, the totals didnt match the vp console readings even AFTER a refresh. Installed yours back in and wind rose and rain updating realtime.

I will wait to see if anyone else reports anything and maybe try the alt dashboard at a later time.

Thanks again
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 18, 2023, 01:28:38 PM
I've had some time to retrofit support for OWM, PW, VC forecasts into the ajax-dashboard6.php.  I also discovered the issue with rain display not updating (was a missing span tag and two instances of id="ajaxrain") .. Fixed in 6.95g update (and an update to ajaxWDwx3.js JavaScript).  I've attached the two for you to try out.
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 18, 2023, 01:55:48 PM
You rock, Ken!  Gonna do a bucket tip to test. is there any direction i can look to for the wind direction not changing? I printed out both of the files (old and new) to check the changes you have made. Thank you so much for your assistance. Will let you know about the rain results.


 
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 18, 2023, 04:34:33 PM
Argggh... looks like a 'fix' I'd put in to 6.95e for wind was in error.  Now corrected.  Use both 6.95g ajaxWDwx3.js and ajax-dashboard6.php from the new 6.95g distribution in the legacy scripts area or the updated ones attached.  Now both Rain and Wind update as expected.
Title: Re: Rain Not updating in realtime & error
Post by: hcorrin on February 19, 2023, 02:48:34 PM
Hi Ken put the latest altdashboard on https://www.hc-iom.co.uk/WD-AJAX3/index.php give one or two error for me although they disappear if display error is set to 0 as https://www.hc-iom.co.uk/WD-AJAX1/index.php but the day/night record just show &deg C no info and will relate to the error on line 3071
not sure about the error on line 2389 to do with rain differance
these two links are using php 8.0.26
the other thing i noticed when comparing the old and new for my settings was that the ($ on the image dir lines in the old version have reverted back to $(  in the new one
the tide error are not an issue
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 19, 2023, 04:27:13 PM
@hcorrin, I haven't debugged the Tides section (since I'm inland and don't use it) but will try with your tides file and settings.

Regarding the 2 warnings at 547/548, that looks like a string->float issue.  I'll try explicitly declaring that.

I just checked the 6.95g ajax-dashboard6.php and it has all the {$variable} syntax for images.  The old one was the one with ${variable} syntax, AFIK.
Title: Re: Rain Not updating in realtime & error
Post by: hcorrin on February 19, 2023, 06:15:18 PM
strange
the attached is the original file i downloaded earlier this evening my time before my changes, hence my query or am i not thinking correctly i have amended my working copies please correct me if i have got it wrong
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 20, 2023, 10:59:58 AM
Nope, I have it wrong.. thanks for spotting the issue.  I've installed wxtide32 in WD (and found the ancient ./tides/ set of images) and will be releasing 6.95h with the fixed ${variable} notations too.  THANK YOU!
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 20, 2023, 11:39:43 AM
Ok.. think I've fixed the tides issue and all the prior ${variable} ones.  Try this please.
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 20, 2023, 03:57:03 PM
@hcorrin, looks like the tide display is now fixed on https://www.hc-iom.co.uk/WD-AJAX1/index.php

The other notifications are all due to your testtags.php including units in the measurements.
Change WD, Control Panel, WebFiles/Webpage, Custom webpage:
untick 'include the Units used'

That should fix the remaining issues.
Title: Re: Rain Not updating in realtime & error
Post by: Vasco on February 20, 2023, 04:35:16 PM
@hcorrin, looks like the tide display is now fixed on https://www.hc-iom.co.uk/WD-AJAX1/index.php

Don't think he uses PST, Ken  :-)
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 20, 2023, 05:28:23 PM
Looks like he fixed it.. now showing GMT
Title: Re: Rain Not updating in realtime & error
Post by: hcorrin on February 20, 2023, 06:25:06 PM
if your referring to time on the tide dial when the page is first loaded it is wrong and only corrects if the page is refreshed but not actually sure what's wrong been doing it a while
Title: Re: Rain Not updating in realtime & error
Post by: hcorrin on February 20, 2023, 06:37:30 PM
removing the units has sorted the errors but the daytime nitetime have 2 deg C with the values
https://www.hc-iom.co.uk/WD-AJAX3/index.php   with error on
https://www.hc-iom.co.uk/WD-AJAX1/index.php  normal altdash page with error off
Title: Re: Rain Not updating in realtime & error
Post by: hcorrin on February 20, 2023, 06:53:11 PM
i think i may have missed a setting some where ref my last post
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 21, 2023, 11:42:06 AM
Argggh... looks like a 'fix' I'd put in to 6.95e for wind was in error.  Now corrected.  Use both 6.95g ajaxWDwx3.js and ajax-dashboard6.php from the new 6.95g distribution in the legacy scripts area or the updated ones attached.  Now both Rain and Wind update as expected.

Morning, Ken!  The wind updating issue is completely fixed!  I will have to wait on the rain issue, as it rained overnight when i was fast asleep!  More rain this afternoon, so i will monitor and let you know the results!

Thanks again for everything!!

Title: Re: Rain Not updating in realtime & error
Post by: hcorrin on February 21, 2023, 04:18:07 PM
yes I fell foul of the wrong .js in settings-weather once corrected that sorted all bar the gremlin in the tides bit as ref in post #41
https://www.hc-iom.co.uk/WD-AJAX1/index.php
https://www.hc-iom.co.uk/WD-AJAX3/index.php is used for testing
Title: Re: Rain Not updating in realtime & error
Post by: HamiltonNJWX on February 22, 2023, 05:58:10 PM
@saratogaWX . Hey, Ken. Everything is working except for the rain not updating in real time. After dinner, i am going to go through the ajax script and see if anything stands out when i compare to other variables.

Thanks for all your help on this.

John
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on February 23, 2023, 04:40:37 PM
It should be if you've updated both ajaxWDwx3.js and ajax-dashboard6.php on your website.  You may need to clear your browser cache (do a shift-reload) to get the updated ajaxWDwx3.js to work for you.

I just checked your site, tried clicking on metric and imperial and saw green flash on both rain today displays (and units changing) so I think browser caching is preventing you from seeing the final results...
Title: Re: Rain Not updating in realtime & error
Post by: andro700 on February 28, 2023, 02:07:40 PM
My dewpoint last hour is showing in the negative.
https://www.goblesweather.com/index.php (https://www.goblesweather.com/index.php)

Chuck
Title: Re: Rain Not updating in realtime & error
Post by: saratogaWX on March 01, 2023, 01:38:29 PM
The underlying value is
Code: [Select]
$dewchangelasthour =  '-0.9';    // Dew point change last hour from testtags.php.

Somehow, the convDdif is converting that really wrongly.  I've got other issues I'm trying to solve with ajaxWDwx3.js also.. I'll add this to the list.
Title: Re: Rain Not updating in realtime & error
Post by: andro700 on March 01, 2023, 01:56:55 PM
No problem Ken. Appreciate all the time you are putting into this.

Chuck