Comments (10)
I am having the same issue. Sometimes is runs for days, sometimes just hours. Each time I can clear with a restart. Tried looking for logs, but nothing is there.
from hassio-addons.
See here
Does that fix the issue for you?
from hassio-addons.
That seems like a crude work around. I want a real fix. When I get some time I'll try debugging it.
from hassio-addons.
I was experiencing the issue described here. There's references to other issues that might also help to debug it.
from hassio-addons.
I ordered a heatsinked R820T USB dongle to replace the one I have now in hopes that overheating is the source of the problem. For anyone interested:
NooElec NESDR Nano 3 - Premium Tiny RTL-SDR w/Aluminum Enclosure, 0.5PPM TCXO, SMA & MCX Input & Custom Heatsink. RTL2832U & R820T2-Based Software Defined Radio
by Nooelec
Learn more: https://smile.amazon.com/dp/B073JZ8CC2/ref=cm_sw_em_r_mt_dp_U_t2P6CbW2JDS3G
from hassio-addons.
Have you had better luck with the Nano? Would you recommend it?
from hassio-addons.
So far no time to implement it. I'm buried at work.
from hassio-addons.
i'm solved!
In sh:
MQTT_PATH=$MQTT_TOPIC
/usr/local/bin/rtl_433 -F json -R $PROTOCOL -f $FREQUENCY -g $GAIN -p $OFFSET | /usr/bin/mosquitto_pub -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASS -i RTL_433 -l -t $MQTT_PATH
instead:
/usr/local/bin/rtl_433 -F json -R $PROTOCOL -f $FREQUENCY -g $GAIN -p $OFFSET | while read line
do
DEVICE="$(echo $line | jq --raw-output '.model' | tr -s ' ' '_')" # replace ' ' with '_'
DEVICEID="$(echo $line | jq --raw-output '.id' | tr -s ' ' '_')"
MQTT_PATH=$MQTT_TOPIC
if [ ${#DEVICE} > 0 ]; then
MQTT_PATH=$MQTT_PATH/"$DEVICE"
fi
if [ ${#DEVICEID} > 0 ]; then
MQTT_PATH=$MQTT_PATH/"$DEVICEID"
fi
# Create file with touch /tmp/rtl_433.log if logging is needed
[ -w /tmp/rtl_433.log ] && echo $line >> rtl_433.log
echo $line | /usr/bin/mosquitto_pub -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASS -i RTL_433 -r -l -t $MQTT_PATH
done
As repository https://github.com/merbanan/rtl_433 I used its mqtt function directly.
Now it has been running for a month, now without interruption
from hassio-addons.
In case anyone is interested, my usage pattern is a little different, but I have about the same functionality as @robertopiumatti's solution. Yet I still have the hang after a period of time, requiring reboot of the Raspberry Pi3 to resolve.
This script isn't all that clean and I admit it. But there are some good ideas in it as well.
# Remove hash on next line for debugging
#set -x
export LANG=C
export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
LOG=/tmp/rtl_433.log
touch $LOG
#
# Start the listener and enter an endless loop
#
rtl_433 -F json | while read json
do
# Log to file if file exists.
[ -w $LOG ] && echo $json >> $LOG
T=$( echo $json | \
jq -r '.model + "-" + (.id // 0 | tostring) + "-" + (.channel // 0 | tostring) | gsub("[^a-zA-Z0-9_-]"; "_")' )
# Raw message to MQTT
echo $json | /usr/bin/mosquitto_pub -h 192.168.0.109 -u x -P yyy -i RTL_433 -l -t "homeassistant/rtl433/raw"
echo $json | \
case $T in
Acurite*Sensor* | Nexus_Temperature*)
jq -c '{temperature: (.temperature_C * 9/5 + 32), battery: .battery, time: .time, model: .model}' | \
/usr/bin/mosquitto_pub -h 192.168.0.109 -u xx -P yyy -i RTL_433 -l -t "homeassistant/sensor/"$T
;;
Generic_Remote*)
echo $json | \
jq -r '.cmd' | \
/usr/bin/mosquitto_pub -h 192.168.0.109 -u xx -P yyy -i RTL_433 -l -t "homeassistant/remote/"$T
;;
*)
;;
esac
done
from hassio-addons.
@alanmimms you may want to check out my solution. It turns out rtl_433 can send its output to a mqtt broker natively !
from hassio-addons.
Related Issues (20)
- rtl4332mqtt : Named pipe instead of reconnects? HOT 1
- plugin stops- unable to connect HOT 11
- `frequency` , `gain`, `frequency_offset` not detailed in readme - how to calculate? HOT 9
- Async read stalled, exiting! HOT 28
- Malformed json sent to the mqtt broker ? HOT 2
- Starting up fails HOT 4
- Can not add repo to Supervisor
- USB Claim interface error -6 HOT 1
- Request: Ability to set additional MQTT parameters (RETAIN, QOS, etc)
- unable to get RTL_433 to MQTT Bridge to work with HAssio HOT 1
- Can't get HA to discover mqtt
- New protocols HOT 2
- library librtlsdr.so.0 not dound in /usr/local/bin/rtl_433 RTL-Stick does not get Signals library HOT 3
- Latest Supervisor Update - 2021.02.5 - keeps this add-on from starting HOT 19
- Can't install?
- After Upgrading HA, addon stopped working HOT 4
- usb_open error -1 HOT 3
- s6-overlay-suexec: fatal: can only run as pid 1 HOT 2
- How to - rtl_433 update 23.11
- Wrong project url in ink2mqtt json file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hassio-addons.