davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Setting up pywws / writing data to website

Mon Feb 25, 2013 1:26 pm

I have been playing with Jim Easterbrook's excellent pywws to get and process data from my new Maplin weather station. I've got live logging working and once I've installed the weather station outside (I have to wait for my birthday as it's a present) I will start sending data to Wunderground (I hope).

As a Linux newbie (though I have many years of command line experience on old machines so managed make sense of Linux) I found the process of getting the first stages OK but I would like to create a website to display all my data - initially to me but maybe later to the world. Is it sensible to try and do that on my Pi using a browser to access it or on my Ubuntu or Windows machines.

Can anyone recommend a tutorial or website to help me learn the initial concepts - there are so many out there I don't know where to start. I have downloaded the templates etc from Weather4You which should work with pywws but there are no details of what to do with them as far as I can tell.

Cheers and thanks for any help Dave

PS Could we have a topic in the forum for weather stations?

600stu
Posts: 9
Joined: Wed Jun 13, 2012 9:36 pm

Re: Setting up pywws / writing data to website

Mon Feb 25, 2013 1:46 pm

Hi Dave,

I am also part way through doing what you describe with pywws and a website.

I have a weatherstation set up outside, the console is connected to my pi inside via the usb cable. I run the pi headless via ssh from my ubuntu laptop.

See http://www.penguintutor.com/linux/raspberrypi-webserver for a tutorial for setting up a LAMP server on your raspi.

Once that is done then i just extracted the weather4you into the directory where the website files are to be stored.
The is a READ ME file in the zip file telling you how to set the template up.

Then its a matter of setting up your weather.ini file to tell is what you want to publish and when.
I have a few teething issues to resolve but have most of it working.

Stu

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Mon Feb 25, 2013 7:01 pm

That's brilliant thanks, I have now got a working webserver. Do the files need to be in /var/www when I unzip the files. I can't see any instructions as to location in the read.me file though it's not well formatted.

Thanks for the help

Dave

600stu
Posts: 9
Joined: Wed Jun 13, 2012 9:36 pm

Re: Setting up pywws / writing data to website

Mon Feb 25, 2013 9:54 pm

i think its personal preference where to put the files, maybe someone will come and correct us, but i unzipped the site template into /var/www.

The only problem with it was i had to change the permissions, group and file ownership for the /var/www so that the user weatherstation user could write to the website files.

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Wed Feb 27, 2013 7:51 pm

Hi I've tried to contact weatherbyyou via their forum but can't register for the forum because I don't have a website, very silly. So I thought I'd ask my daft question here.
I've got pywws writing data to /var/www/text as png and txt files but when i go to the webserver I only get the header. I know i'm using index.php in var/www because it changes when i edit it. I can't work out how index.php links to the graphs and data in the text folder - can you tell me where these files should be. I've tried to put them in the www folder but that doesn't make any difference.

Thanks for the help so far

Dave

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Wed Feb 27, 2013 10:18 pm

davehiggins21 wrote:Hi I've tried to contact weatherbyyou via their forum but can't register for the forum because I don't have a website, very silly. So I thought I'd ask my daft question here.
I've got pywws writing data to /var/www/text as png and txt files but when i go to the webserver I only get the header. I know i'm using index.php in var/www because it changes when i edit it. I can't work out how index.php links to the graphs and data in the text folder - can you tell me where these files should be. I've tried to put them in the www folder but that doesn't make any difference.

Thanks for the help so far

Dave
Hi

I registered without a website I used www.idonthaveone.co.uk

I had exactly the same problem make sure the index.txt file is in the same folder as index.php

Cheers

Paul
Procrastination - The Thief of Time.

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Thu Feb 28, 2013 12:23 pm

Thanks for the help - index.txt was in the right place. The problem was that I'd put the data that Pywws was creating in a folder called text instead of data. Correcting that fixed the initial problems - i.e. no data display and now I'm correcting the other errors - slowly. index.php as supplied appears to have lots of errors in it and pywws isn't writing to 1hrs.txt - and I have no idea what Zambretti is but I'm sure I'll work it out in time.

