Run weewx on two weather stations

972 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?

Reply all
Reply to author
Forward
0 new messages