weewx 2 different drivers

595 views
Skip to first unread message

martin swanepoel

unread,
Nov 7, 2016, 7:28:24 AM11/7/16
to weewx-user
Running 2 instances of weewx. 1 is the sdr driver but this station don't have a pressure sensor. 2 Hook up a bmp085 onto the raspberry for the second instance to get barometric data and inside temperature.

Question now how do I integrate the 2 together on one www server. What happens now is they overwrite the same pages. So sometimes I see the barometric graphs and the next time the graphs from the sdr equipment. Any suggestions ?

Thanks,
Martin

mwall

unread,
Nov 7, 2016, 9:56:09 AM11/7/16
to weewx-user


On Monday, November 7, 2016 at 7:28:24 AM UTC-5, martin swanepoel wrote:
Running 2 instances of weewx. 1 is the sdr driver but this station don't have a pressure sensor. 2 Hook up a bmp085 onto the raspberry for the second instance to get barometric data and inside temperature.

Question now how do I integrate the 2 together on one www server. What happens now is they overwrite the same pages. So sometimes I see the barometric graphs and the next time the graphs from the sdr equipment. Any suggestions ?

hi martin,

here are three different approaches:

option 1: make data collection from bmp085 a service instead of a driver.  run a single instance of weewx with the sdr driver.  collect data from the bmp085 using a service that augments the loop and/or archive data.  display data in reports as usual.

option 2: run two instances of weewx to collect data, but one instance knows about the other for reporting.  ensure that each instance is writing to its own database.  one instance of weewx will not generate any reports (remove the StdReport service from this instance).  the other instance uses the data_binding parameter in its reports to include data from the other instance (see the customization guide for details).

option 3: run two instances of weewx to collect data, plus a third instance to do the reporting.  each data collection instance has its own database and HTML_ROOT.  the reporting instance has yet another HTML_ROOT and uses data_binding to get data from the two collector databases.

although two weewx instances *can* share a single database, it is usually not a good idea to do so.  same goes for HTML_ROOT.

there are many other possible permutations, but that should get you started.

m

martin swanepoel

unread,
Nov 8, 2016, 8:22:58 AM11/8/16
to weewx...@googlegroups.com
Hi,

I went for option 2. I can see in the database that both databases is updated with values but on the web-reports barometer and inside temperature value still display as N/A. Only one instance have StdReport service running and bonded to both databases.

Any suggestions where I can run a debug ?

Thanks,
Martin

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/zL6dnD7el6k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Milner

unread,
Nov 8, 2016, 8:38:12 AM11/8/16
to weewx-user
How exactly have you done the binding to the two databases in  weewx.conf, skin.conf and the templates?
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

martin swanepoel

unread,
Nov 8, 2016, 8:44:49 AM11/8/16
to weewx...@googlegroups.com
Hi Andrew,

Here is the database part:

[DataBindings]

    [[wx_binding]]
        # The database must match one of the sections in [Databases].
        # This is likely to be the only option you would want to change.
        # database = archive_sqlite
        database = archive_mysql
        # The name of the table within the database
        table_name = archive
        # The manager handles aggregation of data for historical summaries
        manager = weewx.wxmanager.WXDaySummaryManager
        # The schema defines the structure of the database.
        # It is *only* used when the database is created.
        schema = schemas.wview.schema
    [[forecast_binding]]
        database = forecast_sqlite

    [[bmp_binding]]
        database = bmp_mysql
        table_name = archive
        manager = weewx.wxmanager.WXDaySummaryManager
        schema = schemas.wview.schema
    [[bmp_fore_binding]]
        database = bmp_fore_mysql

##############################################################################

#   This section defines various databases.

[Databases]

    # A SQLite database is simply a single file
    [[archive_sqlite]]
        database_type = SQLite
        database_name = weewx.sdb

    # MySQL
    [[archive_mysql]]
        database_type = MySQL
        database_name = weewx
    [[forecast_sqlite]]
        database_name = forecast.sdb
        database_type = SQLite

        [[ bmp_mysql]]
        database_type = MySQL
        database_name = weewxbmp
    [[bmp_fore_mysql]]
        database_name = forecastbmp
        database_type = MySQL

##############################################################################

This is the only one configured with the reporting service.

From your reply I assume I have to make changes to (skin.conf and the templates) ?????

Thanks,
Martin


--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/zL6dnD7el6k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

Andrew Milner

unread,
Nov 8, 2016, 9:32:04 AM11/8/16
to weewx-user
well you have to use the bindings somehow!!!!!! weewx is not psychic!!!!
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

martin swanepoel

unread,
Nov 8, 2016, 11:53:06 AM11/8/16
to weewx-user
Neither am I
;-)




Tuesday, 8 November 2016, 16:32 +0200 from Andrew Milner <andrew.s...@gmail.com>:

Andrew Milner

unread,
Nov 8, 2016, 1:02:07 PM11/8/16
to weewx-user, marthinus...@gmail.com
If the data from two databases is included in one report then by default the default database will be used and when data from an alternate database is to be the source then it will need to explicitly stated.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

mwall

unread,
Nov 9, 2016, 1:20:46 PM11/9/16
to weewx-user, marthinus...@gmail.com
On Tuesday, November 8, 2016 at 11:53:06 AM UTC-5, martin swanepoel wrote:
Neither am I
;-)


martin,

do something like this in skin.conf:

[ImageGenerator]
    ...
    [[day_images]]
        [[[daywind]]]
            [[[[windSpeed]]]]
            [[[[windGust]]]]
        [[[daypressure]]]
            data_binding = bmp_binding
            [[[[pressure]]]]


and do something like this in your templates:

wind speed: $current.windSpeed
pressure: $current(data_binding=bmp_binding).pressure

the "using multiple bindings" section of the customization guide has details.

http://weewx.com/docs/customizing.htm#Using_multiple_bindings

m

mwall

unread,
Nov 10, 2016, 8:01:24 AM11/10/16
to weewx-user
On Thursday, November 10, 2016 at 09:33:24 AM UTC-5, martin swanepoel wrote:
Hi,

Where is the routine located that updates WU ? I assume I'll have to point that to the second database for Barometer and inside temperature as well.

Thanks,
Martin

martin,

the uploaders have no provision for multiple bindings.

you could make two different weewx instances upload to the same wu account, but that might result in conflicts or gaps in data.  you'd have to try it to see how wu deals with mostly-empty packets and multiple uploads for a single timestamp.

in this case, it would be safer to use option 1, bmp-as-service, for data collection.

m
Reply all
Reply to author
Forward
0 new messages