Thanks Dave

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Thu Feb 28, 2013 2:22 pm

davehiggins21 wrote:Thanks for the help - index.txt was in the right place. The problem was that I'd put the data that Pywws was creating in a folder called text instead of data. Correcting that fixed the initial problems - i.e. no data display and now I'm correcting the other errors - slowly. index.php as supplied appears to have lots of errors in it and pywws isn't writing to 1hrs.txt - and I have no idea what Zambretti is but I'm sure I'll work it out in time.

Thanks Dave
Hi

Zambretti I believe is the forecasting algorithm used to produce the forecast and icon.

I assume you have setup 1hrs.txt in the weather.ini file so that it is populated by one of the tasks.
http://pywws.googlecode.com/svn/trunk/d ... gging.html

I dont get any errors with the supplied index.php file. What errors do you see?

Cheers

Paul
Procrastination - The Thief of Time.

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Thu Feb 28, 2013 4:20 pm

Paul - the light is suddenly shining in my addled brain. It's so long since I did any of this that I've forgotten the basics. I used many years ago to manage IBM and ICL mainframes so the principles are there but Linux and HTML are a steep learning curve - but enjoyable especially since there are people like you prepared to help.

1hrs.txt didn't seem to exist as a template in pywws as supplied but I've just found one in the data file and after mving it it then works when I run the job and have it specified in weather.ini!!

My other issues with index.php are similar - it pointed at data files like rose_1hr and 12hrs.png for which templates don't exist and there were some typos - wrong descriptions of the displayed data etc.
But I now have a pretty much working website, no real data yet as it's still not outside due to birthday being a few days away yet.

I just need to understand the Zambretti bit now but my next job is to start the tea and give my brain a rest. Many thanks for all the help

Cheers Dave

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Sat Mar 02, 2013 4:12 pm

Hi Paul - I'm still confused about the Zambretti forecasting. I've asked Jim and he pointed me at Weatherbyyou. Jacques said he doesn't know Linux but has run the system on a router with no problems and believes that the Pi is missing some software. You can run the Forecast function in pywws and get a forecast but that is python code which won't work in PHP (I believe).

Do you have the forecasting working - I have found a PHP implementation of Zambretti at http://weather.gktnet.com/public/weathe ... ti.php.txt and if I can make sense of how to feed it with data I'll try to implement it and document it here (and at Weatherbyyou)

Dave

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Sat Mar 02, 2013 5:42 pm

davehiggins21 wrote:Hi Paul - I'm still confused about the Zambretti forecasting. I've asked Jim and he pointed me at Weatherbyyou. Jacques said he doesn't know Linux but has run the system on a router with no problems and believes that the Pi is missing some software. You can run the Forecast function in pywws and get a forecast but that is python code which won't work in PHP (I believe).

Do you have the forecasting working - I have found a PHP implementation of Zambretti at http://weather.gktnet.com/public/weathe ... ti.php.txt and if I can make sense of how to feed it with data I'll try to implement it and document it here (and at Weatherbyyou)

Dave

Hi Dave

Yes my forecasting appears to work. There is a file in my weather data folder called forecast_icon.txt which appears in the top left of the webpage and shows an icon for the forecast with text below.

There should be a forecast_icon.txt file in your text folder which pywws uses as the template for this.

The settings I have for Zambretti in my weather.ini file are
north=true
baro upper=1050.0
baro lower=950.0

I would like to get it to display snow like the head unit does but currently there isn't an icon for that so I can't experiment at the moment. I've seen this done with the Cumulus software for windows with the same weather station so it must be possible.

Cheers

Paul
Procrastination - The Thief of Time.

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Sat Mar 02, 2013 6:37 pm

