HOWTO: Install FreshWDL on your Weather Raspberry Pi

The master copy of this HOWTO can now be found on WeatherWiki

If you’ve set up a Raspberry Pi to grab data from your weather station using consolewd and push the data to your Internet web site for the world to see then you might be wondering what else you can do with the Raspberry Pi. They’re clever little computers that are more powerful than you might imagine for their size. How about turning it into a web server that runs FreshWDL? Here’s how to do that…

0) Introduction

I’ve only tested this with a Raspberry Pi Model 3B+. It should work on a Model 4 and will probably work on other Model 3 Pi’s but I’m not sure whether it will work on Model 1/2 Pi’s. The instruction also has two placeholders that you will need to replace with your own settings. They are:

  • <consolewd_dir> - The directory where the consolewd and clientraw data files are located on your Raspberry Pi
    [li] - The IP address of your Raspberry Pi on your home network. Probably something like 192.168.0.xxx. The steps below are all carried out on your Raspberry Pi. Log into it using SSH and do the following…
    [/li]

1) Install Apache web server

sudo apt update
sudo apt install apache2 -y

This will install the Apache web server software and run it. It should also set it to run automatically on reboot. You can test that Apache has installed correctly by browsing to “http://”, e.g. “http://192.168.0.xxx

2) Make a web directory for FreshWDL

sudo mkdir /var/www/html/fresh

You can choose another directory, or even make it the default web page for the Raspberry Pi, but I’ll leave that for you to work out if you want to do it.

3) Download and install FreshWDL

wget https://github.com/Yerren/FreshWDL/archive/master.zip
unzip master.zip
cd FreshWDL-master
sudo cp FreshWDLmaster.html /var/www/html/fresh/index.html
sudo cp config.js /var/www/html/fresh

This downloads the latest FreshWDL to the current directory on your Pi (I assume a directory that you can write files to), then unzips the master.zip file into a sub-directory of your current directory called FreshWDL-master. Then changes into the FreshWDL-master directory and copies the two files needed for FreshWDL into your ‘fresh’ web server directory.

4) Create links to the clientraw data files

cd /var/www/html/fresh
sudo ln -s <consolewd_dir>/clientraw.txt clientraw.txt
sudo ln -s <consolewd_dir>/clientrawextra.txt clientrawextra.txt
sudo ln -s <consolewd_dir>/clientrawhour.txt clientrawhour.txt
sudo ln -s <consolewd_dir>/clientrawdaily.txt clientrawdaily.txt

This creates links to the 4 clientraw data files used by FreshWDL in the ‘fresh’ web server directory. This allows FreshWDL in the web browser to see the clientraw files that consolewd is creating.

5) Modify the FreshWDL config to suit your own requirements

sudo nano /var/www/html/config.js

Edit the /var/www/html/fresh/config.js file. Don’t change the filename settings at the top of the file and make sure that customBaseURL is set to false (the default). The other settings can be modified as you require. You can also edit the /var/www/html/fresh/index.html file to show your station name. See the FreshWDL documentation for the changes you can make to these files.

6) Test your new copy of FreshWDL

Browse to “http:///fresh” and you should see your station data displayed and updating in a FreshWDL page.