Run weewx on two weather stations

1,432 views
Skip to first unread message

Dawei Zhang

unread,
May 17, 2016, 8:20:55 PM5/17/16
to weewx-user
I am trying to change to /etc/weewx.conf so two weather stations stats can be uploaded together, does anyone have any idea what else is needed rather than creating two .conf files in /etc/weewx?

mwall

unread,
May 17, 2016, 9:25:47 PM5/17/16
to weewx-user
On Tuesday, May 17, 2016 at 8:20:55 PM UTC-4, Dawei Zhang wrote:
I am trying to change to /etc/weewx.conf so two weather stations stats can be uploaded together, does anyone have any idea what else is needed rather than creating two .conf files in /etc/weewx?

it is no problem to run many weewx instances on a single computer.  i think i've had 8 weewx instances running on a single rpi2.

each instance must have its own
- configuration file
- database
- pid file
- reports directory

lets say you want to run one instance for a cc3000 data logger and another instance for a vantage.

1) install weewx from .deb package

2) stop weewx
sudo /etc/init.d/weewx stop

3) create the config files
sudo cp /etc/weewx/weewx.conf /etc/weewx/cc3000.conf
sudo cp /etc/weewx/weewx.conf /etc/weewx/vantage.conf

4) modify the config files, specifically in vantage.conf:

[Station]
    station_type = Vantage

[Vantage]
    ...

[StdReport]
    HTML_ROOT = /var/www/vantage

[Databases]
    database_name = vantage.sdb

in cc3000.conf:

[Station]
    station_type = CC3000

[CC3000]
    ...

[StdReport]
    HTML_ROOT = /var/www/cc3000

[Databases]
    database_name = cc3000.sdb

5) create an init script for each instance
sudo cp /etc/init.d/weewx /etc/init.d/weewx-cc3000
sudo cp /etc/init.d/weewx /etc/init.d/weewx-vantage

6) modify the init script, specifically

WEEWX_CFG=/etc/weewx/vantage.conf
NAME=weewx-vantage
DAEMON_ARGS="--daemon --log-label $NAME --pidfile=$PIDFILE $WEEWX_CFG"

WEEWX_CFG=/etc/weewx/cc3000.conf
NAME=weewx-cc3000
DAEMON_ARGS="--daemon --log-label $NAME --pidfile=$PIDFILE $WEEWX_CFG"

(adding the --log-label option makes it easier to distinguish the different processes, or to filter output to separate log files)

7) configure to start at boot
sudo update-rc.d weewx remove
sudo update-rc.d weewx-vantage defaults
sudo update-rc.d weewx-cc3000 defaults

8) start each instance
sudo /etc/init.d/weewx-vantage start
sudo /etc/init.d/weewx-cc3000 start

if you have multiple vantage stations on a single computer, you'll have to specify a different serial port for each one.  other stations such as the ws28xx have a serial number burned into them that can be used to distinguish.

you can then run wee_reports on a third .conf that combines data from the stations, or does a single upload of data from both stations, etc.

if you don't know how to create the driver stanza for the config manually, you can copy the .dist config then run wee_config --reconfigure on the copy to specify a driver and get a working configuration.

m

daweizh...@gmail.com

unread,
May 18, 2016, 9:23:59 PM5/18/16
to weewx-user
Hi mwall --

Thanks a lot for you instructions. I have two vantage-pro2 weather stations data to upload, and I actually got the remote side weather stations data upload successfully...the local one said "start-stop-daemon: --start needs --exec or --startas [fail] May I know which step should I specify a different serial port? So far the only difference is one is 192.168.1.2(local) and 192.168.1.85(remote).

mwall

unread,
May 18, 2016, 10:09:31 PM5/18/16
to weewx-user
On Wednesday, May 18, 2016 at 9:23:59 PM UTC-4, daweizhang0202 wrote:
Thanks a lot for you instructions. I have two vantage-pro2 weather stations data to upload, and I actually got the remote side weather stations data upload successfully...the local one said "start-stop-daemon: --start needs --exec or --startas [fail] May I know which step should I specify a different serial port? So far the only difference is one is 192.168.1.2(local) and 192.168.1.85(remote).

sorry, but you lost me.  your statement of "I actually got the remote side weather stations data upload successfully" sort of parses but does not compile, and you have provided no context for the bit about start-stop-daemon.