hi Paul - - I think I'm beginning to realise why it doesn't work. I don't have any entries for Zambretti in weather.ini and there isn't any documentation of it in Jim's documentation of the .ini file. I don't have a forecast_icon.txt file but I do have a forecast_icon_9am.txt which contains the following.
#hourly#
#timezone local#
#roundtime True#
#jump -1#
#calc "ZambrettiCode(params, data)" "<p><img src=\"images/forecast/%s.png\" title=\"Actual forecast\" alt=\"Icon not available\" /></p>"#
#calc "Zambretti(params, data)" "<p> %s.<br />"#
#idx "<span>Computed at %H:%M <small>%Z:</small></span></p>"#

I've tried putting an entry in the .ini file with [Zambretti] as the description with your parameters in and my file as the text file (text=forecast_icon_9am.txt) - don't know whether that will work or when.

I can't see any files called ZambrettiCode or Zambretti in any folders of either pywws or Weatherbyyou so I don't think this will work unless my understanding is wrong. I'm assuming that the code above will try to run the programs.

I don't understand why I appear to have a different version of the pywws software to you - I downloaded the latest version 12.10 about 2 weeks ago.

Thanks for all the help

Dave

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Sat Mar 02, 2013 8:04 pm

davehiggins21 wrote:hi Paul - - I think I'm beginning to realise why it doesn't work. I don't have any entries for Zambretti in weather.ini and there isn't any documentation of it in Jim's documentation of the .ini file. I don't have a forecast_icon.txt file but I do have a forecast_icon_9am.txt which contains the following.
#hourly#
#timezone local#
#roundtime True#
#jump -1#
#calc "ZambrettiCode(params, data)" "<p><img src=\"images/forecast/%s.png\" title=\"Actual forecast\" alt=\"Icon not available\" /></p>"#
#calc "Zambretti(params, data)" "<p> %s.<br />"#
#idx "<span>Computed at %H:%M <small>%Z:</small></span></p>"#

I've tried putting an entry in the .ini file with [Zambretti] as the description with your parameters in and my file as the text file (text=forecast_icon_9am.txt) - don't know whether that will work or when.

I can't see any files called ZambrettiCode or Zambretti in any folders of either pywws or Weatherbyyou so I don't think this will work unless my understanding is wrong. I'm assuming that the code above will try to run the programs.

I don't understand why I appear to have a different version of the pywws software to you - I downloaded the latest version 12.10 about 2 weeks ago.

Thanks for all the help

Dave
Hi Dave

Ah you've just reminded me, I renamed my file to match the one required by index.php. I have the forecast_icon.txt under my Logged section in the weather.ini file.

I also downloaded the pywws droplets icons from the weatherbyyou website as they are much nicer than the default ones supplied with the weather nature template.

Cheers

Paul
Procrastination - The Thief of Time.

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Sun Mar 03, 2013 9:28 am

Paul could you do me a huge favour please and send me copies of your weather.ini and php.index files. I must have a typo somewhere as I can't get it to work. My email is [email protected].

Cheers dave

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Sun Mar 03, 2013 10:32 am

Hi Dave

Email sent.

Cheers

Paul
Procrastination - The Thief of Time.

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Sun Mar 03, 2013 6:11 pm

Many thanks Paul. I've added a forecast update to the logging section of .ini and I now get a text based forecast - no icon though. I'll see if I can now work out why. The php file is the same so it's something that pywws is doing I think. It may be the template file so I'll see if I can find details of how they work in Jim's documentation. It updated the forecast as at 8.59 this morning although I don't think I edited the .ini file till after that.

Thanks Dave

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Sun Mar 03, 2013 8:38 pm

davehiggins21 wrote:Many thanks Paul. I've added a forecast update to the logging section of .ini and I now get a text based forecast - no icon though. I'll see if I can now work out why. The php file is the same so it's something that pywws is doing I think. It may be the template file so I'll see if I can find details of how they work in Jim's documentation. It updated the forecast as at 8.59 this morning although I don't think I edited the .ini file till after that.

Thanks Dave
Hi Dave

In your weather folder where you have the index.php file you should have a folder called images and inside that another folder called forecast. The forecast folder should have 26 png files in A to Z these are the actual forecast icons that should be displayed top left of the page.

