These are generic instructions for installing WeeWX using the Python utility setup.py.
Download the source archive weewx-X.Y.Z.tar.gz from weewx.com/downloads.
While WeeWX will run under either Python 2 or Python 3, you should run it under Python 3, if possible. Python 2 is no longer supported by the Python Software Foundation.
The "default" version of Python, that is, the version that is invoked with the simple command python, varies from system to system. However, the command python3 will always invoke Python 3, so it's safest to use that.
The instructions below assume you will be using Python 3.
First install the prerequisites appropriate for your operating system.
sudo apt update # Required sudo apt install python3-configobj sudo apt install python3-pil sudo apt install python3-serial sudo apt install python3-usb sudo apt install python3-pip sudo pip3 install cheetah3 # Optional: sudo apt install python3-ephem # Required if you are using MySQL (MariaDB): sudo apt install mysql-client sudo apt install python3-mysqldb
sudo apt update # Required sudo apt install python3-configobj sudo apt install python3-cheetah sudo apt install python3-pil sudo apt install python3-serial sudo apt install python3-usb # Optional: sudo apt install python3-ephem # Required if you are using MySQL (MariaDB): sudo apt install mariadb-client sudo apt install python3-mysqldb
Expand the source archive:
tar xvfz weewx-X.Y.Z.tar.gz
Change directory:
cd weewx-X.Y.Z
To specify a location different from the standard /home/weewx, modify the parameter home in the setup.cfg file. Mac users will want to change it to /Users/Shared/weewx.
Then build and install:
python2 ./setup.py build sudo python2 ./setup.py install
python3 ./setup.py build sudo python3 ./setup.py install
Run the main program directly:
cd /home/weewx sudo ./bin/weewxd
Or as a daemon automatically when the computer starts:
cd /home/weewx 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
cd /home/weewx sudo cp util/init.d/weewx.redhat /etc/rc.d/init.d/weewx sudo chmod +x /etc/rc.d/init.d/weewx sudo chkconfig weewx on sudo /etc/rc.d/init.d/weewx start
cd /home/weewx sudo cp util/init.d/weewx.suse /etc/init.d/weewx sudo chmod +x /etc/init.d/weewx sudo /usr/lib/lsb/install_initd /etc/init.d/weewx sudo /etc/init.d/weewx start
Look in the system log for messages from WeeWX. For example, on Debian systems:
sudo tail -f /var/log/syslog
After about 5 minutes, open the station web page in a web browser. You should see your station information and data. If your hardware supports hardware archiving, then how long you wait will depend on the archive interval set in your hardware.
file:///home/weewx/public_html/index.html
To enable uploads such as Weather Underground or to customize reports, modify the configuration file /home/weewx/weewx.conf. See the User Guide and Customization Guide for details.
WeeWX must be restarted for configuration file changes to take effect.
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
The installation will place WeeWX in the /home/weewx directory with the following layout:
| executable: | /home/weewx/bin/weewxd |
| configuration file: | /home/weewx/weewx.conf |
| skins and templates: | /home/weewx/skins/ |
| sqlite databases: | /home/weewx/archive/ |
| generated web pages and images: | /home/weewx/public_html/ |
| documentation: | /home/weewx/docs/ |
| examples: | /home/weewx/examples/ |
| utilities: | /home/weewx/bin/ |
© Copyright Tom Keffer