Coder Social home page Coder Social logo

Comments (14)

N3rdP1um23 avatar N3rdP1um23 commented on August 26, 2024

Okay, I was able to setup the package individually (outside of Home Assistant) and it seems I'm now able to grab both water and gas usage 🎊

Now that I've done it this way, it seems that the docker container is missing the rtl_tcp "spectrum" server running?

from home-assistant-addons.

pasyn avatar pasyn commented on August 26, 2024

The addon is not able to find the USB device. Assuming you are running HA on a RPI, try performing a power cycle and then check if the RTL-SDR dongle is detected.

from home-assistant-addons.

N3rdP1um23 avatar N3rdP1um23 commented on August 26, 2024

I've set it back up on the HA server (was using my laptop to test rtlamr which worked) and it's detecting the USB properly, though I'm currently running into this timeout issue. I've also power cycled just to be sure as well as per your comment.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting RTLAMR with parameters:
AMR Message Type = all
AMR Device IDs = ...........................
Time Between Readings = 30
Duration =  15
Electric Unit of measurement =  kWh
Gas Unit of measurement =  ft³
Water Unit of measurement =  l
Water measurements provided in tenths =  false
SCM PLUS GAS DIVISOR =  1
Debug is  false
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Tuned to 100000000 Hz.
Allocating 15 zero-copy buffers
10:58:45.369561 decode.go:45: CenterFreq: 912380000
10:58:45.370110 decode.go:46: SampleRate: 2359296
10:58:45.370128 decode.go:47: DataRate: 32768
10:58:45.370142 decode.go:48: ChipLength: 72
10:58:45.370156 decode.go:49: PreambleSymbols: 32
10:58:45.370168 decode.go:50: PreambleLength: 4608
10:58:45.370181 decode.go:51: PacketSymbols: 736
10:58:45.370193 decode.go:52: PacketLength: 105984
10:58:45.370215 decode.go:59: Protocols: scm,scm+,idm,r900
10:58:45.370232 decode.go:60: Preambles: 01010101010101010001011010100011,00000000000000001110010101100100,111110010101001100000,0001011010100011
10:58:45.370256 main.go:124: GainCount: 29
10:58:50.373988 main.go:343: Receiver context cancelled.
10:58:50.374516 main.go:320: read tcp 127.0.0.1:54122->127.0.0.1:1234: i/o timeout
io.ReadFull
main.(*Receiver).Run.func2
	/go/pkg/mod/github.com/bemasher/[email protected]/main.go:181
runtime.goexit
	/usr/lib/go/src/runtime/asm_amd64.s:1571
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
Signal caught, exiting!
Signal caught, exiting!

from home-assistant-addons.

pasyn avatar pasyn commented on August 26, 2024

Turn on both of the debug switches. Post the new logs and your raw yaml for the addon configuration.

from home-assistant-addons.

N3rdP1um23 avatar N3rdP1um23 commented on August 26, 2024

Debug

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting RTLAMR with parameters:
AMR Message Type = all
AMR Device IDs =
Time Between Readings = 30
Duration =  15
Electric Unit of measurement =  kWh
Gas Unit of measurement =  ft³
Water Unit of measurement =  l
Water measurements provided in tenths =  false
SCM PLUS GAS DIVISOR =  1
Debug is  true
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Tuned to 100000000 Hz.
listening...
Allocating 15 zero-copy buffers
11:29:21.288749 decode.go:45: CenterFreq: 912380000
11:29:21.289216 decode.go:46: SampleRate: 2359296
11:29:21.289236 decode.go:47: DataRate: 32768
11:29:21.289249 decode.go:48: ChipLength: 72
11:29:21.289261 decode.go:49: PreambleSymbols: 32
11:29:21.289274 decode.go:50: PreambleLength: 4608
11:29:21.289286 decode.go:51: PacketSymbols: 736
11:29:21.289298 decode.go:52: PacketLength: 105984
11:29:21.289317 decode.go:59: Protocols: scm,scm+,idm,r900
11:29:21.289341 decode.go:60: Preambles: 111110010101001100000,0001011010100011,01010101010101010001011010100011,00000000000000001110010101100100
11:29:21.289363 main.go:124: GainCount: 29
11:29:26.294546 main.go:343: Receiver context cancelled.
11:29:26.295210 main.go:320: read tcp 127.0.0.1:50540->127.0.0.1:1234: i/o timeout
io.ReadFull
main.(*Receiver).Run.func2
	/go/pkg/mod/github.com/bemasher/[email protected]/main.go:181
