Environment monitoring with Raspberry Pi – part 5

Hopefully this is the final part which gets the Raspberry Pi working as a weather monitoring station. I will cover the little things that need to be done with the website and confirm the final weather.ini and other tweaks required where appropriate.

Starting with the weather.ini file, the bits that really do make a difference:


templates = /var/www/text/

graph_templates = /var/www/plot/

work = /var/www/temp/

[ftp] secure = False

site = localhost

local site = True

user = anonymous

directory = /var/www/public/

password = anonymous

Based on these settings then some changes need to be made to the website page index.php, I am not going through all the settings but will pick a couple of samples so that you get the idea. My Raspberry Pi is now working and collecting and presenting weather data internally to me based on these changes. The site is not open to public viewing yet.

Some blocks of code from index.php, key areas requiring change will be the path:


require_once(‘public/forecast_icon.txt’)- note the path in this line needed changing, note the change to the filename too from an earlier post


text template part of web code:

case “1hour”:

require_once(‘public/1hrs.txt’); – note the path in this line needed changing


graph presentation part:

case “24h_graph”:

echo ‘<h2>Last 24 hours graphs</h2>’; – The title of the graph needed changing

echo ‘<p><img src=”public/24hrs.png” alt=”” title=”” /></p>’; – note the path in this line needed changing


attached is a sample graph screen grab from my web page to show what it should look like when you select the 24 hours graph option from the left hand menu.

I hope by following the steps I have outlined you have a little less trouble than I did getting your Raspberry Pi interfaced to a Maplin (or Fine Offset WH-1080) USB weather station.

You will need to spend time customising the Weather By You supplied Weather Nature template as in its raw form it will not work, hopefully the sample bits above will give you enough to work with as they are repeated in for each of the options.

From scratch it has taken me most of the day to build mine while at the same time writing these blog posts so that I have my how-to documented and available for others to use.

Next set of posts will be for setting up the CurrentCost meter which works with the Pi, just need to write it up 🙂 Will wait till the weather site has been running for a few days first.

Good luck


Nearly forgot, once you are happy all is ok and data is being collected and published as expected, you might want to reduce the collection interval by stopping the pywws LiveLog process and then running

python SetWeatherStation.py -r XX replacing XX with the value of you choice in minutes, then restarting the LiveLog.py command to resume data collection


I like all things of a technical nature. More of a hardware specialist than a software one though. At a programming level I know enough to be dangerous but couldn't earn a living from it........yet I hold a full UK Amateur Radio Licence, have dabbled in computing for about 30 years starting with a Sinclair ZX81 and gradually progressed a bit and now working towards making the home a bit more intelligent through the use of home automation technologies, hence this blog as somewhere to keep my notes where I can find them

Tagged with: , , , ,
Posted in Raspberry Pi, Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: