weewx: Quick Start Guide for Linux


This is a guide to install weewx on Linux systems. The installation will place weewx in the /home/weewx directory with the following:

configuration file: /home/weewx/weewx.conf
skins and templates: /home/weewx/skins/
sqlite databases: /home/weewx/archive/
web pages and images: /home/weewx/public_html/

Install Prerequisites

Debian, Ubuntu, Mint Redhat, CentOS, Fedora

# required packages:
sudo apt-get install python-configobj
sudo apt-get install python-cheetah
sudo apt-get install python-imaging

# if using MySQL:
sudo apt-get install python-mysqldb
sudo apt-get install python-mysql-client

# serial or USB, depending on hardware:
sudo apt-get install python-serial
sudo apt-get install python-usb

# for extended almanac information:
sudo apt-get install python-dev
sudo apt-get install python-pip
sudo pip install pyephem

# required packages:
sudo yum install python-configobj
sudo yum install python-cheetah
sudo yum install python-imaging

# if using MySQL:
sudo yum install python-mysqldb
sudo yum install python-mysql-client

# serial or USB, depending on hardware:
sudo yum install pyserial
sudo yum install pyusb

# for extended almanac information:
sudo yum install pyephem

SuSE Python Setup Tool (pip)

sudo yast -i gcc
sudo yast -i python-configobj
sudo yast -i python-imaging
sudo yast -i python-devel
sudo yast -i setuptools

# install pip
sudo pip install Cheetah

# serial or USB, depending on hardware:
sudo yast -i pyserial
sudo yast -i pyusb

# for extended almanac information:
sudo pip install pyephem

# required packages:
sudo pip install configobj
sudo pip install Cheetah
sudo pip install pil

# serial or USB, depending on hardware:
sudo pip install pyserial
sudo pip install pyusb

# for extended almanac information:
sudo pip install pyephem

Download

Download the source archive weewx-X.Y.Z.tar.gz from Sourceforge

Install

Expand the source archive:

tar xvf weewx-X.Y.Z.tar.gz

Change directory:

cd weewx-X.Y.Z

Then build and install:

./setup.py build
sudo ./setup.py install

The install will place weewx in /home/weewx, so sudo is probably required.

Configure

Edit the configuration file /home/weewx/weewx.conf. Set at least the following:

Also set any parameters specific to the station, such as the port for stations connected via serial port.

If you have a weather station from the Davis Vantage series, many of the configuration data will be downloaded from your hardware, including altitude, archive interval, and the start of your rain year. If you have not set these, you can either do so by following the instructions in the manual that came with your weather station, or by using the configuration utility config_vp.py, which is included with weewx. To see how to run config_vp.py:

# This works only for Davis Vantage weather stations!
cd /home/weewx
./bin/config_vp.py weewx.conf --help

Run

Run the main program from the command line:

cd /home/weewx
./bin/weewxd.py weewx.conf

Or as a daemon automatically when the computer starts:

Debian, Ubuntu, Mint Redhat, CentOS, Fedora

sudo cp util/init.d/weewx.debian /etc/init.d/weewx
sudo chmod +x /etc/init.d/weewx
sudo update-rc.d weewx defaults 98
sudo /etc/init.d/weewx start

sudo cp util/init.d/weewx.redhat /etc/init.d/weewx
sudo chmod +x /etc/init.d/weewx
sudo chkconfig weewx on
sudo /etc/init.d/weewx start

SuSE

sudo cp util/init.d/weewx.suse /etc/init.d/weewx
sudo chmod +x /etc/init.d/weewx
sudo chkconfig weewx on
sudo /etc/init.d/weewx start

Verify

After 5 minutes, open the station web page in a web browser. You should see the default weewx page with your station information and data.

file:///usr/lib/weewx/html/index.html

Status

Look in the system log for messages from weewx.

sudo tail -f /var/log/messages

Customize

To enable uploads such as Weather Underground or to customize reports, modify the configuration file /etc/weewx.conf. See the User Guide and Customization Guide for details.

weewx must be restarted for configuration file changes to take effect.

Uninstall

To uninstall, simply delete the directory /home/weewx. This will delete weewx, configuration files, and data.

sudo rm -r /home/weewx sudo rm /etc/init.d/weewx