Cheers

Paul
Procrastination - The Thief of Time.

davehiggins21
Posts: 43
Joined: Thu Jan 26, 2012 10:04 am

Re: Setting up pywws / writing data to website

Mon Mar 04, 2013 10:57 am

Hi Paul - yes I have the images/forecast folder with all the .png files in it so that's not the problem. When I saw your message late last night I had hoped that was the problem but no joy. I'll have to find some time to have a quiet think about it and study the code in detail.

Cheers Dave

jimmybobby
Posts: 29
Joined: Wed Feb 20, 2013 9:53 pm

Re: Setting up pywws / writing data to website

Sat Jun 29, 2013 7:41 pm

Hi there, sorry to bring this back up - have followed this, and am trying to load the page (index.php) and I get the HTTP 500 error... I am really new to all this, and need help!
It's fair to say I like obsolete/old technology. :)
A Level Comp Sci Student

brooksymike
Posts: 12
Joined: Wed Aug 28, 2013 9:34 pm

Re: Setting up pywws / writing data to website

Wed Aug 28, 2013 9:49 pm

Hope someone can help. Spent quite some time trying and failing, re-reading and searching forums to setup pywws with weatherbyyou on a webserver. I'm losing the will to live here- surely it can't be this hard! - I am quite experienced with DOS but this seems to be absolutely no help whatsoever with linux.  I am starting to get to grips with linux commands but am having trouble with the website and templates.
I've successfully managed to get logging to wunderground so I know everything's working there, but I'm not sure on where I should be sending all the data files. By default they go to ~/weather/data but to get them working on the webserver I think I need to send them to /var/www/data. Please could someone confirm this? I have unzipped the weatherbyyou folder to /var/www but when I point my browser to "brooksymike.no-ip.org/index.php" it only shows the title of the page. It doesn't look like the example Weather Nature template when viewed from the weatherbyyou website - I know I haven't got the data setup correctly yet but I still would've thought the page should show correctly (cue my next lack of knowledge- php). The documentation appears to suggest that weatherbyyou folders <data> and <plot> need to be saved to /var/www/ but on some of the forums it suggests they should be in /var/www/data. Either way it doesn't seem to work for me. I haven't got pywws uploading to /var/www/data yet (i presume I need to set this up in [paths] in weather.ini,) but to test it have transferred a snapshot of data from ~/weather/data to /var/www/data to try and test it, again without success. I'm sure I'm missing something here so would much appreciate any advice. I would be grateful if someone could send me their weather.ini file with an explanation of the paths wrt where the templates need to be saved and where the data needs to be sent.
Thanks in advance.
Mike Brooks

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Thu Aug 29, 2013 8:48 am

brooksymike wrote:Hope someone can help. Spent quite some time trying and failing, re-reading and searching forums to setup pywws with weatherbyyou on a webserver. I'm losing the will to live here- surely it can't be this hard! - I am quite experienced with DOS but this seems to be absolutely no help whatsoever with linux.  I am starting to get to grips with linux commands but am having trouble with the website and templates.
I've successfully managed to get logging to wunderground so I know everything's working there, but I'm not sure on where I should be sending all the data files. By default they go to ~/weather/data but to get them working on the webserver I think I need to send them to /var/www/data. Please could someone confirm this? I have unzipped the weatherbyyou folder to /var/www but when I point my browser to "brooksymike.no-ip.org/index.php" it only shows the title of the page. It doesn't look like the example Weather Nature template when viewed from the weatherbyyou website - I know I haven't got the data setup correctly yet but I still would've thought the page should show correctly (cue my next lack of knowledge- php). The documentation appears to suggest that weatherbyyou folders <data> and <plot> need to be saved to /var/www/ but on some of the forums it suggests they should be in /var/www/data. Either way it doesn't seem to work for me. I haven't got pywws uploading to /var/www/data yet (i presume I need to set this up in [paths] in weather.ini,) but to test it have transferred a snapshot of data from ~/weather/data to /var/www/data to try and test it, again without success. I'm sure I'm missing something here so would much appreciate any advice. I would be grateful if someone could send me their weather.ini file with an explanation of the paths wrt where the templates need to be saved and where the data needs to be sent.
Thanks in advance.
Mike Brooks
Hi

