how to merge data from two weather stations. fedora

388 views
Skip to first unread message

William Garber

unread,
Apr 24, 2022, 5:19:34 PM4/24/22
to weewx-user
According to Tom Keffer there are two strategies.
I am doing the first one as documented here  https://github.com/weewx/weewx/wiki/weewx-multi
I can not use the init.d script "weewx-multi" since I am using fedora which does not  have "/lib/init/vars.sh" or "/lib/lsb/init-functions" since it uses systemd (and systemctl).
What I did is I just modified the standard "/etc/init.d/weewx" script to "/etc/init.d/weewx_atlas"
I just changed "NAME=weewx_atlas" for the first instance. 
Then changed "NAME=weewx_wmod" for the second instance and
"NAME=weewx_merge" for the third instance of the weewx demon.
Then I need three files /etc/weewx/weewx_atlas.conf and weewx_wmod.conf and weewx_merge.conf.
The database file names and HTML_ROOTs have to be unique in each.
Other than that the main difference is the weewx_merge.conf has under [DATA_BINDINGS] two sections [atlas_binding] with "database=archive_sqlite_atlas"  and [wmod_binding] with "database=archive_sqlite_wmod".  And under [Databases] two sections [archive_squlite_wmod] with "database_name = weewx_wmod.sdb" and [archive_sqlite_atlas] with "database_name = weewx_atlas.sdb".
Everything else is same but ...
[[SeasonsReport]]
    [[[ImageGenerator]]]
        [[[[day_images]]]]
                [[[[[daybarometer]]]]]
                     [[[[[[wmodBarometer]]]]]]
                           data_type = barometer
                           data_binding = wmod_binding
                           label = WM barometer
                     [[[[[[atlasBarometer]]]]]]
                           data_type = barometer
                           data_binding = atlas_binding
#                          label = AT barometer                                                    
                           label = AT barom
and so on for all sensors

So the question is how to prevent pipeline from attempting to do archive operations and change the databases?  And what driver to use?  I do not really need a driver.
weewx_merge.conf

William Garber

unread,
Apr 24, 2022, 5:49:54 PM4/24/22
to weewx-user
https://groups.google.com/g/weewx-user/c/FsKRIt8wG5I    A very similar discussion but no specific answer I think.  In the "[Station] section what "station_type" would I choose?  In the "[Engine]" section could I just leave "archive_services = " blank?  I am afraid to try it.
weewx_atlas.conf
weewx_wmod.conf

gjr80

unread,
Apr 24, 2022, 6:38:08 PM4/24/22
to weewx-user
If you have two weather stations and wish to run weewx-multi you will typically run two WeeWX instances not three. In terms of combined reporting there are two basic options; first have one of your instances generate the combined reports or second, as Matthew mentions in a post in the thread cited in your last post, use wee_reports to generate your combined reports based on a third config file (note that this 'third config file' is not used with a WeeWX instance, rather it is used solely by wee_reports to generate the reports specified in it's [StdReport] stanza; most of the rest of the third config file (eg driver, services etc) can specify whatever you want, though data bindings/datbases etc will need to be correctly specified.)

Generally speaking my preference is the former, no need for a third config file nor the mechanism (cron?) to run it, everything is taken care of by WeeWX.

Gary

William Garber

unread,
Apr 25, 2022, 12:13:49 AM4/25/22
to weewx-user
  File "/usr/share/weewx/weewx/manager.py", line 701, in get_manager_dict_from_config
    raise weewx.UnknownBinding("Unknown data binding '%s'" % e)
weewx.UnknownBinding: Unknown data binding ''wx_binding''

I am getting this error.  Does one of the bindings have to be called wx_binding?

gjr80

unread,
Apr 25, 2022, 12:30:03 AM4/25/22
to weewx-user
Impossible to answer in a meaningful way without knowing what you are trying to do to what and in what way. Simple answer is that no, one of the binding does not need to be wx_binding; however, wx_binding is the default binding so if whatever you may be doing cannot find a binding to use it will try the default.

Gary

William Garber

unread,
Apr 25, 2022, 10:57:19 AM4/25/22
to weewx-user
The following may be useful for someone who wants to do this on fedora
attached is a "goodie bag" full of stuff for setting up a multiple weather station system on fedora.  It uses systemd services and timers.  It is based on the three- weewx.conf file setup; two for archiving data from weather stations and one for reports only (although this was not recommended).  I could only get the reports working by  making one of the bindings called wx_binding.  Something (conversions I think) kept referring to wx_binding.
Included are systemd setup; driver for my new custom weather station I build from scratch as a packaged extension (based on ultimeter.py Peet Brothers);  udev setup for ttyUSB permanent device naming; /etc/weewx/weewx_xxx.conf for atlas wmod and merged "weather stations"; and setup scripts;  WARNING you should read the scripts and execute the commands one by one the first time to catch the errors and fix them as you customize it for your use case.
When you do "tar xzf weewx_wmod_master.tar.gz" (the extension for my driver) you can get instructions for installing the extension and testing from the readme or look at wg-do-install.sh.
NOTE:  to get the full weewx_merge.conf set of options refer to /etc/weewx/skins/Seasons/skin.conf/ especially the section under "[[day_images]]".
The script wg-arduino-stty.sh sets "raw" option on ttyUSB so you can see the output with "cat /dev/ttyUSB".
The circuit diagram for my weather station is available at https://forums.adafruit.com/viewtopic.php?f=25&t=190231
Thank you to everyone who  helped.  Much JOY :-)
blog_weewx.tar.gz
wg-arduino-stty.sh

William Garber

unread,
Apr 29, 2022, 3:08:38 PM4/29/22
to weewx-user
regarding this discussion https://groups.google.com/g/weewx-user/c/JA7VptqXNI4
(1) if all of your sensors communicate via radio through one rtl-sdr dongle
(2) each instance of weewx uses the weewx-sdr driver using the option "cmd = rtl_433 -d  rtl_tcp"
then the "-d rtl_tcp" option should make all the data from the rtl-sdr dongle available to each instance of weewx
over the network;  i.e. each instance of weewx could read all the sensors on both weather stations;
I think that all I have to do is
(1) define "[[sensor_map]]" in the weewx.conf file for each instance of weewx and for the config file that does the merge report;
(2) rewrite the device section for rtl_433 to accept my sensors

so if all that works the questions are e.g. would that cause conflicts (is this like a "packet collision") with radio signals from different sensors arriving at the receiver dongle at the same time?
would there be a big bottleneck due to all the sensors going through one dongle? 

Gary any comment please?

gjr80

unread,
Apr 29, 2022, 9:06:46 PM4/29/22
to weewx-user
I'm sorry I don't use SDR and only have basic knowledge of it's use/config. You probably want an SDR user to comment.

Gary

William Garber

unread,
Apr 30, 2022, 3:55:47 PM4/30/22
to weewx-user
thanks anyhow. :-)
Reply all
Reply to author
Forward
0 new messages