matthewwall / weewx-sdr

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

Subprocess shell #104

Open hschimke opened 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="

This pull request corrects an issue with cleanly exiting weewx.