I am at work at the moment but if no one else replies by this evening I will post my weather.ini file and the other details.

In essense the weather data output from pywws should be in /var/www/data as should the template files for the website but as it is about eight months since I set mine up I will have to check exactly what goes where.

Cheers

Paul
Procrastination - The Thief of Time.

brooksymike
Posts: 12
Joined: Wed Aug 28, 2013 9:34 pm

Re: Setting up pywws / writing data to website

Thu Aug 29, 2013 5:16 pm

Hi Paul. Thanks very much, that would be great.
Should the weatherbyyou folders <plot> and <text> be saved to /var/www/data as supplied, or should the files contained within them be in /var/www/data?
Yes if you could provide me with the file and folder locations as well as the weather.ini that would be much appreciated.

Thanks again

Mikei

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Thu Aug 29, 2013 10:26 pm

Hi

My pywws software resides in /usr/weather and this also contains the plot and text folders (templates to create the webpages).

The actual data from the weather station is stored in /var/www/weather/data/raw and pywws then creates the daily, calib, hourly and monthly folders containing the various data. Also in the /var/www/weather/data folder is the weather.ini file and I have attached a copy of mine below.
When pywws runs it creates the images and text files from the plot and text folders in /usr/weather and places them in /var/www/weather/data. A copy of the contents of my /var/www/weather/data folder is shown below
data.PNG
data.PNG (14.91 KiB) Viewed 8395 times
Contents of the /var/www/weather folder
data1.PNG
data1.PNG (10.04 KiB) Viewed 8395 times
The images folder contains the forecast icons (in a folder called forecast) and three other .png files for the website. There is also a style folder for the webpage style. This should all be in the weather nature template from WeatherByYou http://www.weatherbyyou.com/dl.php?page=4&sort=3

Let me know if you need anything else.

Cheers

Paul

Code: Select all