start from the beginning:  are the vantage stations connected via serial, usb, or tcp/ip?

Dawei Zhang

unread,
May 19, 2016, 1:11:00 AM5/19/16
to weewx-user
Sorry for the confusion. 

I used TCP/IP for the interface to vantage pro2 on local and remote sides. 

On step 3) I copied two conf file: weewxLocal.conf and weewxRemote.conf.

On step 4) Both database_name = vantage.sdb

On step 5) and 6) weewx_vantagelocal and weewx_vantageremote were used accordingly

Step 7) is followed too, both defaults update are the identical

Step 8) weewx_vantagelocal [fail], weewx_vantageremote [ok]

In addition, I am uploading weewx data to graphite server using the weewx graphite extension, on the graphite server "http://localhost 81" weewx was shown instead of weewxremote

I hope it makes sense, and I will double check on each .conf file too. Thanks.

mwall

unread,
May 19, 2016, 9:43:57 AM5/19/16
to weewx-user
On Thursday, May 19, 2016 at 1:11:00 AM UTC-4, Dawei Zhang wrote:
Sorry for the confusion. 

I used TCP/IP for the interface to vantage pro2 on local and remote sides. 

On step 3) I copied two conf file: weewxLocal.conf and weewxRemote.conf.

On step 4) Both database_name = vantage.sdb

On step 5) and 6) weewx_vantagelocal and weewx_vantageremote were used accordingly

Step 7) is followed too, both defaults update are the identical

Step 8) weewx_vantagelocal [fail], weewx_vantageremote [ok]

In addition, I am uploading weewx data to graphite server using the weewx graphite extension, on the graphite server "http://localhost 81" weewx was shown instead of weewxremote

I hope it makes sense, and I will double check on each .conf file too. Thanks.


maybe i'm just thick, but i still don't follow.  is there a single vantage station, or two vantage stations?  one computer talking to a single vantage station via two different network interfaces?  or a single computer talking to two different vantage stations, each via tcpip?  or something else?

assuming that you mean 'one computer getting data from two vantage stations via tcpip, one local and one remote', then:

- you must have two different config files, say vantage-a.conf and vantage-b.conf
- you must have separate databases, say vantage-a.sdb and vantage-b.sdb
- you need either two different init scripts, or you'll have to do considerable rewrite to make a single init script

i highly recommend splitting the log output to separate files, say /var/log/weewx-a.log for one station and /var/log/weewx-b.log for the other.  do this with an rsyslog.d conf file (see the sample in util/rsyslog.d) and the --log-label option in the init scripts.  you'll need to make logrotate manage those logs (see util/logrotate.d).

i highly recommend using a separate invocation of wee_reports, with its own .conf, to generate any reports that use data from both stations.

you'll have to post the logs if you want any help with failures.

m

Dawei Zhang

unread,
May 19, 2016, 12:56:46 PM5/19/16
to weewx-user
Thanks a lot for the clarification, with two .conf files, two sdb databases, and two initd scripts, both sudo /etc/init.d/weewx-a(and b) work. May I know which kind of logs should I upload? 

f4n...@gmail.com

unread,
Mar 7, 2022, 2:13:59 AM3/7/22
to weewx-user
How is this done:
" you can then run wee_reports on a third .conf that combines data from the stations, or does a single upload of data from both stations, etc."
Could i choose certain sensors of each station?

Benedict

unread,
Jun 2, 2025, 4:23:41 PMJun 2
to weewx-user
Yes, I would like know this as well. How does the wee-reports generate one site with both station outputs combined, in graphs and text-td's etc ? Thus far I have separated config for two source drivers, which both generate the same web root output, but this of course does not work. How does one merge both into one page?
Did you ever find out how to accomplish this?

vince

unread,
Jun 2, 2025, 5:57:49 PMJun 2
to weewx-user
Several ways.  One is to have station2 publish pertinent items to MQTT and have station1 subscribe to those topics and save to station1's db using one of the extraWhateverN elements in its db.

A second way is to run the two instances on the same system and write to differently named databases in the same archive directory.   You'd then define the station2 db in [DataBindings] and [Databases] so it's known to the station1 weewx instance.   Then you'd just need to explicitly reference which db to get the pertinent item from in your .tmpl files and let station1's weewx instance generate the aggregate result.

