OK, so I'm maybe taking too many steps at once, but I tried to add some observations types to the DB schema for a non-existent database (starting fresh using mwall's observer driver, plus my mods). On it's own, the driver starts up. I added the code from the 'Add a new type to the archive database' instructions just before __main__ block in the driver.
I updated the wx_binding with: schema = user.devices.schema_with_devices, and tried this: bin/wee_database weewx.devices.conf --reconfigure
File "/home/weewx/bin/weewx/manager.py", line 954, in get_manager_dict_from_config
So, are the schema extensions adding columns of type REAL, or something different? I ask because in the example is this:
schema = user.electricity.schema_with_electricity
where electricity is the module name, but I have no idea where electricity is being made a module name other than in the schema extensions, and if those are just columns, I'm lost, again. I realize this is more a python problem. Oh, there's one more reference to electricity as an event record, but again, that doesn't sound like a module either. I resolved this particular issue by changing to schema = user.observer.schema_with_devices, but the driver fails to load as below.
Backing away a bit and using the stock Observer driver still doesn't load.
These are the only config differences (sorry about the font) relative to the Intercepter config that's working:
router.chaos.home_/home/weewx> sdiff -s -W -w 135 weewx.devices.conf weewx.weather.conf | more
debug = 1 | debug = 0
station_type = Observer | station_type = Interceptor
SKIN_ROOT = skins.devices | SKIN_ROOT = skins.weather
HTML_ROOT = public_html.devices | HTML_ROOT = public_html.weather
# schema = user.observer.schema_with_devices <
SQLITE_ROOT = %(WEEWX_ROOT)s/archive.devices | SQLITE_ROOT = %(WEEWX_ROOT)s/archive.weather
[Observer] | [Interceptor]
driver = user.observer | driver = user.interceptor
port = 6943 | port = 8080
# How often to poll the device, in seconds | #
poll_interval = 150 | # Specify the hardware device to capture. Options include:
> device_type = lacrosse-bridge
Feb 8 11:46:21 router weewx[32575]: engine: Initializing weewx version 3.6.2
Feb 8 11:46:21 router weewx[32575]: engine: Using Python 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) #012[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
Feb 8 11:46:21 router weewx[32575]: engine: Platform Linux-2.6.32-573.7.1.el6.x86_64-x86_64-with-centos-6.7-Final
Feb 8 11:46:21 router weewx[32575]: engine: Using configuration file /home/weewx/weewx.devices.conf
Feb 8 11:46:21 router weewx[32575]: engine: Loading station type Observer (user.observer)
Feb 8 11:46:21 router weewx[32575]: import of driver failed: __init__() got an unexpected keyword argument 'driver' (<type 'exceptions.TypeError'>)
Feb 8 11:46:21 router weewx[32575]: engine: Unable to load driver: __init__() got an unexpected keyword argument 'driver'
Feb 8 11:46:21 router weewx[32575]: **** Exiting...
Trying to create the DB by hand using a copy of the working config, and it also doesn't work. The other instance is still running fine from the same area, so I don't think
I hosed up my weewx install.
router.chaos.home_/home/weewx> !sd
sdiff -s -W -w 135 weewx.devices.conf weewx.weather.conf | more
SKIN_ROOT = skins.devices | SKIN_ROOT = skins.weather
HTML_ROOT = public_html.devices | HTML_ROOT = public_html.weather
SQLITE_ROOT = %(WEEWX_ROOT)s/archive.devices | SQLITE_ROOT = %(WEEWX_ROOT)s/archive.weather
router.chaos.home_/home/weewx> bin/wee_database --config=weewx.devices.conf --create-archive
Using configuration file weewx.devices.conf
Using database binding 'wx_binding', which is bound to database 'archive_sqlite'
Traceback (most recent call last):
File "bin/wee_database", line 453, in <module>
main()
File "bin/wee_database", line 156, in main
createMainDatabase(config_dict, db_binding)
File "bin/wee_database", line 179, in createMainDatabase
with weewx.manager.open_manager_with_config(config_dict, db_binding) as dbmanager:
File "/home/weewx/bin/weewx/manager.py", line 984, in open_manager_with_config
return open_manager(manager_dict, initialize)
File "/home/weewx/bin/weewx/manager.py", line 976, in open_manager
manager_dict['table_name'])
File "/home/weewx/bin/weewx/manager.py", line 102, in open
dbmanager = cls(connection, table_name)
File "/home/weewx/bin/weewx/manager.py", line 1109, in __init__
super(DaySummaryManager, self).__init__(connection, table_name, schema)
File "/home/weewx/bin/weewx/manager.py", line 70, in __init__
self.sqlkeys = self.connection.columnsOf(self.table_name)
File "/home/weewx/bin/weedb/sqlite.py", line 159, in columnsOf
raise weedb.ProgrammingError("No such table %s" % table)
weedb.ProgrammingError: No such table archive
Thx, Chris