[fixed]
ws type = 1080
pressure offset = -6.5
fixed block = {'data_changed': 0, 'unknown_18': 0, 'timezone': 0, 'data_count': 4080, 'min': {'hum_out': {'date': '2013-05-02 11:09', 'val': 31}, 'windchill': {'date': '2013-03-11 07:14', 'val': -10.700000000000001}, 'dewpoint': {'date': '2013-05-02 17:00', 'val': 0}, 'temp_in': {'date': '2012-09-30 07:44', 'val': 15.8}, 'abs_pressure': {'date': '2012-12-14 18:36', 'val': 969.6}, 'rel_pressure': {'date': '2012-12-14 18:36', 'val': 973.7}, 'hum_in': {'date': '2013-04-07 11:42', 'val': 20}, 'temp_out': {'date': '2013-01-17 06:21', 'val': -8.3}}, 'lux_wm2_coeff': 0, 'abs_pressure': 1018.0, 'alarm_1': {'hum_out_hi': False, 'hum_in_lo': False, 'hum_in_hi': False, 'hum_out_lo': False, 'time': False, 'bit3': False, 'wind_dir': False, 'bit0': False}, 'alarm_3': {'temp_out_hi': False, 'wind_chill_lo': False, 'dew_point_lo': False, 'temp_in_lo': False, 'wind_chill_hi': False, 'temp_in_hi': False, 'temp_out_lo': False, 'dew_point_hi': False}, 'alarm_2': {'wind_ave': False, 'wind_gust': False, 'rain_hour': False, 'pressure_rel_lo': False, 'pressure_abs_hi': False, 'rain_day': False, 'pressure_rel_hi': False, 'pressure_abs_lo': False}, 'max': {'hum_out': {'date': '2012-09-19 05:33', 'val': 99}, 'windchill': {'date': '2013-08-01 19:05', 'val': 30.8}, 'dewpoint': {'date': '2013-08-01 12:53', 'val': 25.3}, 'uv': {'val': 0}, 'wind_ave': {'date': '2013-04-18 07:59', 'val': 10.9}, 'rain': {'week': {'date': '2012-11-28 10:02', 'val': 108.0}, 'total': {'date': '2013-08-24 23:05', 'val': 736.1999999999999}, 'day': {'date': '2013-07-24 02:20', 'val': 68.39999999999999}, 'hour': {'date': '2013-07-24 00:14', 'val': 51.3}, 'month': {'date': '2012-12-24 15:22', 'val': 289.8}}, 'temp_in': {'date': '2013-08-01 22:54', 'val': 25.0}, 'illuminance': {'val': 0}, 'abs_pressure': {'date': '2013-02-26 21:19', 'val': 1037.2}, 'rel_pressure': {'date': '2013-01-04 10:17', 'val': 1038.2}, 'hum_in': {'date': '2013-08-01 17:49', 'val': 73}, 'temp_out': {'date': '2013-08-01 19:05', 'val': 30.8}, 'wind_gust': {'date': '2013-04-18 08:13', 'val': 16.7}}, 'settings_1': {'pressure_inHg': False, 'pressure_hPa': True, 'temp_out_F': False, 'pressure_mmHg': False, 'rain_in': False, 'temp_in_F': False, 'bit4': False, 'bit3': False}, 'settings_2': {'wind_bft': False, 'wind_mps': False, 'wind_knot': False, 'bit7': False, 'bit6': False, 'bit5': False, 'wind_kmph': False, 'wind_mph': True}, 'read_period': 5, 'rel_pressure': 1011.5, 'unknown_01': 0, 'date_time': '2013-08-29 23:06', 'current_pos': 29328, 'display_2': {'temp_out_temp': True, 'rain_hour': False, 'rain_month': False, 'rain_week': False, 'temp_out_chill': False, 'rain_day': True, 'temp_out_dew': False, 'rain_total': False}, 'display_3': {'illuminance_fc': False, 'bit7': False, 'bit6': False, 'bit5': False, 'bit4': False, 'bit3': False, 'bit2': False, 'bit1': False}, 'alarm': {'hum_out': {'lo': 45, 'hi': 70}, 'windchill': {'lo': 0, 'hi': 20.0}, 'dewpoint': {'lo': -10.0, 'hi': 10.0}, 'uv': 0, 'wind_ave': {'ms': 12.100000000000001, 'bft': 3}, 'rain': {'day': 150.0, 'hour': 3.0}, 'temp_in': {'lo': 0, 'hi': 20.0}, 'illuminance': 0, 'abs_pressure': {'lo': 960.0, 'hi': 1040.0}, 'rel_pressure': {'lo': 960.0, 'hi': 1040.0}, 'hum_in': {'lo': 35, 'hi': 65}, 'temp_out': {'lo': -10.0, 'hi': 30.0}, 'time': '12:00', 'wind_dir': 0, 'wind_gust': {'ms': 23.900000000000002, 'bft': 5}}, 'display_1': {'wind_gust': False, 'show_day_name': False, 'show_year': True, 'time_scale_24': False, 'pressure_rel': False, 'alarm_time': False, 'date_mdy': False, 'clock_12hr': False}}
station clock = 1377795754.19
sensor clock = 1377777165.06

[paths]
work = /tmp
templates = /usr/weather/text
graph_templates = /usr/weather/plot

[config]
logdata sync = 1
gnuplot encoding = iso_8859_1
day end hour = 9

[live]
last update = 
services = []
twitter = []
plot = []
text = []

[logged]
last update = 2013-08-29 22:17:34
plot = ['rose_1hr.png.xml','rose_12hrs.png.xml']
text = ['1hrs.txt','6hrs.txt','forecast_icon.txt']
twitter = []
services = []

