fix: Addon config needs usb=true to access usb devices

This commit is contained in:
Bogdan Vlaicu
2021-04-15 19:10:52 -04:00
parent 1ea086676f
commit c54cd6898d
3 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ RUN apk add --no-cache --virtual build-deps alpine-sdk cmake git libusb-dev && \
chmod +s /usr/local/bin/rtl_* && \ chmod +s /usr/local/bin/rtl_* && \
apk del build-deps && \ apk del build-deps && \
rm -r /tmp/src && \ 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 # Configure Go
ENV GOROOT /usr/lib/go ENV GOROOT /usr/lib/go
+3 -4
View File
@@ -1,15 +1,14 @@
{ {
"name": "RTLAMR to MQTT Bridge", "name": "RTLAMR to MQTT Bridge",
"version": "0.1.15", "version": "0.1.24",
"slug": "rtlamr", "slug": "rtlamr",
"description": "RF to MQTT Bridge based on RTL_SDR/RTL_433 for RTL2832U based DVB-T USB tuners", "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", "url": "https://github.com/bvlaicu/home-assistant-addons/tree/master/rtlamr",
"panel_icon": "mdi:chart-areaspline", "panel_icon": "mdi:chart-areaspline",
"startup": "application", "startup": "services",
"homeassistant": "0.92.0b2", "homeassistant": "0.92.0b2",
"boot": "auto",
"map": ["share:rw", "ssl"], "map": ["share:rw", "ssl"],
"devices": ["/dev/bus/usb:/dev/bus/usb:rwm"], "usb": "True",
"host_network": "False", "host_network": "False",
"arch": [ "arch": [
"aarch64", "aarch64",
+5 -4
View File
@@ -27,6 +27,7 @@ echo "Meter IDs =" $METER_IDS
#set -x ## uncomment for MQTT logging... #set -x ## uncomment for MQTT logging...
/usr/local/bin/rtl_tcp &>/dev/null & /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 to fill buffer a bit
sleep 15 sleep 15
@@ -50,10 +51,10 @@ while true; do
/go/bin/rtlamr -format json -msgtype=$MSG_TYPE $ID_FILTER_OPTION | while read line /go/bin/rtlamr -format json -msgtype=$MSG_TYPE $ID_FILTER_OPTION | while read line
do do
VAL="$(echo $line | jq --raw-output '.Message.Consumption' | tr -s ' ' '_')" # replace ' ' with '_' VAL="$(echo $line | jq --raw-output '.Message.Consumption')"
METERID="$(echo $line | jq --raw-output '.Message.ID' | tr -s ' ' '_')" METERID="$(echo $line | jq --raw-output '.Message.ID')"
MSGTYPE="$(echo $line | jq --raw-output '.Type' | tr -s ' ' '_')" MSGTYPE="$(echo $line | jq --raw-output '.Type')"
MSG="$(echo $line | jq --raw-output '.Message' | tr -s ' ' '_')" MSG="$(echo $line | jq --raw-output '.Message')"
MQTT_PATH="rtlamr/$METERID" MQTT_PATH="rtlamr/$METERID"
# Create file with touch /var/log/rtl_433.log if logging is needed # Create file with touch /var/log/rtl_433.log if logging is needed