Page 2 of 4
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 12:28 am
by daj
Odd. I only use FF. I did test it on IE 7 & 8 also on chrome and safari for PC and Mac.
Undefinded can mean it failed to access realtime.txt. I am trying trap that error but not always successful.
Do you have a URL I can look at?
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 12:33 am
by daj
I guessed your URL and it looks fine to me....
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 2:35 pm
by garytx
FWIW, I have mine updating at 5 second intervals and sometimes get the "undefined" message in lieu of data; this appears to happen if the console is trying to update at the same instant the realtime.txt file itself is being updated. For me, it always passes and is replaced by data at the next 5 second console update. (IE8)
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 2:51 pm
by daj
Yes, I'm trying to capture that problem and get it to ignore it. For now, I resolve it by staggering the timing. So if Cumulus is updating every 5 seconds, refresh the console maybe every 7
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 2:53 pm
by daj
Small update on the code -- I omitted two descriptions for the Beaufort scale
http://wiki.sandaysoft.com/a/WeatherConsole
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 3:12 pm
by gemini06720
daj wrote:Yes, I'm trying to capture that problem and get it to ignore it. For now, I resolve it by staggering the timing. So if Cumulus is updating every 5 seconds, refresh the console maybe every 7
David how about a loop within the JavaScrip file ... and no, I do not know how to do it...
In one of my PHP script I have the following:
Code: Select all
$realtime = 'realtime.txt'; // relative FILE location of realtime.txt
$fileOpenTries = 3; // number of open retries for realtime files
$retrySleepTime = 5; // seconds to wait before next open retry
...
for ($i = $fileOpenTries; $i > 0; $i--) {
$dataraw = file_get_contents($realtime);
if ($dataraw===false)
{
sleep($retrySleepTime);
}
else
{
break;
}
...
What the code snippet basically do is:
- it tries to open the file;
- if it cannot get the content of the file, it waits for 5 seconds (as setup) and tries again to open the file;
- it will repeat the same open/wait loop 3 times (as setup) and then give up...
But, that is a 15 seconds loop and that might be what is needed inside the JavaScript to eventually get the 'realtime.txt' information...
Just a suggestion...

Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 3:23 pm
by bnwrx
A question I have is, what do people do with this console. I mean it displays data that is already on your website. It displays data that is already on your desktop(thru Cumulus) so how are others using this application?

Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 3:28 pm
by daj
I only pulled it together as a way of showing key data updating in near realtime. The Standard Cumulus webpages do not refresh once loaded, unless you use CumulusRealtime & Silverlight add-on.
Most people who have customised their weather sites already have auto refreshing pages of data, but this was a very simple start for people who do not -- its a good learning tool too as it was written to be simple to understand and tear apart
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 3:53 pm
by bnwrx
OK I can understand that and I do appreciate users like yourself who take a project and run with it. I'll still keep playing with it. On my free hosting site I have to resize the page in order to see the "Popout" and with my FF it only opens in a new tab. With IE it does popout from the browser. I'll keep trying.
Thanks DAJ
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 4:04 pm
by daj
bnwrx wrote:On my free hosting site I have to resize the page in order to see the "Popout"
I guess they are inserting adds on the page!
and with my FF it only opens in a new tab. With IE it does popout from the browser.
I think there is a setting in FF. I only use FF as my main browser and it is working, but I cant see what setting you may have on/off. (I do test my pages in FF, Safari, Chrome, and IE but FF is my main one)
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 4:09 pm
by bnwrx
daj wrote:bnwrx wrote:On my free hosting site I have to resize the page in order to see the "Popout"
I guess they are inserting adds on the page!
Yes thats the price of FREE!

Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 6:09 pm
by malc-c
David,
Thanks for the explanation of the timings... I changed this by mistake when Steve was discussing the time frame for the base unit's data recording (ie from 30 mins ). I've got a few issues with FTP at the moment, which my hosting company are trying to resolve, so I've not been able to try your code. We don't run the PC 24/7 so I agree with you that it might be pointless running an site that requires updated info in realtime
Re: New addon: Live data on the web
Posted: Tue 12 Jan 2010 8:54 pm
by akasonny
Handy lil' package, David, thanks.
Re: New addon: Live data on the web
Posted: Wed 10 Mar 2010 2:02 pm
by Hillbilly
Thanks for creating this Daj,
I've just installed this and seems to be running well. Handy to be able to leave the popout window running while browsing elsewhere.
Re: New addon: Live data on the web
Posted: Sun 21 Mar 2010 12:34 pm
by Synewave
Daj,
I've installed this recently too, a great "add-on".
I've also used the .JS file to create a dynamic version of my index page, which works very well. I think I am now working towards decreasing the FTP .htm upload frequency, and have your script update the index page on the server only from the realtime.txt file.
Many thanks for this,