runtime.goexit
	/usr/lib/go/src/runtime/asm_amd64.s:1571
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
Signal caught, exiting!
Signal caught, exiting!

YAML

debug: true
rtltcpdebug: true
msgType: all
ids: 
duration: 15
pause_time: 30
gas_unit_of_measurement: ft³
electric_unit_of_measurement: kWh
water_unit_of_measurement: l
water_use_tenths: false
scm_plus_gas_divisor: 1

Side note

I'm not sure if it makes a difference, though I'm using a NooElec NESDR Nano 2+. I was reading this jdeath/RTLAMR2MQQT#10 (comment) saying that it's probably better to use another dongle? If so, I could switch it out to something better. Though when I tested it on my laptop, it worked without issue so it may be some config issue I have or something.

from home-assistant-addons.

pasyn avatar pasyn commented on August 26, 2024

I don't think it is a hardware issue since it worked on your laptop. I'm trying to reproduce the issue on my HA server.

from home-assistant-addons.

N3rdP1um23 avatar N3rdP1um23 commented on August 26, 2024

Oh awesome, thanks! Let me know if I can help in anyway 🙂

from home-assistant-addons.

pasyn avatar pasyn commented on August 26, 2024

No luck on my end with reproducing the issue. Can you attempt to run RTLAMR in the terminal addon in the same way you got it working on your laptop? Also, check the output of dmesg | grep usb for any related errors on the kernel level.

from home-assistant-addons.

pasyn avatar pasyn commented on August 26, 2024

Just managed to reproduce the issue after a full reboot

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting RTLAMR with parameters:
AMR Message Type = all
AMR Device IDs = 23876447,1540559732
Time Between Readings = 30
Duration =  120
Electric Unit of measurement =  kWh
Gas Unit of measurement =  ft³
Water Unit of measurement =  gal
Gas Multiplier =  1
Electric Multiplier =  1
Water Multiplier =  0.1
Debug is  true
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Generic RTL2832U OEM
Detached kernel driver
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Tuned to 100000000 Hz.
rtlsdr_read_reg failed with -1
rtlsdr_write_reg failed with -1
rtlsdr_read_reg failed with -1
rtlsdr_write_reg failed with -1
rtlsdr_write_reg failed with -1
rtlsdr_write_reg failed with -1
Allocating 15 zero-copy buffers
Failed to allocate zero-copy buffer for transfer 0
Falling back to buffers in userspace
Failed to submit transfer 0
Please increase your allowed usbfs buffer size with the following command:
echo 0 > /sys/module/usbcore/parameters/usbfs_memory_mb
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
r82xx_write: i2c wr failed=-4 reg=17 len=1
r82xx_set_freq: failed=-4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
r82xx_write: i2c wr failed=-4 reg=0a len=1
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
r82xx_write: i2c wr failed=-4 reg=05 len=1
rtlsdr_demod_write_reg failed with -4
rtlsdr_demod_read_reg failed with -4
01:00:24.648013 decode.go:45: CenterFreq: 912380000
01:00:24.652145 decode.go:46: SampleRate: 2359296
01:00:24.652657 decode.go:47: DataRate: 32768
01:00:24.652837 decode.go:48: ChipLength: 72
01:00:24.653341 decode.go:49: PreambleSymbols: 32
01:00:24.653531 decode.go:50: PreambleLength: 4608
01:00:24.653854 decode.go:51: PacketSymbols: 736
01:00:24.654058 decode.go:52: PacketLength: 105984
01:00:24.654378 decode.go:59: Protocols: scm,scm+,idm,r900
01:00:24.654875 decode.go:60: Preambles: 111110010101001100000,0001011010100011,01010101010101010001011010100011,00000000000000001110010101100100
01:00:24.655340 main.go:124: GainCount: 29
01:00:29.659323 main.go:343: Receiver context cancelled.
01:00:29.659902 main.go:320: read tcp 127.0.0.1:53216->127.0.0.1:1234: i/o timeout
io.ReadFull
main.(*Receiver).Run.func2
	/go/pkg/mod/github.com/bemasher/[email protected]/main.go:181
