Showing posts with label RaspberryPi. Show all posts
Showing posts with label RaspberryPi. Show all posts

Wednesday, 27 January 2016

Raspberry Pi and Weather

I’ve just set up my new Raspberry Pi as a web server for the weather station my wife got me for my birthday last year.

The initial setup was very straightforward:
  • Plug the Raspberry Pi into the TV and power up
  • Configure the Pi to start into console mode (as I’m running the Pi as a headless server) and install ssh
  • Log on, startx and set up the USB wifi module.
... and the first interesting problem was that I couldn’t access the Pi using its name; ssh (and ping and everything else) could only use the IP address. Running
sudo apt-get install avahi-daemon
 got around this problem—I can now ssh to dave@raspberrypi.local :-)

Next issue—while the time had been set once the wifi had been set up, the time zone was all wrong. Running
sudo dpkg-reconfigure tzdata
allowed me to set the timezone correctly. Now I could shut down, move the Pi to where the weather station console is, restart and set up Cumulus. Again, it was fairly straightforward following the instructions:
  • Install mono-complete
  • Unzip the CumulusMX installation files into ~/CumulusMX
  • Run Cumulus using sudo mono CumulusMX.exe
At this stage, I haven’t plugged in the weather station. I was then able to set up the location, units etc using the web interface from my laptop. Once correctly set up, I then stopped Cumulus.

As the weather station was installed before Christmas, I wanted to ensure that all te data was downloaded. I edited the newly-created file Cumulus.ini:
StartDate=Monday, 21 December 2015
and created the file data/today.ini:

[General]
Date=21/12/2015
Timestamp=2015-12-21T00:00:00
CurrentYear=2015
CurrentMonth=12
CurrentDay=21

Running Cumulus again downloaded all the data from 21 Dec, and we were in business!

Last thing to set up was ensuring Cumulus kept running evening when I exited ssh, so I used the script kindly provided by slashmusic—this worked perfectly, and I now have my Pi running as a little webserver collecting weather information continuously!