Page 1 of 1

Problem update gauge

Posted: Sat Feb 08, 2014 6:04 pm
by Guillaume_67370
Hello everybody,

I have a little problem with the update datas of the steelseries Gauges, i set 3 seconds on real time in Cumulus and of the server but datas will be update every 8 seconds, 20 seconds, 30 seconds on my web site, it depends...

http://www.meteo-offenheim.fr/instruments.php

Do you have any explication?

Thanks

Re: Problem update gauge

Posted: Sat Feb 08, 2014 6:23 pm
by nitrx
If the data don't change in a timerange you will see no change on the gauges I think..

Re: Problem update gauge

Posted: Sun Feb 09, 2014 12:56 am
by Guillaume_67370
Wind speed or direction change all the time.
If i have a look on Cumulus datas changed so why it doesn't change every 3 seconds on my web site as configurate??

Re: Problem update gauge

Posted: Sun Feb 09, 2014 11:31 am
by steve
Perhaps the realtimegauges.txt file isn't able to be uploaded that frequently. Turn on ftp logging and look at the realtimeftplog.txt to see how often it's being uploaded.

Re: Problem update gauge

Posted: Sun Feb 09, 2014 1:18 pm
by mcrossley
It looks like it is working now?

Every so often you get a 'corrupt' realtimegauges.txt file, the only thing wrong with it is that the closing "}" at the end of the file is missing for some reason - possibly because the file is being written to at the time of read. I have put a workaround in for that on my site by creating the JSON data using PHP and waiting for the realtimeGuages.txt file to be flagged as updated on the web server file system (long polling).

I see you have based your gauges on the 'test' script I have on my site, that version has not yet been released and does contain a couple of bugs that I know about but have yet to fix.

Re: Problem update gauge

Posted: Tue Feb 11, 2014 12:21 pm
by Guillaume_67370
mcrossley wrote:It looks like it is working now?

Every so often you get a 'corrupt' realtimegauges.txt file, the only thing wrong with it is that the closing "}" at the end of the file is missing for some reason - possibly because the file is being written to at the time of read. I have put a workaround in for that on my site by creating the JSON data using PHP and waiting for the realtimeGuages.txt file to be flagged as updated on the web server file system (long polling).

I see you have based your gauges on the 'test' script I have on my site, that version has not yet been released and does contain a couple of bugs that I know about but have yet to fix.


Hi Steve, Mark,

Thanks for your answer.

I downland the last version of Cumulus 1.9.4 build 1088. It doesn't change anything...
Have a look on website from my friend it function correctly.http://www.meteo-kogenheim.fr/page_instruments.php
Why not by me?? :(

Regards

Re: Problem update gauge

Posted: Tue Feb 11, 2014 1:42 pm
by water01
I would say the difference is your host provider's FTP is not capable of uploading a quite large file like realtimegauges.txt every 3 seconds. Even your friends if you look at it does not change every 3 seconds, the readings stay static sometimes for as many as 3 or 4 timings i.e. 9-12 seconds.

I would have thought a more realistic timing would be 10 seconds, as I am sure that Mark didn't design the gauges to be almost "realtime" gauges otherwise he wouldn't have set the default countdown to 60 seconds.

Re: Problem update gauge

Posted: Tue Feb 11, 2014 2:27 pm
by mcrossley
It looks like the 'version' of the realtimegauges.txt file that your web server returns is only updated every 30 seconds at the moment.

The 'Last Modified' date on the file only changes every 30 seconds according to Apache.

I think there are two likely explanations..

1. Cumulus is only uploading the file every 30 seconds - you can check this from the Cumulus logs.

2. The web server is caching the file locally and not reading it from the file system at every request.

(3 - less likely) The file modified date/time isn't being updated with each FTP transfer. Can you check on the web server if the file modified time changes each time Cumulus uploads a new version?



I see you also have a whole page refresh thrown in for good measure every 300 seconds!
<meta http-equiv="Refresh" content="300">

Re: Problem update gauge

Posted: Tue Feb 11, 2014 7:22 pm
by Guillaume_67370
mcrossley wrote:It looks like the 'version' of the realtimegauges.txt file that your web server returns is only updated every 30 seconds at the moment.

The 'Last Modified' date on the file only changes every 30 seconds according to Apache.

I think there are two likely explanations..

1. Cumulus is only uploading the file every 30 seconds - you can check this from the Cumulus logs.

2. The web server is caching the file locally and not reading it from the file system at every request.

(3 - less likely) The file modified date/time isn't being updated with each FTP transfer. Can you check on the web server if the file modified time changes each time Cumulus uploads a new version?



I see you also have a whole page refresh thrown in for good measure every 300 seconds!
<meta http-equiv="Refresh" content="300">


Mark,

I give you answer of your 3 different explanations :

1. That is impossible because often i receive datas every 8, 10, 15 seconds. When you speack about Cumulus logs you speak about this file attached?

2. I don't understand what you mean

3. I have a loock on the web server, it appears a file realtimegauges.txt and every 5-10 secons when i refresch appears a file realtimegauges.txttmp

Yes I have a whole page refresh of 300 seconds but that is normally not a problem. My colleage hasn't any whole page refresh.

Regards

Re: Problem update gauge

Posted: Tue Feb 11, 2014 8:10 pm
by steve
Guillaume_67370 wrote:When you speack about Cumulus logs you speak about this file attached?
The realtime ftp log that I suggested you look at, two days ago, would be a good place to start.

Re: Problem update gauge

Posted: Tue Feb 11, 2014 9:30 pm
by Guillaume_67370
Find attached ftp log. You must go at the end of the file.

Re: Problem update gauge

Posted: Wed Feb 12, 2014 7:47 am
by steve
It's taking about 6 or 7 seconds to get the realtime files to your server, then there is a short gap until the next realtime upload slot comes around, so your uploads are typically around 8 or 9 seconds apart. You're already using the rename option, and that should minimise the problem where the file is incomplete on the server. From the log, it's clear that the rename takes a fraction of a second

So the limit is on the speed that the files can be uploaded to your server. You could reduce the realtime upload interval to 1 second, and then the next slot will come around more quickly, but that will only get you down to 6 or 7 seconds. Or, more realistically, increase it to 10 seconds, say, as was suggested earlier.

I don't know why the gauges code is apparently getting incomplete files as Mark saw; the rename takes a fraction of a second, so you wouldn't expect the file to be unavailable for very long at all.

I've just had a look at the realtime.txt file on your site, and constantly refreshing the file in my browser. I can see the same thing that Mark noted; that it's only updating every 30 seconds or so. Assuming that it's still being uploaded every 8 or 9 seconds, then as Mark said, there must be some kind of caching issue with your server such that it's only sending the latest version of the file every 30 seconds or so, even though a newer version has been uploaded.

Re: Problem update gauge

Posted: Wed Apr 04, 2018 4:03 pm
by Guillaume_67370
Hello,

I come back to this subject because i'm confronted again on this issue with an updating of about every 22 seconds.
Do you think it will be a problem with caching issue with my server again ??

thanks for your help
Regards