New Zealand Local Weather Forum
Weather Discussion => Hardware Software and Technology => Projects => Topic started by: JennyLeez on July 05, 2016, 04:08:14 PM
-
I have been playing with a dashboard designed for Ipads and Tablets but works well on PCs and Laptops as well that some of you may be interested in.
"Built on Flex Webkit using jquery with a smart layout to do and see what you want, no hidden pages, no hours of searching for or uploading data, simply displays your weather station output from your raw text file realtime.txt or clientraw.txt."
Easy to setup. One file to configure with your station details and then upload all to your server.
However there are 2 x cron jobs necessary so your server will need to support cron jobs.
You will also need an account with weather underground and an API key.
Here is a link to the home page for downloading plus info:
iDESIGN34 home weather station webdesign template info page (http://www.idesign34.com/homepws/homeweather.html)
Compatible with Cumulus, Weather Display and Ambient WS1001 Software Users.
Two choices of colour dark or light as can be seen in the screenshots.
Here is mine - Light Version:
Wairoa, Hawkes Bay. New Zealand. HOME WEATHER STATION (http://wairoa.dynu.net/index.php)
And here is Bishopdale:
Bishopdale, Christchurch. New Zealand. HOME WEATHER STATION (http://nzpws.net/bishopdale/pws/index.php)
Yell below if you have a play and need a hand :)
Cheers
Jenny
(http://nzpws.net/nzwn/images/hws.png)
(http://nzpws.net/nzwn/images/hws-dark.jpg)
-
Liking it very much Jenny.
-
Yes, looking good! And graphs look familiar too :) One of these days, I'll get to work on my website again with a fresh start... Once I finish the drawings for the US$2m project I am working on from home! ...
-
Thanks Jenny, I quite liked that so I thought I would give it a go. I have it up and running, and checked with my WebHost and have CRON, so I have loaded the two CRON jobs,
php -q/home/xxxxxxx/public_html/pws/cronfiles/stationcron.php
php -q/home/xxxxxxx/public_html/pws/cronfiles/forecastcron.php
site is at coromandeltownweather.net/pws/index.php
but they don't seem to be kicking in, "error in argument 1 char 3:option not found /
any tips for a rookie?
PeterP
-
Hi Peter,
Loading your realtime.txt no problem.
Each time one of the cron jobs runs are you getting email?
What are the error messages in your email.
You can stop the emails by adding
> /dev/null 2>&1
but wait until running.
Double check settings.php
Make sure timezone correct
'Pacific/Auckland';
Did you add your WU api key.
Cheers
Jenny
-
Hi Jenny,
Yes I was getting emails. I set the interval at 1 minute while testing, and have scaled it back to hourly now as I am popping down to Wellington now until Friday. The error message was :error in argument 1 char 3:option not found /"
Settings screenshot attached.
Thanks,
-
Quite like the look of this so have decided to have a play.
Could not access the download last night, was redirecting to something else on his site.
Successful this morning . . . play time later
Thanks JL & everyone :)
-
@ Peter,
Today it is not reading your realtime.txt.
Put the full path into settings and upload the file.
$livedata = 'http://somewhere.net/realtime.txt'; // path to raw dataI messaged your path to you so you can see what I mean.
Your cron jobs are correct yet not functioning. Email your server and see if they can help.
Also the cumulus forum has pages on this template.
http://sandaysoft.com/forum/viewtopic.php?f=14&t=15136 (http://sandaysoft.com/forum/viewtopic.php?f=14&t=15136)
I was unable to get the cron jobs to function on one of my servers. Although setup correct the server appeared to be unable to read folders and files going backwards * shrug*
Anyways check with your server once home.
@ wolfie.......... ok so where is it :)
-
Wow! Thanks to Jenny for all the help. Now got my own Dashboard link on the site. Looks great on iPad/iPhone/mobile (Android) and desktop. Iwanui, Waitara. Taranaki. New Zealand HOME WEATHER STATION (http://www.waitaraweather.com/pws/index.php)
-
"ok so where is it" indeed
Hrrrmpphhhhh!!
Can't seem to do anything with the downloaded files, a bit bloo&y weird.
Tried a second download . . . no difference.
Maybe my Windoze XP doesn't handle the latest zip files ??
-
Is it not downloading completely.
or
Not extracting completely?
-
iDESIGN34 home weather station webdesign template info page[/url]
Compatible with Cumulus, Weather Display and Ambient WS1001 Software Users.
Two choices of colour dark or light as can be seen in the screenshots.
Here is mine - Light Version:
Wairoa, Hawkes Bay. New Zealand. HOME WEATHER STATION (http://wairoa.dynu.net/pws/index.php)
And here is Bishopdale:
Bishopdale, Christchurch. New Zealand. HOME WEATHER STATION (http://nzpws.net/bishopdale/pws/index.php)
Yell below if you have a play and need a hand :)
Cheers
Jenny
Love the look of it Jenny
-
Is it not downloading completely.
or
Not extracting completely?
Appeared to download completely, but could only copy a couple of files.
Now can't delete the folders I did copy, but files have deleted.
Installed 7 Zip and away we went.
Now have it working on Localhost in white, still like it :), checking stuff . . .
Looking to change Earthquake data from global to NZ, haven't found any setting yet.
Any suggestions ??
-
Have you set up those 2 cron jobs.
Once up and running they will update your earthquake section with NZ quakes.
-
Ah, right, thanks JL.
Don't think I can run cron jobs from localhost with my setup, so next step is upload to host server, sort out cron's, & then all should be sweet.
Cheers
-
Put the full path in settings.php for your realtime.txt.
Seems to work better :)
Like http://................
-
Wow that was simple. A bit more to play with but was working in 10 mins
-
Here is mine KomokaWeather HOME WEATHER STATION (http://www.komokaweather.com/pws/cumulus.php)
I have been testing for the author for a while and he has and is adding a few new things as he gets time. I use www.cron-job.org for the cron jobs which is free and quite good and verrry easy to set up.
Paul
-
hi thanks to jenny for pointing to here
my name is brian and developed the homeweatherstation template over the last year it, it has evolved and probably will evolve more but each bit at a time .
i live istanbul turkey been here for 10 years prior to that born and lived in the UK (Kent) , been a weather hobbyist since teen years where i started collecting analogue barometers accumulated some 170+ some of value but most just a collection unfortunately i was not able to bring those to istanbul so donated the whole lot to a charity shop !
im not a weather guru but understand the basics and now living in istanbul where the seasons are only 2 ! summer and a short winter where temperatures in december january can vary from -5 to 25c its that diverse .
anyway any problems i will do my best to help and resolve , the most common issue is cron jobs different server configurations produce different results a bit like Operating systems . earthquake info was originally included as I live on a fault line thats active lost count of how many times Ive woken from a short tremor but in 1999 one half of istanbul was flattened the epicentre was 60km from here , so thats the interest there.
i will in september october introduce newer ideas but as its summer and the humidity of the night makes difficult to sit in front of screen for any length of time.. good to see other enthusiast about..
brian
-
Do either of those Cron jobs have anything to do with the weather forecast?
I notice on your site that the temps are in C whereas my setup shows them as F. Can't see anything in the setup file for it.
I think my NAS box is able to handle Cron jobs, but I'll have to google how to do it.
Just having a play with it, but it doesn't look too bad
Tony C
-
That is all in settings:
$metric = true; // true for metric units, false for imperial/non metric units
$unitsLnk= 'metric'; // metric or english for non metric
$windmu = 'km/h'; // 'm/s' or 'km/h or mph' for units selection
$windunits = 'KM/H'; // set template output for wind units displayed use capitals MPH,KMH,M/S,KTS
$indoorunit ='Celsius'; // template temperatures units Celsius or Fahrenheit
$templateunit = '°C'; // set template output for temp units displayed use capitals F or C
$rainunit = 'mm'; // set template output for rain units displayed in or mm
$pressureunit= "hPa";// set template output pressure units displayed in or mb
Yes one of the cron jobs updates the weather forecast leeched from weather underground :)
Cheers
-
Thought that might be the case. [Edit] Ah! if I'd read the previous posts properly, someone says just that!
I did check all the settings were in metric and celsius.
Can't make up my mind whether I prefer white or black!
-
I can't seem to get them the Cron scripts to execute even using Pauls remote solution @ cron-job.org
[sigh]
-
Here's mine - a WIP as it still needs a bit of centering, updated header etc.
Current Conditions (http://www.huttweather.co.nz)
@TonyC (http://www.localweather.net.nz/smf/mlist/tonyc_78) can you post up your Cron commands? and website?
-
And here's mine
Opotiki Weather HOME WEATHER STATION (http://opotikiweather.nz/pws/index.php)
I still prefer the white version but the colours are a bit . . er . . naff?
A bit of tweaking would improve the visual impression I reckon.
Not impressed with WU current conditions . . .
Last week it showed rain for 4/5 days when it was plainly dry.
Switched the forecast station to Whakatane for a while, matched for about a day, then incorrect again.
I think WU seems to switch between WHK & Gisborne for my location, pretty poor in my eyes.
My monitor at home displays the footer in poor resolution, much better at work.
-
@TonyC[/url] can you post up your Cron commands? and website?
The server is a Synology NAS running PHP5.6. running on Apache2.2
Using cron-job.org you supposedly only have to put in the url for it to run the php script.
You can include an admin login and password to overcome http security. The URL is
Port Robinson, NewZealand (http://www.portrobinson.nz/pws/cronfiles/forecastcron.php)
The gurus have got cronjobs going on Synology Diskstations, but I'm not that keen to go poking into the innards. The consensus is that Cron won't work on Synology Diskstations.
Trying to run the PHP script from a web browser give the following response:-
Warning: file_put_contents(../jsondata/forecast10day.json): failed to open stream: Permission denied in /volume1/web/pws/cronfiles/forecastcron.php on line 19 Warning: file_put_contents(../jsondata/hourly.json): failed to open stream: Permission denied in /volume1/web/pws/cronfiles/forecastcron.php on line 27
So perhaps security is the problem.
TC
-
Yes. Looks like a security issue. I had alot of issues with mine mostly due to bumble fingers around paths etc. But it looks like yours are finding the files just not able to execute them
-
I'll whistle up Paul and see if he has any suggestions Tony.
Command 19 and 27 are attempting to write to your server, so yes security could be the issue.
Stabbing in the dark here but could changing permissions help for the json files.
../jsondata/forecast10day.json
../jsondata/hourly.json
Meanwhile like Gabba I have been playing with embedding the dashboard into my shell.
Cept I dont like the line across the bottom and I dont need the menu up top.
Anyways here is what I have so far.
Wairoa Weather Dashboard (http://wairoa.net/weather/dashboard.htm)
-
Something I just remembered I have read is some servers can not handle the jumping backwards and forwards into folders and back out again.
For some reason some servers screw php scripts.
I know this does not help but keep in the back of your mind before beating your head against a brick wall :)
-
I did look at the file permissions on the jason files and they are read/write.
I have thought of maybe installing PHP on a windows machine to execute the scripts and copy the files back to the server, but I'm not sure it's worth the effort.
Maybe it's one of those shrug your shoulders and move on projects! ::)
-
can you provide a url ?
you can also test the cron files direct in your browser http://something.com/something/cronfiles/stationcron.php or forecastcron.php or whatever the direct path is to those 2 files . most of the time it is file permission related 644 or 755 work ok on most servers however paths can be related
<?php
//disable error logging
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
ini_set(“display_errors”,”off”);
// extras added march 23rd 2016 //
date_default_timezone_set($TZ);
$date = date_create();
//***get station id weather every 10 minutes for home weather station***//
$json = file_get_contents('http://api.wunderground.com/api/'.$api.'/conditions_v11/q/pws:'.$id.'.json');
$data = json_encode($json);
$file = '../jsondata/weather.json';
file_put_contents($file, $json);
?>
also double check the api key in the settings.php
thats all i can think for now
and as for light or dark personally the light version i found the dark version nigh on useless in sunlight on my iPad when out and about..
forgot to add it was upgraded to 4.34 includes more accurate moon script data and better wind direction transitions on tablet devices ..
please note if you want to use it inside a shell or current website via an iframe the width is 960px some users in the past try to reduce it to 900px and screws up the alignment of the content inside the boxes
as for accuracy of weather underground i never like using any external resource for data but for me personally WU was the most accurate for Istanbul,Turkey , yahoo was on another planet often 10 degrees plus out just like today, accuweather another forecast predicting 40c for us tomorrow ! throw that in the bin probably get up around 33c as for anything else no experience of how there scripts and data files work...
brian
-
Brian,
I did provide the URL in an earlier post, plus the output from calling the URL in a browser.
For some reason, the script won't write to the jason files
I did also check the API key was entered correctly (like 5 times). Checking the API on WU, the script obviously interogated it (shows up on the graph).
Maybe Synology diskstation hasn't provided the facility to run Cron files for a reason. After all, it started out as a media server and expanded into a many purpose appliance. It does the simple things well, but obviously has limitations.
cheers
TC
-
ok Tony
drop me an email sometime i can make a version that does not require cron jobs however you are limited to 500 calls per day sounds a lot but for each script that uses WU forecast,hourly,current sky,outlook you need the api so that 4 x each time a visitor comes to your page .
just let me know which version you require drop me an email and next week monday onwards ill set one up and zip it up and send it to you. but i do need your api key so email it please don't send it here .
for example this one setup earlier in June doesn't use cron jobs but the downside is they are a one off and I cant produce any updates for these as the scripts are different..Kvissel Braending HOME WEATHER STATION (http://www.kvisselsvenner.dk/pws/ws1001.php)
brian
-
tony its on the way
but read the email carefully very limited to api restrictions of 500 calls. not perfect but it works fine. you will need to add your clientraw.txt path as i couldn't access yours in anyway . note no earthquake data not possible without cron job..
have a nice weekend
-
HaHa!!
You must have been working on it while I was having a play. I got a wagging finger from Weather Underground about exceeding my API call over the space of a minute.
I installed the Windows version of PHP and have played around with the scripts. I think Jenny is right and the Diskstation doesn't like the directory structure references in the cron scripts. I may have a further play sometimeand may eventually get your original to work
Anyway, thanks for that and I'll put it up on line this weekend. I don't get a lot of visitors to the site as it's fairly remote, so hopefully WU won't be nagging me too much.
Thanks again
Tony C
-
After all the time spent on this Tony and Brian, I for one will look forward to seeing it up and running.
Good luck for the weekend Tony :)
Cheers
JL
-
Yes, best of luck with it Tony.
p.s. check your PM re my email from a couple of days ago being undelivered.
Paul
-
Thanks Paul and Brian,
I've had a good play with both the customised version and also manually reproducing the json files by running the scripts from a command line. I don't want to be a damp squid and the following comments may be due to the fact that my station is not in a populated area or near any large town.
I very much like the look of it and obviously much work has gone into the production. For me it's the Weather Underground info that is a bit disappointing.
At the time of writing (11.30am Sunday), the current conditions graphic is rain whereas it is only cloudy with no rain in sight. I'm presuming that comes from WU? It certainly doesn't agree with the Weather Display conditions. The forecast for the next 2 days has a rain/sun graphic. The NZ Met service forecast has no rain forecast and it is their 7 day forecast I use for my main weather page. The Earthquake report is not quite as specific as GeoNet. A 4.8 quake reported as being on the west coast of NZ was according to GeoNet a 4.6 well to the south of NZ near Snares Island.
Given the conflicting info I do have reservations on putting it up as an adjunct to my existing page. I'll continue to monitor the variants more out of interest than anything else. Thank you Brian for your custom copy. I think if I published your program, it would be the production copy and I'd set up a batch file with scheduler on my Weather Display computer to produce the json files on a timed basis rather than run the risk of the API being over the limit. The unknown possible usage is too much of a risk and though you suggest setting up an number of API's, I don't want to go down that track.
As I say, these observations are just perhaps unique to my particular situation, and I don't want to put off other users giving it a go!
[EDIT] 5.40pm Sunday - What I've now done is copy the cron files and the setup.php into the jsondata directory and edited the cron files taking out any paths to the json files.
My main PC has PHP for windows installed and a drive mapped to pws directory on the server. I have a .bat file in the jsondata dir which calls PHP.exe and executes both the cron files. The batch file runs every 30 minutes using Windows Scheduler. I'll give it a good trial and see how it goes! By the way it is up and running on my server. Port Robinson, NewZealand (http://www.portrobinson.nz/pws)
All the very best
Tony C.
-
Hi
before anyone makes an assumption please read below you perhaps will understand my decision .
due to circumstance i now find myself in and if you are aware of the news on a regular basis you will hopefully understand why I no longer
can develop or continue to contribute to the weather template.
unfortunately events that have occurred here in Istanbul,Turkey in the last 6 months as increasingly caused myself much mental stress and grave concern for
my wife and my personal welfare .right now for the last two days we have not slept or gone out of the house and still feel much uncertaintiy ahead of us we pray for the opposite but these circumstances are beyond our control .
I hope to find someone who can take over and support and continue to develop it with the same outlook to design and user experience , i have emailed a few who I think share the same outlook and have the experience to continue developing it and offer some reasonable support.it doesn't actually require much most common issue is cron jobs and where server configurations can be different.
IM SO SORRY really mean that I enjoy the weather challenge and have been a keen hobbyist on and off since i was 16 years old I'm now 54(soon) .
so there we are I'm sure in the near future hopefully someone will keep it going if not and you have copies of the template feel free to develop it and maintain it for yourself .
sometimes more important things in life drive the decision and right now that is the case for me personally.
hopefully the template will inspire others to create template designs using clean UI's web development, technology is rapidly changing and user experience is now at the forefront of those new designs . user experience is important functionality needs to be balanced with the user interface to often it is ignored and the end result is not a pleasant user experience especially in the day and age of touch screen devices .
if you are interested in developing or continuing development please drop an email we can Skype and i can provide some details to transfer the necessary files and information.
take care Brian
-
Hi Brian
So sorry to hear that.
Thank you so much for your efforts, & also to those who have assisted.
I love the layout, it lays out a ton of info, both visual & data & seems pretty solid.
Ok, so the colours don't quite suit my eyes, but I'm sure that could be fixed, given a little time.
I hope things settle down where you are, and you find some sense of normality for yourself & your family soon.
Cheers & take care
Pat
-
Gosh Brian,
I'm sorry if my comments caused you some grief. I go stand in the corner with a dunce hat on. Please don't take it to heart.
best regards,
Tony C.
-
hmmm not sure i follow my previous post is explaining the reasons i no longer can continue to develop and improve it for the reasons and events that surround me right now , having now read your comments i don't find them detremental or personal there your thoughts and if something doesn't work for you for whatever reasons then there is nothing i can do about that . so taking it personally to thick skinned for that and due to current circumstances that would be the least of my concerns to get worked up about .
take care its a hobby ..
brian
-
Your position, I would hope is understood by all, and I wish you and yours whatever it is you hope for.
-
unfortunately events that have occurred here in Istanbul, Turkey in the last 6 months as increasingly caused myself much mental stress and grave concern for my wife and my personal welfare.
I have been following events on our overseas news channels and no, not good.
Thank you for helping us downunder.
Please take care of you and your family and stay safe.
Cheers
Jenny
-
Hi Brian, I hope and pray for the best in your area and for you and family particular.
Paul
-
Hi Brian
...echoing the thoughts above, I think everyone completely understands given the situation you are in. I think the work you have put into the template is well reflected by the speed at which everyone adopted it onto their sites. Clearly it is well thought of!
All the best and stay in touch when you can. It sounds like the future is uncertain for you and your family, but hang in there and new doors will open up
-
FYI
Recent events and version 4.35 http://sandaysoft.com/forum/viewtopic.php?f=14&t=15136
Paul
-
Dashboard Main Clock. Does anybody know where to adjust the time for daylight saving. Waitara, Taranaki, New Zealand - Home (http://www.waitaraweather.com/dashboard.php)
Live updates are reporting in daylight time. Main clock is not.
-
It'll be in the setting.php
Got a busy day, but I'll try to have a look. I am using this on my website and hadn't realised the time being an hour out.
cheers
TC
-
This code will do the trick
$UTC = '13'; // NUMBER of hours betweeen your location and UTC new york -4 london 1 istanbul 3 note will have to change based on clock seasonal changes
$moonadj = '2'; //adjust this number to correct the moonset time output to your location should be either 1 or 2 will have to monitor this when clocks change
-
To fix the Daylight saving time go to the setting.php page and edit it.
Scroll down to $UTC (third item down) and change from 12 to 13.
You'll need to change it back when daylight saving ceases.
regards,
Tony C
EDIT
Ah! you just beat me to it Gabba!!
-
Yep - will need to do the moon setting too as per above. Change from 1 to 2
-
Thanks for the help here guys but I still can't see where to change things. I presume this is the code where things need to change in Settings.php
Any help appreciated.
############################################################################
# Sitewide configuration - Station location, identity and date/time info
############################################################################
$SITE['organ'] = 'Waitara, Taranaki, New Zealand';
$SITE['copyr'] = '© ' . gmdate("Y",time()) . ', Waitara Weather';
$SITE['location'] = 'Iwanui, Waitara, Taranaki, New Zealand';
$SITE['email'] = 'mailto:xxxxx@xxxxxxx';
# Station location: latitude, longitude, cityname
$SITE['latitude'] = '-39.001094'; //North=positive, South=negative decimal degrees
$SITE['longitude'] = '174.237665'; //East=positive, West=negative decimal degrees
$SITE['cityname'] = 'Waitara.';
$SITE['tz'] = 'Pacific/Auckland'; //NOTE: this *MUST* be set correctly to
// translate UTC times to your LOCAL time for the displays.
// [url=http://us.php.net/manual/en/timezones.php]PHP: List of Supported Timezones - Manual[/url] has the list of timezone names
// pick the one that is closest to your location and put in $SITE['tz'] like:
// $SITE['tz'] = 'America/Los_Angeles'; // or
// $SITE['tz'] = 'Europe/Brussels';
// note: date format used for PHP parts only. Weather software dates are not processed
// except on the astronomy page
$SITE['timeFormat'] = 'D, d-M-Y g:ia T'; // Day, 31-Mar-2006 6:35pm Tz (USA Style)
// $SITE['timeFormat'] = 'm/d/Y g:ia'; // USA format 03/31/2006 14:03
// $SITE['timeFormat'] = 'd/m/Y H:i'; // Euro format 31/03/2006 14:03
// $SITE['timeFormat'] = 'Y-m-d H:i'; // ISO format 2006-03-31 14:03
//$SITE['timeOnlyFormat'] = 'g:ia'; // USA format h:mm[am|pm\
$SITE['timeOnlyFormat'] = 'H:i'; // Euro format hh:mm (hh=00..23);
$SITE['dateOnlyFormat'] = 'd/m/Y'; // for 31-Mar-2008 or 'j/n/Y' for Euro format
############################################################################
MOD Edit: code above altered to obfuscate email address
-
Hey. It makes a difference if I go to PWS Settings!!! All done. Thanks for your help :)
-
LoL !!