Giter VIP home page Giter VIP logo

Comments (10)

seayworld avatar seayworld commented on August 23, 2024

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.

messismore avatar messismore commented on August 23, 2024

See here
Does that fix the issue for you?

from hassio-addons.

alanmimms avatar alanmimms commented on August 23, 2024

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.

messismore avatar messismore commented on August 23, 2024

I was experiencing the issue described here. There's references to other issues that might also help to debug it.

from hassio-addons.

alanmimms avatar alanmimms commented on August 23, 2024

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.

messismore avatar messismore commented on August 23, 2024

Have you had better luck with the Nano? Would you recommend it?

from hassio-addons.

alanmimms avatar alanmimms commented on August 23, 2024

So far no time to implement it. I'm buried at work.

from hassio-addons.

robertopiumatti avatar robertopiumatti commented on August 23, 2024

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.

alanmimms avatar alanmimms commented on August 23, 2024

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.

yvesle avatar yvesle commented on August 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.