allangood / rtlamr2mqtt

Docker container to send rtlamr readings to a mqtt broker
MIT License
326 stars 51 forks source link

LISTEN_ONLY mode does not work as documented #205

Open JeffFaer opened 1 year ago

JeffFaer commented 1 year ago
$  docker run --rm -ti -e LISTEN_ONLY=yes -e RTL_MSGTYPE="all" --device=/dev/bus/usb:/dev/bus/usb allangood/rtlamr2mqtt
Traceback (most recent call last):
  File "/usr/bin/rtlamr2mqtt.py", line 38, in <module>
    log_message('Starting in LISTEN ONLY Mode...')
NameError: name 'log_message' is not defined

Here's what I found in /usr/bin/rtlamr2mqtt.py: https://gist.github.com/JeffreyFalgout/313e33ee11f543b5b39f242eadb2ca76

which doesn't seem to match what's currently in the repo


Looks like the latest image was last updated 7 months ago. Specifying allangood/rtlamr2mqtt:2.3.3 lets it work

JeffFaer commented 1 year ago

Although even then it fails to exit gracefully:

^C[2023-05-24 23:48:39] Shutdown detected, killing process.
Traceback (most recent call last):
  File "/usr/bin/rtlamr2mqtt.py", line 415, in <module>
    listen_mode()
  File "/usr/bin/rtlamr2mqtt.py", line 392, in listen_mode
    for amrline in rtlamr.stdout:
  File "/usr/local/lib/python3.10/codecs.py", line 319, in decode
    def decode(self, input, final=False):
  File "/usr/bin/rtlamr2mqtt.py", line 152, in shutdown
    if not external_rtl_tcp and rtltcp.returncode is None:
NameError: name 'external_rtl_tcp' is not defined