[Leuven template] Quicker refresh for steel gauges and ajax?

HI Wim, I would like the steel gauges and the main page ajax to update every 3 seconds please?
i have had a good look in the WsSettings and can only find below and set to three yet it does nothing
for the ajax on the main page, so i presume thats for sommat else? cannot find where the steel one is :confused:

$SITE['wsAjaxDataTime'] = 3;

my WDL is updating every 3 seconds ok, i have sorted that one

I searched your wiki for updates and refresh but still couldnt find it

EDIT, im not even sure the ajax is working 100% on the main data anyway, even though the counter restarts at 10s
the data does not always update, WDL and steel do…

Thanks

HI Wim, just been watching my dashboard and its not updating as it should be, prob been like this from the start
to be honest cause not me gets changed once its up and running and cause it goes green (ajax) once after page
refreshed i prob thought that was it, clientraw is updating to the root, wsSettingsWeather clientraw folder set to ./

Oh and steel time set to 3 in wsSettingsWeather but still @ 10

Any advice please

Gauges:
These are the gauges as used in the iframe on your main-page
http://www.suffolkweather.info/gauges/gaugeframe.php?lang=en&wp=WD
The realtime data is loaded every 10 seconds and the gauges are updated, at least when the data changes.

Then after so many updates some empty data string is returned and all updating stops

{"date":null,"temp":"0","tempTL":"0","tempTH":"0","intemp":"0","dew":"0","dewpointTL":"0","dewpointTH":"0","apptemp":"0","apptempTL":"0","apptempTH":"0","wchill":"0","wchillTL":"0","heatindex":"0","heatindexTH":"0","humidex":"0","wlatest":"0","wspeed":"0","wgust":"0","wgustTM":"0","bearing":"","avgbearing":"","press":"0","pressTL":"0","pressTH":"0","pressL":"0","pressH":"0","rfall":"0","rrate":"0","rrateTM":"0","hum":"","humTL":"","humTH":"","inhum":"","SensorContactLost":"","forecast":"Data will be reloaded in","tempunit":"C","windunit":"mph","pressunit":"hPa","rainunit":"mm","temptrend":"0","TtempTL":null,"TtempTH":null,"TdewpointTL":null,"TdewpointTH":null,"TapptempTL":null,"TapptempTH":null,"TwchillTL":null,"TheatindexTH":null,"TrrateTM":null,"ThourlyrainTH":null,"LastRained":"","hourlyrainTH":"0","ThumTL":null,"ThumTH":null,"TpressTL":null,"TpressTH":null,"presstrendval":"0","Tbeaufort":"","TwgustTM":null,"windTM":"0","bearingTM":"","timeUTC":null,"BearingRangeFrom10":"","BearingRangeTo10":"","UV":"","SolarRad":"","CurrentSolarMax":"","SolarTM":"","version":"","build":"","ver":"9"}

Main screen ajax data
That is loaded at the 5 minutes time updates correctly.
I have no idea how your site works as there are multiple ajax scripts active. And some are not found also

ajaxWDwx0.js   Failed to load resource: the server responded with a status of 404 (Not Found)

Sorry but this is all I can see from here

Gauge update time
There is a setting but the minimum is 10 seconds to not put a to big load on the webserver.

Wim

Hi Wim, my clientraw updates and uploads every 3 seconds, my wind updates no more than every 2.5 seconds or less (Davis)
My dedicated server is very capable of handling every 1 second if it was needed,
WDL is updating every 3 seconds, with no probs, http://www.suffolkweather.info/index.php?p=21&lang=en

ajaxWDwx0.js was changed to ajaxWDwx.js because there was a time when i was trying to incorporate an older dashboard, failed mind…
I think thats what happened to the original file, i think i combined them

Where is the ajax getting its data? is it clientraw or testtags?

What scripts do i need to edit to change the gauge update and the ajax update please?

Bashy I use a couple of Firefox add-ons to help debug any web pages I create. HttpFox is very useful for finding stuff which will not load correctly (like 404 errors and others) as it traces the HTTP flow from Firefox to the server and shows the results for each call while running. The other one is Firebug which displays the HTML used to build the page and highlights which sections are built when any particular statement is selected. Using these often helps me debug my web pages and sort out what is failing so you might find them useful. Sometimes of course they wont help like finding timeout values etc in javascript when there is no alternative (that I’ve found) to reading the code :wink:

Stuart

Hi Stuart, I use Chrome, this has inspect elements, but from the sounds of it, but what I thought was an issue is not, the dashboard only uses days every 5 minutes, that’s a bit too long for how I like things to run, I prefer them to be fairly quick like in wdl

The Leuven-Template => startpage => dashboard uses the 5 minute data combined with the realtime data, for WD that is clientraw.txt.

Then it updates every so many seconds (default 30) by executing a php script to get and convert the most up to date data.
The updated fields are highlighted in green .

More or less the same procedure as in the Saratoga-template, only Leuven does the unit conversion in PHP on the server. Saratoga loads the realtime file as-is and does the conversion in javascript.

Example Startpagina - Weerstation Wilsele-Herent

Wim


Ah OK, I misunderstood what you meant, so, is it not possible for me to edit the update frequency for both the ajax and steel?

Yes you can, first use the settings.
As I do not know what version of the scripts you are using, this should be somewhere in gauges/gauge.php

if (!isset ($SITE['steelTime']) )       { $SITE['steelTime'] = 30;}
if ($SITE['steelTime'] > 60 )           { $SITE['steelTime'] = 30;}
if ($SITE['steelTime'] < 10 )           { $SITE['steelTime'] = 10;}

Change the last line to

if ($SITE['steelTime'] < 3 )           { $SITE['steelTime'] = 3;}

Wim

To modify the ajax-reload for the dashboard change line 8 in javaScripts/ajax.js.
Default is set to 30 seconds, it is already changein your version to 10 seconds

var reloadTime 			= 10000;     		// reload AJAX conditions every 30 seconds (= 30000 ms) set to min ftp time

Again, this is a PHP script which loads all data in the required format/language/units the visitor has set.
No javascript as that is only used to insert the values into the dashboard.

Wim

Hi Wim, thank you, i have the steel set working at every 3 seconds now, you can see the wind update each time, brill

As for the dashboard, i cannot seem to get my head around it, i have found that setting and yes, i had changed it at the
beginning to every 10s, I think you are saying that when it picks up new data, it then updates? at the set time? but if the
wind is updating (like in the steel set) shouldnt that be picked up? or is the dashboard not made that way?

Ok, got the ajax file and the settings set to update every 3 seconds now, but i am not seeing the wind or anything else
update but mostly it would be the wind…

You are right, it will not update the ajax values with the realtime file voor your version.
That was added in the 2.7 version, at the same time when the console was added.

Wim

AH ok, thank you, would i lose the anything like the custom links at the top if i upgrade Wim?