matthewwall / weewx-sdr

weewx driver for software-defined radio
GNU General Public License v3.0
114 stars 74 forks source link

Add configuration flag, use flag to generate subprocess #103

Closed hschimke closed 3 years ago

hschimke commented 3 years ago

This change allows weewx-sdr to (optionally) run the subprocess in shell mode, which is required for some mqtt command line subscription programs. This change allows weewx-sdr to process json provided by an mqtt connection. It offers a potential solution to the issue (Consume rtl_433 data via MQTT or other #100). The solution could use something like mosquitto_sub to pickup data from a running rtf_433 service. The change requires rtl_433 to provide json data on the mqtt topic.

An example config would add "use_shell = True" to the [SDR] stanza and change the cmd line to read: cmd = "mosquitto_sub -t '' -h -p "

A corresponding provider to the would need to be running. A possible command line to start that could read: rtl_433 -M utc -F "mqtt://,events="

hschimke commented 3 years ago

I missed an edge case on closing the driver. Closing this pull request and will resubmit later. Apologies.