Why not just an open socket?

-tk

On Sat, Oct 22, 2016 at 10:12 AM, mwall <[email protected]> wrote:

> On Saturday, October 22, 2016 at 9:06:10 AM UTC-4, ponolan wrote:
>>
>> I know that Simulator is an available station_type. I would be interested
>> in playing with a station_type of "Mirror" where the weewx host could pick
>> up data from another weewx host, just to use live data without disturbing a
>> working setup.
>>
>> Is this something that would be of interest to others and what would be
>> the best way to go about it?
>>
>
> here are two options:
>
> option 1: pull via http
>
> write a weewx service that is bound to new_loop_packet and
> new_archive_record events.  on each event, update a dict that contains the
> packet/record contents.  run a python http server on a user-selectable
> socket.  any request on the socket gets the packet/record in json format.
>
> clients would make http GET request whenever they want the data.
>
> for the weewx client, create a weewx driver that makes simple http
> requests - it polls for data every x seconds.
>
> option 2: push via mqtt
>
> use the existing mqtt extension to weewx to publish loop or archive data
> to an mqtt broker.  each loop/record is published in json format.
>
> create a weewx mqtt driver that subscribes to a topic on the mqtt broker.
>
> i'm sure there are other options, but these two would be pretty easy to
> implement.  the first will require a bit more code, but it would have no
> dependencies.  the second would be more efficient, but would require
> installing and configuring an mqtt broker.  neither should be more than a
> hundred lines of code.
>
> m
>
> --
> 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.
>

-- 
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