Ah, I see. Thanks for the elaboration, Matthew.

On Wednesday, 24 January 2018 19:49:48 UTC-4, mwall wrote:
>
> ...we need an mqtt.py that contains an uploader, a driver, and a service 
> all in one package, as a single extension. 
>
 

> ...the maxbotix extension does part of this - it is both a driver and a 
> service.  if you have a station already, you load it as a driver to augment 
> that.  if you want to run multiple weewx instances, then you can run it as 
> a driver.
>

You mean "service" in the latter case, I believe? 


> so if someone is keen to make this happen before i get around to it (my 
> plate is beyond full right now), take a look at the weewx-maxbotix 
> extension for a simple example.
>

I had a look at the maxbotix extesion. As a start, to extend my current wxMesh 
driver <https://github.com/morrowwm/weewxMQTT> to also act as a service:

- rename the wxMesh driver to wxMQTTsubscribe, or something more accurate. 
The Mesh idea is incorrect, we want to avoid confusion with anything that 
publishes MQTT.

- create a *service* class similar to the class 
wxMesh(weewx.drivers.AbstractDevice) *driver* class, named something like 
wxMQTTSubscribeService(weewx.engine.StdService):. It needs at  least these 
methods:

   - __init_
   - __handle_new_loop
   
    The loop handler essentially populates a data[] array? It could be very 
similar to the driver's genLoopPackets() method, which populates _packet.  
Or should the service also populate _packet? I looked at some other drivers 
- they use "packet" as a data sink. No underscore. I think I'm missing 
something.
- the service would read config from weewx.conf the same as the driver does?
- create the service installer install.py




-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to