From c54cd6898d4d8c5d7bc318424b30b2decf0235e8 Mon Sep 17 00:00:00 2001 From: Bogdan Vlaicu Date: Thu, 15 Apr 2021 19:10:52 -0400 Subject: [PATCH] fix: Addon config needs usb=true to access usb devices --- rtlamr/Dockerfile | 2 +- rtlamr/config.json | 7 +++---- rtlamr/run.sh | 9 +++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rtlamr/Dockerfile b/rtlamr/Dockerfile index 23c3318..33b3cfc 100755 --- a/rtlamr/Dockerfile +++ b/rtlamr/Dockerfile @@ -28,7 +28,7 @@ RUN apk add --no-cache --virtual build-deps alpine-sdk cmake git libusb-dev && \ chmod +s /usr/local/bin/rtl_* && \ apk del build-deps && \ rm -r /tmp/src && \ - apk add --no-cache libusb mosquitto-clients jq coreutils=8.31-r0 wget=1.20.3-r0 make musl-dev go git gcc + apk add --no-cache libusb mosquitto-clients jq coreutils=8.32-r2 wget=1.21.1-r1 make musl-dev go git gcc # Configure Go ENV GOROOT /usr/lib/go diff --git a/rtlamr/config.json b/rtlamr/config.json index b25b6f6..14d8881 100755 --- a/rtlamr/config.json +++ b/rtlamr/config.json @@ -1,15 +1,14 @@ { "name": "RTLAMR to MQTT Bridge", - "version": "0.1.15", + "version": "0.1.24", "slug": "rtlamr", "description": "RF to MQTT Bridge based on RTL_SDR/RTL_433 for RTL2832U based DVB-T USB tuners", "url": "https://github.com/bvlaicu/home-assistant-addons/tree/master/rtlamr", "panel_icon": "mdi:chart-areaspline", - "startup": "application", + "startup": "services", "homeassistant": "0.92.0b2", - "boot": "auto", "map": ["share:rw", "ssl"], - "devices": ["/dev/bus/usb:/dev/bus/usb:rwm"], + "usb": "True", "host_network": "False", "arch": [ "aarch64", diff --git a/rtlamr/run.sh b/rtlamr/run.sh index 2443134..ac8c24a 100755 --- a/rtlamr/run.sh +++ b/rtlamr/run.sh @@ -27,6 +27,7 @@ echo "Meter IDs =" $METER_IDS #set -x ## uncomment for MQTT logging... /usr/local/bin/rtl_tcp &>/dev/null & +# /usr/local/bin/rtl_tcp > /var/log/rtl_tcp.log 2>&1 & # Sleep to fill buffer a bit sleep 15 @@ -50,10 +51,10 @@ while true; do /go/bin/rtlamr -format json -msgtype=$MSG_TYPE $ID_FILTER_OPTION | while read line do - VAL="$(echo $line | jq --raw-output '.Message.Consumption' | tr -s ' ' '_')" # replace ' ' with '_' - METERID="$(echo $line | jq --raw-output '.Message.ID' | tr -s ' ' '_')" - MSGTYPE="$(echo $line | jq --raw-output '.Type' | tr -s ' ' '_')" - MSG="$(echo $line | jq --raw-output '.Message' | tr -s ' ' '_')" + VAL="$(echo $line | jq --raw-output '.Message.Consumption')" + METERID="$(echo $line | jq --raw-output '.Message.ID')" + MSGTYPE="$(echo $line | jq --raw-output '.Type')" + MSG="$(echo $line | jq --raw-output '.Message')" MQTT_PATH="rtlamr/$METERID" # Create file with touch /var/log/rtl_433.log if logging is needed