On Tuesday, September 21, 2021 at 12:36:02 PM UTC-7 lang....@googlemail.com 
wrote:

> The way the WiKi is written suggests that you can use any name as long as 
> you are consistent with station_type = name and respection section [name].
>
> It doesn't say that you should use the original station name and section 
> name. Maybe the example given gives room for such thinking.
> It should explicitly say that you have to stick with the names (pertaining 
> to the driver) for station_type and section name [] which are used for a 
> single instance !
>

I still question why you would rename things at all.  It's not necessary.

Regardless, you 'can' do this if you fork the driver and edit judiciously. 
  I successfully started two Simulator instances with one renamed to 
'Simulator2' driver type, but I needed to copy the existing simulator.py 
driver to simulator2.py 'and' edit its DRIVER_NAME to match.

root@buster:/home/weewx# ls
LICENSE.txt  README.md Simulator1.conf  Simulator2.conf  archive  bin docs 
 examples skins  util  weewx.conf  weewx.conf.4.5.1

root@buster:/home/weewx# diff Simulator*
48c48
<     station_type = Simulator
---
>     station_type = Simulator2
62c62
< [Simulator]
---
> [Simulator2]
79c79
<     driver = weewx.drivers.simulator
---
>     driver = weewx.drivers.simulator2
572c572
<         database_name = weewx-Simulator1.sdb
---
>         database_name = weewx-Simulator2.sdb

Note - that required me to copy the original driver to another name and 
edit lightly for consistency.

root@buster:/home/weewx/bin/weewx/drivers# ls
__init__.py  __pycache__  acurite.py  cc3000.py  fousb.py  simulator.py 
 simulator2.py te923.py  ultimeter.py vantage.py  wmr100.py  wmr300.py 
 wmr9x8.py  ws1.py  ws23xx.py ws28xx.py

root@buster:/home/weewx/bin/weewx/drivers# diff sim*
18c18
< DRIVER_NAME = 'Simulator'
---
> DRIVER_NAME = 'Simulator2'

For my original scenario (one interceptor, one GW1000) this all works now - 
> after divination between the WiKi lines ...
>
>
A wiki is a 'shared' editing environment.  If you have changes that you 
think will make the wiki better, please write them up and submit them.

I doubt this, because, when I try to run two instances both using the 
> interceptor driver I get a message 
>
ERROR weewx.engine: Import of driver failed: [Errno 98] Address already in 
> use (<class 'OSError'>)
>
> I expect the same to happen with two instance-weewx.conf both having an 
> active GW1000 section (station_type, section name)
>
> Or is there a way around ?
>

Depends on the driver and whether it will share a socket on the host 
computer.  For example, the WeathflowUDP driver defaults to 'not' sharing 
its listening socket with other programs on the same computer, but it can 
be configured to share the socket if you edit the driver stanza in the 
config file.   It's possible gw1000 is similar and that you can run only 
one instance on the host computer (I didn't have time to test this).
 

For me, from what I have observed so far, that means - as already said 
> above - that it's not a real multi instance solution but a multi 
> (different) driver solution, a special case of a general multi instance 
> solution.
>

Disagree.   You can run two of the same, or two different, as long as 
you're consistent in your naming 'and' as long as the driver supports 
multiple instances of things on the same port if it's a network-based 
driver like WeatherFlowUDP and gw1000 are.


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/4f640acb-dbcf-4786-8700-20d975b39c8bn%40googlegroups.com.

Reply via email to