Hello,

On Tue, Apr 21, 2020 at 8:53 AM jf42 <jfbalti...@gmail.com> wrote:

> My station is a german "MWS 55V", which is read out by a Python program,
> writing the data to a tcp port. Another computer
> collects the data, does a quality check, many other stuff, and writes a
> file. Weewx uses the file parser to get the data.
> The station provides the data every 2 secs, the file resolution is about 5
> secs. We use the data for a lidar instrument
> (light radar) for weather monitoring during atmospheric measurements.
> Thus: the faster the better ;-)
> That's for the background of my question.
>

So it sounds like you are using the WeeWX report generation or archive
records creation to send data to the lidar?

Normally, the archive interval is configured to match reporting
requirements that will work for a day/week/month/year which is why the
default is 300 seconds/5 minutes. Also as some weather stations send data
less frequently, this gives time to collect most if not all the data of
each type. The archive interval is a different requirement than how fast a
WeeWX driver receives data.

Since you are trying to get data to the lidar as fast as possible, have you
considered using MQTT to transfer data? The message based publish-subscribe
model may be more suitable for event based data transfer than polling for
files. For instance:

   - The program that writes the data file after quality control could
   instead publish it to an MQTT topic
   <https://github.com/bellrichm/WeeWX-MQTTSubscribe/blob/master/pubmqtt.py>
   .
   - WeeWX would be configured to use the MQTT Subscribe Driver
   <https://github.com/bellrichm/WeeWX-MQTTSubscribe> and receive these
   messages as loop packets. At the appropriate time, WeeWX would write the
   archive record and generate the reports.
   - You would implement another (Python) program that subscribes to the
   same MQTT topic
   <https://github.com/bellrichm/WeeWX-MQTTSubscribe/blob/master/mqtt_test.py>
   and sends that information to the lidar as fast as data is received.

With this approach, the lidar would receive the data almost immediately
after the QC machine publishes it without going through the WeeWX archival
and report generation process. This way, the archive interval could be
configured at the right amount to meet your reporting requirements would
likely be much less frequent then how often data is received. However, if
your requirement is that all data sent to the lidar must be logged, then
you either have to log it elsewhere or use a short archive interval.
However, the MQTT driver can be configured to publish archive data which
should make it available more quickly than other methods that provide the
archive data.
The page, How to setup your own MQTT Broker
<https://obrienlabs.net/how-to-setup-your-own-mqtt-broker/>
<https://obrienlabs.net/how-to-setup-your-own-mqtt-broker/> is a nice
overview on setting up MQTT to work with WeeWX even if you don't use the
Belchertown skin. However, the MQTT extension for WeeWX mentioned in that
post is used to *publish* loop packets after WeeWX receives them, it cannot
act as a driver to *subscribe* to an MQTT topic for receiving data.

Hope this helps,
-Bill

-- 
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/CAKKfUm9PjshLTTbB_BCwo2m0Vm5cHfkgxLHwPUf1StcbG8ch1w%40mail.gmail.com.

Reply via email to