Difference between revisions of "WeeWX Weather Server"

From Da Nerd Mage Wiki
Jump to navigation Jump to search
Line 16: Line 16:
* <code>sudo apt update</code>
* <code>sudo apt update</code>
* <code>sudo apt install weewx</code>
* <code>sudo apt install weewx</code>
During this step, you will be asked for all the details about your install.
During this step, you will be asked for all the details about your install.


Fill everything in as best you can, but you can indeed change things later too.
Fill everything in as best you can, but you can indeed [[#OTHER CUSTOMISATIONS{{!}}change things later]] too.


If you are using weather station hardware that is supported by default, go ahead and select that hardware when asked. In my case, I'm currently running an EcoWitt weather station & that will require a little more effort. For now, I'm selecting '''Simulator''' as my hardware type.
If you are using weather station hardware that is supported by default, go ahead and select that hardware when asked. In my case, I'm currently running an EcoWitt weather station & that will require a little more effort. For now, I'm selecting '''Simulator''' as my hardware type.


Once the machine has finished churning away at the install, WeeWX will be running. You can verify this by running:
Once the machine has finished churning away at the install, WeeWX will be running. You can verify this by running:


* <code>sudo systemctl status weewx</code>
* <code>sudo systemctl status weewx</code>

Revision as of 17:13, 31 August 2025

This particular set of instructions is based on building a Debian 12 based LXC under Proxmox to handle WeeWX. On my network, I have an existing WebServer & an existing Automation Server. The intent is to have the weather information served up as a web page (Default WeeWX thing...) by the WebServer and also be used by the Automation Server.

There is also a dedicated Database Server which we will be using. (can't possibly do things the easy way...)

(Based on: WeeWX: Installation on Debian-based systems)

Originally, the old version of this article was done with a much earlier version of WeeWX & our old Accurite weather station. Things have seriously changed since those days...

Configure apt

  • sudo apt install -y wget gnupg
  • wget -qO - https://weewx.com/keys.html | sudo gpg --dearmor --output /etc/apt/trusted.gpg.d/weewx.gpg
  • echo "deb [arch=all] https://weewx.com/apt/python3 buster main" | sudo tee /etc/apt/sources.list.d/weewx.list

Install WeeWX

  • sudo apt update
  • sudo apt install weewx

During this step, you will be asked for all the details about your install.

Fill everything in as best you can, but you can indeed change things later too.

If you are using weather station hardware that is supported by default, go ahead and select that hardware when asked. In my case, I'm currently running an EcoWitt weather station & that will require a little more effort. For now, I'm selecting Simulator as my hardware type.

Once the machine has finished churning away at the install, WeeWX will be running. You can verify this by running:

  • sudo systemctl status weewx

Setting up for EcoWitt gear

You'll be installing the Ecowitt Gateway (formerly GW1000) Driver

(Something happened to the original developer & all his stuff has vanished from the Interwebs...)

  • wget -O weewx-gw1000.zip https://github.com/hoetzgit/weewx-gw1000/archive/master.zip
  • sudo weectl extension install weewx-gw1000.zip

Verify it can talk to your EcoWitt gateway:

  • PYTHONPATH=/usr/share/weewx python3 /etc/weewx/bin/user/gw1000.py --test-driver --ip-address=device_ip_address

(Where you replace device_ip_address with the actual address of your gateway...)

You should observe loop packets being emitted on a regular basis. Once finished press ctrl-c to exit.

Note: You will only see loop packets and not archive records when running the driver directly. This is because you are seeing output not from WeeWX, but rather directly from the driver.

Configure WeeWX to use the driver:

  • sudo weectl station reconfigure --driver=user.gw1000

restart WeeWx

  • sudo systemctl restart weewx

(Note: I've verified this with GW1100 and GW1200 gateways so far...)

Customising WeeWX

Broadcasting over MQTT

Install paho-mqtt

  • sudo apt -y install python3-paho-mqtt

Download the WeeWX MQTT Extension:

  • wget -O weewx-mqtt.zip https://github.com/matthewwall/weewx-mqtt/archive/master.zip

Install the extension:

  • sudo weectl extension install weewx-mqtt.zip

Then edit weewx.conf to configure things for your own MQTT server

  • sudo vim /etc/weewx/weewx.conf

Scroll down & find the [[MQTT]] block, then edit it to suit your network.

   [[MQTT]]
       server_url = mqtt://Machine.Domain.TLD:1883
       topic = weather
       unit_system = METRIC

restart WeeWx

  • sudo systemctl restart weewx

Connecting to a remote database

(coming soon...)

Uploading to your own webserver

(Really, coming soon...)

OTHER CUSTOMISATIONS

There is a configuration file at:

  • /etc/weewx/weewx.conf

that holds most (if not all) of the little details & tweaks for your weather server.