allangood / rtlamr2mqtt

Docker container to send rtlamr readings to a mqtt broker
MIT License
292 stars 47 forks source link

Not sure what to call this issue #180

Closed amdjml closed 1 year ago

amdjml commented 1 year ago

Hi,

I noticed that the data stops coming into HA, something happens everyday at some time at night or early morning that I cannot pin down. What I usually do, is stop the rtlamr2mqtt process and start it again. I see the following logs which is being repeated. I am running the following:

rtlamr2mqtt version: 2.3.3 Home Assistant 2022.11.3 Supervisor 2022.10.2 Operating System 9.3 Frontend 20221108.0 - latest

[2022-11-16 21:00:11] {"Time":"2022-11-16T21:00:11.846470412-05:00","Offset":0,"Length":0,"Type":"SCM","Message":{"ID":60673927,"Type":4,"TamperPhy":0,"TamperEnc":0,"Consumption":19834,"ChecksumVal":34796}}
[2022-11-16 21:00:11] Meter "60673927" - Consumption 19834. Sending value to MQTT.
[2022-11-16 21:00:11] Sending message to MQTT:
[2022-11-16 21:00:11]  > topic => rtlamr/60673927/attributes
[2022-11-16 21:00:11]  > payload => {"Message Type": "SCM", "ID": 60673927, "Type": 4, "TamperPhy": 0, "TamperEnc": 0, "Consumption": 19834, "ChecksumVal": 34796}
[2022-11-16 21:00:11]  > retain => True
[2022-11-16 21:00:11] Sending message to MQTT:
[2022-11-16 21:00:11]  > topic => rtlamr/60673927/state
[2022-11-16 21:00:11]  > payload => 19834
[2022-11-16 21:00:11]  > retain => True
[2022-11-16 21:00:11] Sleep_for defined, time to sleep!
[2022-11-16 21:00:11] Terminating all subprocess...
[2022-11-16 21:00:11] Kill process called.
[2022-11-16 21:00:11] Killing RTL_TCP...
[2022-11-16 21:00:16] Killed.
[2022-11-16 21:00:16] Killing RTLAMR...
[2022-11-16 21:00:16] Killed in the first attempt.
[2022-11-16 21:00:16] Sleeping for 60 seconds, see you later...
[2022-11-16 21:01:16] Reseting USB device: /dev/bus/usb/009/003
[2022-11-16 21:01:17] Reset sucessful.
[2022-11-16 21:01:17] Sending message to MQTT:
[2022-11-16 21:01:17]  > topic => rtlamr/status
[2022-11-16 21:01:17]  > payload => online
[2022-11-16 21:01:17]  > retain => True
[2022-11-16 21:01:17] Trying to start RTL_TCP: /usr/bin/rtl_tcp -d 0 -s 2048000
[2022-11-16 21:01:17] RTL_TCP started with PID 23817
[2022-11-16 21:01:22] RTL_TCP is ready to receive connections!
[2022-11-16 21:01:22] Trying to start RTLAMR: /usr/bin/rtlamr -msgtype=scm -format=json -filterid=60673927 -unique=false
[2022-11-16 21:01:22] RTLAMR started with PID 23822
[2022-11-16 21:01:22] 21:01:22.844864 decode.go:45: CenterFreq: 912600155
[2022-11-16 21:01:22] 21:01:22.845701 decode.go:46: SampleRate: 2359296
[2022-11-16 21:01:22] 21:01:22.845871 decode.go:47: DataRate: 32768
[2022-11-16 21:01:22] 21:01:22.846092 decode.go:48: ChipLength: 72
[2022-11-16 21:01:22] 21:01:22.846241 decode.go:49: PreambleSymbols: 21
[2022-11-16 21:01:22] 21:01:22.846385 decode.go:50: PreambleLength: 3024
[2022-11-16 21:01:22] 21:01:22.846526 decode.go:51: PacketSymbols: 96
[2022-11-16 21:01:22] 21:01:22.846664 decode.go:52: PacketLength: 13824
[2022-11-16 21:01:22] 21:01:22.846804 decode.go:59: Protocols: scm
[2022-11-16 21:01:22] 21:01:22.846939 decode.go:60: Preambles: 111110010101001100000
[2022-11-16 21:01:22] 21:01:22.847193 main.go:124: GainCount: 29

As you can see the process stopped around 10 PM last night and this happens everyday.

allangood commented 1 year ago

This seems to be the same problem reported on #98 .

Try to use a powered USB hub and check #98 for reference.