Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subprocess shell #104

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

hschimke
Copy link

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 '<mqtt_topic>' -h <mqtt_server> -p <mqtt_port>"

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

This pull request corrects an issue with cleanly exiting weewx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant