hi andrew,

it is pretty simple, actually.  make a service that is bound to LOOP 
packets.  on each loop packet, spit the value(s) to file/disk/database.

create a file in user/captureloop.py that has something like this:

import weewx
from weewx.engine import StdService

class CaptureLOOP(StdService):
    def __init__(self, engine, config_dict):
        super(CaptureLOOP, self).__init__(engine, config_dict)
        self.filename = config_dict.get('CaptureLOOP', {}).get('filename', 
'/var/tmp/loop')
        self.bind(weewx.NEW_LOOP_PACKET, self.save_data)

    def save_data(self, event):
        with open(self.filename, "w") as f:
            f.write("%s" % event.packet)

then in weewx.conf add user.captureloop.CaptureLoop to the report_services 
list.

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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to