runtime.goexit
	/usr/lib/go/src/runtime/asm_arm64.s:1270
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
Signal caught, exiting!
Signal caught, exiting!

from home-assistant-addons.

pasyn avatar pasyn commented on August 26, 2024

There seems to not be enough space in the USBFS buffer. The default buffer size is only 16mb. Try adding usbcore.usbfs_memory_mb=1000 to your cmdline options in /boot/cmdline.txt.

from home-assistant-addons.

pasyn avatar pasyn commented on August 26, 2024

@N3rdP1um23, were you able to resolve this issue?

from home-assistant-addons.

N3rdP1um23 avatar N3rdP1um23 commented on August 26, 2024

@pasyn My apologies for the delay. I've just updated the plugin and it didn't initially work out of the gate. The /boot/cmdline.txt you mentioned, would I have to add this in Home Assistant OS? It doesn't currently exist. Just wanted to make sure before messing something else up haha.

I was able to play around with it a little more, and found that the following plugin works without issue https://github.com/allangood/rtlamr2mqtt

from home-assistant-addons.

N3rdP1um23 avatar N3rdP1um23 commented on August 26, 2024

Actually, stopping the rtlamr2mqtt addon and restarting the this one seems to have done the trick! I am able to see an individual sensor now which is awesome!

I do have a few questions however

  • I wasn't able to set a non-whole number for the multiplier as the input only steps by "1", uncommenting that in the field and then saving it worked. (not 100% sure if that's something that you have control over)
  • The entities that it exposes don't have a unique ID so I'm unable to modify the name, icon, etc.. from the GUI. Is this something that's by design or could be added? Would be a little nicer as compared to sensor.ID
  • I have the duration and pause set to the defaults (15 and 30 respectfully), though it doesn't seem to be updating the values of the sensor. Even after a restart and full stop/start of the addon. Any idea if I might have messed up the configuration or something like that?

from home-assistant-addons.

pasyn avatar pasyn commented on August 26, 2024

The /boot/cmdline.txt you mentioned, would I have to add this in Home Assistant OS?

cmdline.txt is found in the boot partition if you are running HA on a raspberry pi. To access this file, you will have to chuck the sdcard into a computer.

I wasn't able to set a non-whole number for the multiplier as the input only steps by "1", uncommenting that in the field and then saving it worked. (not 100% sure if that's something that you have control over)

I'm looking into a fix for this one. As far as I know, it is only an issue on the first run/install. You can override the value to a decimal by editing the YAML.

The entities that it exposes don't have a unique ID so I'm unable to modify the name, icon, etc.. from the GUI. Is this something that's by design or could be added? Would be a little nicer as compared to sensor.ID

I agree but this is a limitation of Addons in homeassistant and the HA core dev team has made it clear that this will not change. See: #10 (comment)
A semi-fix is to add a sensor template to your config.yaml in HA.

I have the duration and pause set to the defaults (15 and 30 respectfully), though it doesn't seem to be updating the values of the sensor. Even after a restart and full stop/start of the addon. Any idea if I might have messed up the configuration or something like that?

Personally, I have the duration set to 120 and the pause left at the default value. Check the logs with the debug switch on. You should see something similar to the following when your meter signal is picked up.

RTLAMR JSON Output
{"Time":"2023-02-05T22:18:11.769490954-05:00","Offset":0,"Length":0,"Type":"SCM","Message":{"ID":23876447,"Type":4,"TamperPhy":0,"TamperEnc":2,"Consumption":45624,"ChecksumVal":21337}}
JSON Output to HA REST API
{"state":"45624","attributes":{"unique_id":"23876447-sdrmr","device_class":"energy","unit_of_measurement":"kWh","state_class":"total_increasing"}}
200

from home-assistant-addons.

Related Issues (19)

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.