Page 1 of 1

iPhone realtime page & graphs.htm question.

Posted: Mon 08 Aug 2011 2:03 pm
by MattStedman
I have been making a iPhone page that reads values from the realtime.txt and scrapes the windrose info from the gauges.htm. To finish it I need to know whether the data in the graphs.html hwspd array is oldest or newest first and what time intervals they are.

You can have a play with the page by dumping the attachement into your webserver as a subfolder. There should be no configuration required. The only thing that will probably break is the wind speed graphs due to different units. It automatically refreshes every minute
at the moment.

Matt

edit: I realise there is already an iphone page, this is something I have been tinkering with to learn Javascript.

Re: iPhone realtime page & graphs.htm question.

Posted: Mon 08 Aug 2011 2:48 pm
by steve
The <#wspddata> web tag is described in the help and the wiki, thus: "Comma separated list of recent wind speed readings (up to 3600 entries). This is a circular buffer; to find the most recent value use nextwindindex ".

It doesn't cover a particular period, it's just the last 3600 readings. The interval and total period depends on the type of weather station.

Re: iPhone realtime page & graphs.htm question.

Posted: Mon 08 Aug 2011 6:47 pm
by robynfali
done it on mine, can't see any graphs tho?

http://www.valley-weather.co.uk/iphone2/index.html

Re: iPhone realtime page & graphs.htm question.

Posted: Mon 08 Aug 2011 7:11 pm
by daj
Rob

I had a quick peak at the code and see that the wind 'graph' relies on the gauges.htm file being in the parent folder. Your site is not using the standard pages so it will not work in its current setup -- maybe changing the .js file (line 59) to look for your gauges.php will work but it depends on what is in your php file from the standard gauges.htm file

Just a thought

Re: iPhone realtime page & graphs.htm question.

Posted: Mon 08 Aug 2011 7:31 pm
by robynfali
Hi mate

I do have this one

http://www.valley-weather.co.uk/gaugesIE.php

but which .js file do you mean, i have just looked at line 59 in all of them, and found no reference to point to, i do realise this is me being totally blind!

Re: iPhone realtime page & graphs.htm question.

Posted: Mon 08 Aug 2011 8:17 pm
by daj
It's line 59 of the cumulus.js file that you will have copied as part of Matt's iPhone pages.

It says...

Code: Select all

url="../gauges.htm";
You could try changing it to your php (IE) version -- as I say, I've not tried it but a quick look at Matt's code suggests it reads the data from the standard cumulus pages

Re: iPhone realtime page & graphs.htm question.

Posted: Mon 08 Aug 2011 8:23 pm
by robynfali
does help if i look in the right folder, and at the right files i guess mate!!, cheers

Re: iPhone realtime page & graphs.htm question.

Posted: Tue 09 Aug 2011 12:19 am
by MattStedman
Thanks Steve, I didn't even think of the Wiki even though I was looking at something else in there earlier. I will play around with it later. There is another way of generating the graph, which uses the last 10 reading when the page updates. If you look in the javascript at the bottom of the page and swap the comments on these lines:

Code: Select all

//wind=windhist(data[6]);

wind=wndfromgauges();
The only thing with this is that you have to leave the page up and running, which is why I started this whole thing as I have my phone in a dock with music playing most of the day. It does have the icon and is sized to be an "app" as well. I will clean the code up later today and make put all the configurable bits in one place.

Thanks for trying it out

Matt