See https://www.weewx.com/docs/5.1/custom/multiple-bindings/?h=binding for the long description of the howto and why.

matthew wall

unread,
Jun 2, 2025, 6:58:00 PMJun 2
to weewx...@googlegroups.com


> On Jun 2, 2025, at 16:23, Benedict <jul...@gmail.com> wrote:
>
> Yes, I would like know this as well. How does the wee-reports generate one site with both station outputs combined, in graphs and text-td's etc ? Thus far I have separated config for two source drivers, which both generate the same web root output, but this of course does not work. How does one merge both into one page?
> Did you ever find out how to accomplish this?

this wiki page explains some general strategies:

https://github.com/weewx/weewx/wiki/dashboards

if you use the 'weectl report' approach, then you will need to read the docs about multiple database bindings:

https://weewx.com/docs/5.1/custom/multiple-bindings/


the all-weewx way:

if you are already running two weewx instances and you just want to combine data into single report, then you probably want to run the report generator as a cron job.

1) create a weewx config file for the report generator. you only need the database info (to tell it where to find data) and the report info (to tell it which skin to use)

2) create a skin that is a combination of data

3) run 'weectl report' every x minutes, preferably just after both weewx data collection instances have completed an archive interval


the grafana way:

1) install the influxdb uploader in each weewx instance

2) create a grafana dashboard that includes data from both weewx instances


the mqtt way:

1) install the mqtt uploader in each weewx instance

2) in whatever mqtt client you use, create a dashboard that includes data from both weewx instances



matthew wall

unread,
Jun 2, 2025, 7:00:13 PMJun 2
to weewx...@googlegroups.com
i should also add that you *could* make one of your two weewx instances 'know' about the other one by adding data bindings. then refer to the two bindings in the weewx skin used by that instance. however, i would suggest *not* doing this, because it creates a brittle coupling that you probably don't want to maintain. better to keep the instances independent, then join the data using a separate mechanism.

vince

unread,
Jun 3, 2025, 1:10:49 PMJun 3
to weewx-user
 Not understanding why this is brittle. Weewx has supported multiple db since v3 if my hazy memory is correct. Thats a lot of years of very stable.

I  use the weewx-multi plus MQTT solution here so I can feed a Home Assistant dashboard containing other things via MQTT, but that broker in the middle adds complexity a simple two-station weewx probably doesn’t require.

matthew wall

unread,
Jun 3, 2025, 4:17:12 PMJun 3
to weewx...@googlegroups.com
it is brittle because of the dependency of one weewx instance upon another. not saying it won't work, it just introduces a coupling.

i prefer to have each weewx instance do its own thing, ideally using a generic, unmodified skin.

then make an aggregated instance to unify everything, whether that is weewx, influx+grafana, mqtt+homeassistant, or any other aggregation.

that way i can upgrade/update weewx instances without too much concern, and focus only on the aggregated report for anything customized i have done.

i once ran a computer with 5 different types of hardware on it - one weewx instance for each weather station. then i ran the report generator as a cron job to pull all of the data into a single skin so i could compare sensors from all the stations.

of course, eventually sunlight won and broke down the plastics in all of the anemometers, and salt air got into the battery compartments. but it was fun for a few years.

i guess the uv damage was the real source of 'brittle' ;)
> --
> You received this message because you are subscribed to the Google Groups "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/weewx-user/ec515105-0b9e-4cc3-a0c0-6263bcd77c25n%40googlegroups.com.

vince

unread,
Jun 4, 2025, 1:39:25 PMJun 4
to weewx-user
I solved the 'upgrade/update' problem by rolling all my skins into extension-installable custom ones.  Don't use any default skins at all.

But sure.  I got into the same A-needs-B-which-needs-C-which-needs-A mess with multiple skins that I wrote all assuming the other ones and their required extensions were there.  debug=1 logs helped of course in battling through it.

FWIW - I did learn that occasionally trying to do a full install from scratch step-by-step finds those things pretty quickly though.  Eventually I said heck with it and just got it all working once and then did a cron job to back up / compress / save all of my weewx-data tree nightly for stashing in 'multiple' places just in case, plus a 'weectl extension list' output so I knew what else I had installed.

Reply all
Reply to author
Forward
0 new messages