[hourly]
last update = 2013-08-29 22:02:34
plot = ['24hrs_full_features.png.xml','24hrs.png.xml','rose_24hrs.png.xml']
text = ['feed_hourly.xml','24hrs.txt']
services = []
twitter = []

[12 hourly]
last update = 2013-08-29 21:02:34
plot = []
text = []
services = []
twitter = []

[daily]
last update = 2013-08-29 09:02:35
plot = ['7days.png.xml','7days_full_features.png.xml','12months.png.xml','28days.png.xml','rose_7days_nights.png.xml']
text = ['feed_daily.xml','7days.txt','forecast_week.txt','allmonths.txt']
twitter = []
services = []

[Zambretti]
north = True
baro upper = 1050.0
baro lower = 950.0

[ftp]
local site = True
secure = False
site = ftp.username.your_isp.co.uk
user = username
password = secret
directory = /var/www/weather/data
Procrastination - The Thief of Time.

brooksymike
Posts: 12
Joined: Wed Aug 28, 2013 9:34 pm

Re: Setting up pywws / writing data to website

Sat Aug 31, 2013 2:35 pm

Paul,

OK great thanks - your post is exactly what I was looking for.
I've been on holiday but I'm back now and looking to work on it over the next few days and try and get it all sorted out.

One further quick question before I do, you've said that your PYWWS software resides in /usr/weather. I do not have a "weather" folder in /usr - I appear to have different things installed in different places.
I followed Jim Easterbrook - How to get started page, using "sudo pip install pywws" -
For example in my case what I presume to be the livelog and hourly scripts (pywws-hourly.py and pywws-livelog.py) are saved in /usr/local/bin. Example files are saved in /usr/local/share/pywws. And the original place where I extracted everything and ran the setup was ~/weather. I guess files in different places is expected as in windows you would expect executables and other things to be installed in different places, and the "How to get started page" does suggest that different things will be in different places. I guess what I am asking is - "Does it matter where it is installed, if the the weather.ini and templates are set up as you have indicated."

I have other teething issues in that no matter which method I try, I can't get get the software to start up automatically after a restart, but I think I'll concentrate on one thing at a time!


Thanks again

Mike

PaulCheffus
Posts: 381
Joined: Tue May 29, 2012 2:51 pm
Location: Lincolnshire UK

Re: Setting up pywws / writing data to website

Sat Aug 31, 2013 5:22 pm

brooksymike wrote:Paul,

OK great thanks - your post is exactly what I was looking for.
I've been on holiday but I'm back now and looking to work on it over the next few days and try and get it all sorted out.

One further quick question before I do, you've said that your PYWWS software resides in /usr/weather. I do not have a "weather" folder in /usr - I appear to have different things installed in different places.
I followed Jim Easterbrook - How to get started page, using "sudo pip install pywws" -
For example in my case what I presume to be the livelog and hourly scripts (pywws-hourly.py and pywws-livelog.py) are saved in /usr/local/bin. Example files are saved in /usr/local/share/pywws. And the original place where I extracted everything and ran the setup was ~/weather. I guess files in different places is expected as in windows you would expect executables and other things to be installed in different places, and the "How to get started page" does suggest that different things will be in different places. I guess what I am asking is - "Does it matter where it is installed, if the the weather.ini and templates are set up as you have indicated."

I have other teething issues in that no matter which method I try, I can't get get the software to start up automatically after a restart, but I think I'll concentrate on one thing at a time!


Thanks again

Mike
Hi Mike

The paths for the text and plot directories will need changing if you haven't put them in /usr/weather so you will need to change that part of the ini file.

To get the software to start from a reboot put the following line in the rc.local file (its in the etc folder)

Code: Select all

sudo python /usr/weather/pywws/code/LiveLog.py -v -l /var/www/weather/data/pywws.log /var/www/weather/data &
You will need to change this to point to your pywws installation and your weather data if it is in a different location. The & on the end makes the job run in the background. You can check the log file to see if there are any errors when it runs.

Cheers

Paul
Procrastination - The Thief of Time.

Return to “Beginners”