Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some R820T RTLSDR need digital AGC set #1749

Closed
Isa001 opened this issue Jul 3, 2021 · 65 comments
Closed

Some R820T RTLSDR need digital AGC set #1749

Isa001 opened this issue Jul 3, 2021 · 65 comments
Labels
enhancement Request to add a feature (other than a decoder) question Not a bug, but a question. (Belongs in discussions or mailinglist)

Comments

@Isa001
Copy link
Contributor

Isa001 commented Jul 3, 2021

Hi,

I'm unable to work with RTL_433 last release (21.05) on my RPi 3 + RTL-SDR R820T
Compilation & Installation are ok.

But unfortunately decoding is not working.

root@romeo:~# rtl_433 -g 43.4 -p 84 -f 433920000 -F kv -a 4 -vvv
rtl_433 version 21.05 (2020-05-09) inputs file rtl_tcp RTL-SDR with TLS
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/root/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 157 out of 186 device decoding protocols [ 1-4 8 11-12 15-17 19-23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 151-161 163-168 170-175 177-186 ]
Found Rafael Micro R820T tuner
Exact sample rate is: 250000.000414 Hz
[R82XX] PLL not locked!
Sample rate set to 250000 S/s.
Tuner gain set to Auto.
Tuned to 433.920MHz.
Allocating 15 zero-copy buffers
baseband_demod_FM: low pass filter for 250000 Hz at cutoff 25000 Hz, 40.0 us

RTL_433 running for many hours but never decodes anything.
Others scripts utilities RF decode work fine with the same setup (RPI + R820T + antenna)
When monitoring +/- 433.92 Mhz, I can see many signals. For sure the reception is ok but no decoding
RPi is not overloaded, I tried to limit to some known protocols with -R without any success.

What's wrong ?? Only RTL_433 doesn't work on my RPI !!

For info, I also have exactly the same problem with Windows 10
I use the same usb RTL-SDR R820 with rtl_433_64bit_static.exe => no decode, nothing decoded after many hours.

My R820T with SdrSharp works fine. I can monitoring the band. Many activities on 433.92 with clear signals

R820T + SdrSharp + RTL_433 plugin work fine. I decode many devices. This setup proves that the reception is ok.

Impossible to run RTL_433 stand alone on my RPi 3 or Windows 10 with my RTL-SDR R820T

Thanks in advance for your help

@merbanan
Copy link
Owner

merbanan commented Jul 3, 2021

Try adjusting the frequency. Most likely some stationary disturbance.

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

Thanks for fast reply.

I already tried many different parameters, frequencies, samplerate, ........ but no success.
Very strange behaviour with RTL_433.
Not even a trace or something in the console in verbose mode.
What's happen during the decoding process ?? no trace, no debug display
Very frustrated because I have only a problem with this script RTL_433.
All others script I use for RF decode work with the same setup (RPi 3 + R820T)

It seems that the script freezes. That's just a supposition.

@zuckschwerdt
Copy link
Collaborator

Try -A to see if/what data comes in, and try -vvv to see if/which decoders get triggered.

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

Running for 10 minutes, but no data decoded, no trace displayed .
Usually datas are sent every +/-30sec

root@romeo:~# rtl_433 -A -vvv -p 84 -f 433925000
rtl_433 version 21.05 (2020-05-09) inputs file rtl_tcp RTL-SDR with TLS
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/root/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registering protocol [1] "Silvercrest Remote Control"
..
Registering protocol [186] "Hyundai TPMS (VDO)"
Registered 157 out of 186 device decoding protocols
Found 1 device(s)

trying device  0:  Realtek, RTL2838UHIDIR, SN: 00000102
Found Rafael Micro R820T tuner
Using device 0: Generic RTL2832U OEM
Exact sample rate is: 250000.000414 Hz
[R82XX] PLL not locked!
Sample rate set to 250000 S/s.
Bit detection level set to 0.0 (Auto).
Tuner gain set to Auto.
Frequency correction set to 84 ppm.
Reading samples in async mode...
Tuned to 433.925MHz.
Allocating 15 zero-copy buffers
baseband_demod_FM: low pass filter for 250000 Hz at cutoff 25000 Hz, 40.0 us

@zuckschwerdt
Copy link
Collaborator

Strange. Since there is a watchdog looking for input stall, there must be I/Q data coming in. It would have to be blank though.
Can you record a short sample with rtl_433 -p 84 -f 433.925M -w test_433.925M_250k.cu8 -T 10 and post as zip here?

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

That's what I got with:
rtl_433 -p 84 -f 433.925M -w test_433.925M_250k.cu8 -T 10

test_433.925M_250k.zip

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

Another one with an other R820T
rtl_433 -p 50 -f 433.920M -w test_433.920M_250k.cu8 -T 10

test_433.920M_250k.zip

@zuckschwerdt
Copy link
Collaborator

Drop the cu8 on https://triq.org/pdv/ to see the spectrum content. The first file is blank, the second has a partial transmission, but too weak to demod. Looks like just bad reception or to low gain (which auto-gain should take care of in hardware though).

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

Thanks for your help and the explanations.

I had done several test with cu8 files and the spectrum app.
Most of files are blank or only 1 or 2 weak signals.

At a glance, the spectrum doesn't represents what I'm able to receive on 433.92.
Now I understand why rtl_433 doesn't decode anything.

When I monitoring this frequency (sdrsharp & R820T on Windows 10), there is a lot of traffic with many strong signals.

I'm sure 433.92 is very active in my area

Could I conclude my RTL-SDR is not tuned to 433.92 by RTL433 ??
Maybe add a tempo before the decode process could help to ensure the right tune for old RTL-SDR key.

@merbanan
Copy link
Owner

merbanan commented Jul 3, 2021

Try with a fixed gain (-g 50 or so). It might be broken hardware.

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

root@romeo:/home# rtl_test
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000102

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.

I had already tried with different fixed gain, without success.

I think my R820T is no tuned to 433.92. Why ?

@merbanan
Copy link
Owner

merbanan commented Jul 3, 2021

Well to confirm that you need a controllable signal. Try with some car keys or a door bell. Those should be possible to observe in the spectrum.

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

Wrong conclusion, my R820T is on the right frequency.
I see the signal of my remote control door bell with cu8 file recorded.

@zuckschwerdt
Copy link
Collaborator

Our eyes are a lot better to make out signals than the demodulator. You need to have some red color (maximum signal strength) in the signal for rtl_433 to pick up anything. Perhaps compare to a few good signals from https://github.com/merbanan/rtl_433_tests/tree/master/tests

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

Files from https://github.com/merbanan/rtl_433_tests/tree/master/tests can be decoded. That's ok.

According to several spectrum captures from rtl_433, signals on 433.92 are very very weak. It's obvious that the decoding is impossible in these conditions.
RTL_433 considers it too weak, but I can tell you these signals are not too weak.

Out of curiosity, I recorded on others frequencies with strong known signals.
On the spectrum capture, these signals are still very weak. Even with the fixed maximum gain (-g 49.6)
I noticed 2 strong carriers. Maybe it can have a side effect.

However, I'm sure some signals are very strong on these frequencies.
I can prove it with sdrsharp and his spectrum.

Others scripts like aisdeco2, adsb and others works very well.

When rtl_433 got the datastream from sdrsharp, decoding is working very well with a maximum signal strength. (sdrsharp + rtl433 plugin)

Maybe there be a problem with AGC enable/disable ??

@merbanan
Copy link
Owner

merbanan commented Jul 3, 2021

Can you try running rtl_433 under windows? I feel this is some kind of hardware issue. Maybe try with a usb extension cord?

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 3, 2021

After some investigations, I'm pretty sure that's a problem with agc and/or gain settings.
It's obvious that the gain is too weak when I use rtl_433
My R820T works fine with others scripts & softwares but get weak signals only with rtl_433

A similar problem I found there https://www.rtl-sdr.com/forum/viewtopic.php?t=6476 and here AlbrechtL/welle.io#211 could reveal the real problem.
Indeed, I also tried with rtl_tcp as source but rtl_433 is not able to set the right settings. No gain then no decode. That's exactly the same situation. Signals very weak or unseen on the spectrum.

Again, SDR# is able to setup the "AGC mode" to 1 (RTL AGC checked) and "GAIN mode" to 1 (Tuner AGC unchecked) via rtl_tcp as source.

I setup my R820T with SDR# via rtl_tcp, then I stop SDR# and launch RTL433 (with rtl_tcp). Bingo that's work I can decode. Some datas are displayed. That's not the best way, I know but just to prove my R820T is able to work with the right settings

Please take a look to the agc & gain settings for the RTL-SDR R820T. Probably, some models are different and not the same setup. Maybe it could help you https://hz.tools/rtl_tcp/

In summary, RTL_433 doesn't initialize correctly my R820T at start and has no RF gain.

If you need more infos for testing, let's me know.

So keep up the great work !!

@merbanan
Copy link
Owner

merbanan commented Jul 3, 2021

Well, we only enable auto gain for the tuner but never touch it for the RTL2832/IF part. My guess is that your mode with IF gain active and tuner gain inactive is not currently available in rtl_433.

@zuckschwerdt
Copy link
Collaborator

If you are using RTLSDR and not using -g, then you can add calls after this line https://github.com/merbanan/rtl_433/blob/master/src/sdr.c#L1189
Add calls to rtlsdr_set_tuner_gain(), rtlsdr_set_tuner_if_gain(), rtlsdr_set_tuner_gain_mode() with varying order and parameters. Documentation is here https://github.com/osmocom/rtl-sdr/blob/master/include/rtl-sdr.h#L202-L253
Let us know what works.

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 4, 2021

Many thanks fer your help, I just put a PR.
With AGC mode enabled, that's much better. Now the RF gain is quite good and can decode some devices around.
The gain value (-g ) is still required.

@zuckschwerdt zuckschwerdt changed the title R820T + RaspBerry Pi 3 not working. Some R820T RTLSDR need digital AGC set Jul 4, 2021
@zuckschwerdt
Copy link
Collaborator

Oh, I see now what you mean, literally the digitial "AGC", not the Tuner automatic gain.

The "AGC" with rtlsdr_set_agc_mode() is a digital gain stage and not too useful. The actual switch between manual gain and automatic gain in the tuner (analog) side is rtlsdr_set_tuner_gain_mode().

Using the digital AGC should be an option switch hidden away with the gain settings :) No many people will want that digitial distortion of the signal ;)

We can already process gain elements for SoapySDR, something like -g AGC=1 should work.

Btw. Your receiver is likely broken, the analog side should not be that "deaf" to need the AGC. Did you observe any change in signal when testing different manual gain values (without digital AGC)? Perhaps the tuner gain isn't even working.

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 4, 2021

The manual tuner gain is working on my R820T, (digital AGC disabled) I can see a big difference on the spectrum with different values of the tuner gain.
But even with the max level (49.6db), that's not enough. RTL433 is not able to decode anything.
When AGC is enabled (rtlsdr_set_agc_mode), RTL433 works like a charm.

As you say, an option switch should be a good idea (-AGC on/off).
-g is still required

I have 2 R820T and I got the same results. (The both maybe deaf, that's not exclude, but I don't think)
AGC must be enabled for my purpose.

@zuckschwerdt
Copy link
Collaborator

To be clear: the digital AGC is roughly the same as "boosting" the signal in rtl_433 would achieve. If you are at full (manual) gain or the automatic gain tops out (same thing basically) then you would need digital AGC.

If the receiver is not suspect of problems, then I'd guess the antenna cable or antenna has a noticeable attenuation? Could it be a loose cable or bad contact?

@merbanan
Copy link
Owner

merbanan commented Jul 4, 2021

Well the RTL2832 can enable an agc signal that is connected back to the tuner.

Page 5, http://superkuh.com/gnuradio/R820T_datasheet-Non_R-20111130_unlocked.pdf

The gains stages in the R820T are not completely exposed in the librtl-sdr api. So my guess is that this toggle meddles with the VGA stage (page 7) of the tuner which maybe can give some more gain for the user by indirectly setting the VGA gain stage.

If you look in the register specs we have the following on page 8:
http://superkuh.com/R820T2_Register_Description.pdf

"VGA GAIN manual / pin selector
1: IF vga gain controlled by vagc pin "

The librtlsdr tuner driver code seems to always enable this mode.

r82xx_init_array [] ...
	0xf5, 0x63, 0x75, 0x68,			/* 0c to 0f */

So enabling the rtl2832 agc control will not do a digital boost of the signal. It is an analog amplification and here we seem to actually have a user that happen to be in the exact signal reception range for this to be needed. While exact control over the VGA gain step would be nice I think we have to settle for the automatic VGA mode.

So the question then @zuckschwerdt is what option flag we want to use for this ?

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 4, 2021

I already have a new PR ready to enable/disable AGC for rtl-sdr or rtl_tcp
I use -B (Boost) as flag.
Please be kindly with my code, I'm not a developer and try to do my best ;)
For sure this code need to be completed.
I can drop it to PR if needed.

@merbanan
Copy link
Owner

merbanan commented Jul 4, 2021

Please send the PR.

@zuckschwerdt
Copy link
Collaborator

It's in #1751

@merbanan
Copy link
Owner

merbanan commented Jul 4, 2021

We don't want to enable this unconditionally.

@zuckschwerdt
Copy link
Collaborator

Please also test the feat-noise branch: https://github.com/merbanan/rtl_433/tree/feat-noise
It's very crude and for now will always print noise stats debug, every 30 seconds for 250k, 7 seconds for 1M.
"Noise1" is instant noise, all other a running averages.

It will also track the very low noise levels you have and adjust the detection level to match.

There is much more to do there, the magic values of at least -12 dB detection level is taken from the default but should be variable. The sensitivity is fixed 3 dB above noise, which seems safe but somewhat close.

Sudden jumps in noise above 3 dB will break the tracking currently.
Being a bit smart we could also detect that as band crowding or interference and print warnings.

Also a nice side-effect could be a "squelch" logic to skip decoding for empty frames and drastically reduce cpu load :)

@zuckschwerdt
Copy link
Collaborator

I've added a "squelch" test for noise-only frames. Load on the Raspi is only 50% compared to before, desktop 20%!

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 6, 2021

The feat-noise branch seems to work very well. And I confirm the rtl_433 process load (10-15%) is lower than before for 250k/s.
Noise1,4,16,64 values are very similar.

Finaly, I don't longer need to enable AGC, don't need to use "-Y minlevel=-36 -Y magest" parameters
The gain -g is still required. Without -g, nothing decoded.

@zuckschwerdt
Copy link
Collaborator

Thanks for the detailed test! Yes, I was testing at 1M, the load decrease is more prominent with higher sample rate.
Wonderful, this whole problem sparked code to automatically increase sensitivity and also lower cpu load!

We'll still merge your AGC code and then change that to some -g option. But at least for me AGC is a just boosting the signal without improving the quality. And we can now deal with quiet signals much better, which is a preferred and a more general solution.

@zuckschwerdt
Copy link
Collaborator

zuckschwerdt commented Jul 6, 2021

This work eerily well with CS16 and very fast AGC too.
I see a normal noise level at

Current level -66.0 dB, estimated noise -66.2 dB

On a signal the AGC quickly adjusts by +20 dB and still everything is fine.

model     : Bresser-3CH  Id        : 171
Channel   : 1            Battery   : 1             Temperature: 26.28 C      Humidity  : 54 %          Integrity : CHECKSUM
Modulation: ASK          Freq      : 433.9 MHz
RSSI      : -30.3 dB     SNR       : 54.0 dB       Noise     : -84.3 dB

We could even remove the CS16 range rescaling, as signals are not expected to go near 0 dB anymore -- it would be just fine to have regular reception at the bottom end of the range, like in this faint (and noisy) signal:

model     : Citroen      type      : TPMS
Pressure  : 236 kPa       Temperature: 28 C
RSSI      : -78.3 dB     SNR       : 6.0 dB        Noise     : -84.3 dB

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 8, 2021

I'm still testing the "feat-noise" branch.
The decoding is better with "-Y minlevel=-36" parameter.
Without this parameter, I miss some packets

@zillawilli
Copy link

Hello.

I have exactly the same problem with this rtl-sdr: https://www.nooelec.com/store/sdr/nesdr-smartee-xtr.html
I dont see any signal with: rtl_433
I see signals but not "all", some packages lost ( i mean so) with: rtl_433 -M level -Y minlevel=-36 -Y magest

Thank you for your great work!

zillawilli

@zuckschwerdt
Copy link
Collaborator

@zillawilli try out the https://github.com/merbanan/rtl_433/tree/feat-noise branch. You should see Current level -x dB, estimated noise -x dB. Do these stay below -36? What range and what amount of changes do you see?

@Isa001 the minlevel in the current version is a fixed threshold, it's also used in the feat-noise but just as starting value and limit. Without minlevel do you see estimated noise -x dB higher (closer to zero) even after settling for about half a minute?

@zuckschwerdt
Copy link
Collaborator

Can you report which exakt librtlsdr version you are using? And I'm wondering if the RTL-SDR is recently bought: is this a new default or just one batch with weak auto gain?

@Mindavi Mindavi added enhancement Request to add a feature (other than a decoder) question Not a bug, but a question. (Belongs in discussions or mailinglist) labels Jul 13, 2021
@zuckschwerdt
Copy link
Collaborator

With #1763 there is now noise level tracking, AGC still needs to be added.

@zillawilli
Copy link

zillawilli commented Jul 16, 2021

Hello zuckschwerdt

First I borrowed an RTLSDR receiver. This was very cheap but worked well.
Then I decided to buy my own receiver. The colleague said the above was very good. I've been trying to get the receiver working for 4 weeks now.
Yesterday I had to set up my old laptop again because I made a mistake.

I mean the new OS Lubuntu 20.04.2 is better than Lubuntu 20.04

Attached the signals i get with: rtl_433 -M level -Y minlevel=-36 -Y magest -g 43.9
Fast and constant!!!

"rtl_433 version 21.05-51-g35c43db8 branch master at 202107161054 inputs file rtl_tcp RTL-SDR"

time : 2021-07-16 11:58:20
model : Abarth 124 Spider type : TPMS
id : d90c32ee
flags : 04 Pressure : 312 kPa Temperature: 38 C
status : 190 Integrity : CHECKSUM
Modulation: FSK Freq1 : 434.0 MHz Freq2 : 433.9 MHz
RSSI : -23.0 dB SNR : 16.2 dB Noise : -39.1 dB


time : 2021-07-16 11:58:21
model : Renault type : TPMS id : dded6b
flags : 36 pressure_kPa: 185.2 kPa temperature_C: 21 C
Integrity : CRC
Modulation: FSK Freq1 : 434.0 MHz Freq2 : 433.9 MHz
RSSI : -23.6 dB SNR : 14.9 dB Noise : -38.4 dB


time : 2021-07-16 11:58:23
model : Renault type : TPMS id : e21f6d
flags : 36 pressure_kPa: 186.8 kPa temperature_C: 20 C
Integrity : CRC
Modulation: FSK Freq1 : 434.0 MHz Freq2 : 433.9 MHz
RSSI : -28.3 dB SNR : 11.3 dB Noise : -39.6 dB


time : 2021-07-16 11:58:24
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 19.6 C
Humidity : 76 % Button : 0 Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -21.4 dB SNR : 18.0 dB Noise : -39.4 dB


time : 2021-07-16 11:58:24
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 19.6 C
Humidity : 76 % Button : 0 Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -21.6 dB SNR : 19.0 dB Noise : -40.6 dB

best regards
willi

@zuckschwerdt
Copy link
Collaborator

Thanks! That's another one of those newer "(analog) auto gain not working" RTL-SDRs then.
We'll add AGC soon, but imho that just makes the signal worse.

With the minimal noise around -40 dB and a 10 to 20 dB SNR we are fine here with low RSSI, really.
Best option with current rtl_433 should be:
rtl_433 -M level -M noise -Y autolevel -Y squelch -Y minlevel=-30 -Y magest -g 43.9

  • The -Y magest will improve precision for signals near the bottom (-42 dB).
  • The -Y autolevel -Y minlevel=-30 will automatically pick the best level in the range of -30 to -39 dB.
  • All of -M level -M noise -Y squelch are optional.

With further testing someday magest and autolevel will become the default.

@zillawilli
Copy link

Hello

This is the answer of your settings: rtl_433 -M level -M noise -Y autolevel -Y squelch -Y minlevel=-30 -Y magest -g 43.9

Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/wilfried/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 161 out of 190 device decoding protocols [ 1-4 8 11-12 15-17 19-23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 151-161 163-168 170-175 177-190 ]
Detached kernel driver
Found Elonics E4000 tuner
Exact sample rate is: 250000.000414 Hz
Sample rate set to 250000 S/s.
Tuner gain set to 42.000000 dB.
Tuned to 433.920MHz.
Allocating 15 zero-copy buffers
Estimated noise level is -34.6 dB, adjusting minimum detection level to -31.6 dB
Estimated noise level is -35.8 dB, adjusting minimum detection level to -32.8 dB
Estimated noise level is -37.0 dB, adjusting minimum detection level to -34.0 dB
baseband_demod_FM: low pass filter for 250000 Hz at cutoff 25000 Hz, 40.0 us


time : 2021-07-17 10:47:36
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -23.6 dB SNR : 15.2 dB Noise : -38.9 dB


time : 2021-07-17 10:47:36
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -24.2 dB SNR : 16.8 dB Noise : -41.0 dB


time : 2021-07-17 10:47:36
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -23.3 dB SNR : 15.9 dB Noise : -39.2 dB


time : 2021-07-17 10:47:36
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -24.0 dB SNR : 17.7 dB Noise : -41.7 dB


time : 2021-07-17 10:47:36
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -23.8 dB SNR : 16.2 dB Noise : -39.9 dB


time : 2021-07-17 10:47:36
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -23.6 dB SNR : 17.7 dB Noise : -41.3 dB


time : 2021-07-17 10:47:36
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -24.0 dB SNR : 14.9 dB Noise : -38.9 dB


time : 2021-07-17 10:47:36
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -23.5 dB SNR : 16.3 dB Noise : -39.8 dB


time : 2021-07-17 10:47:37
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.5 C Humidity : 84 % Button : 0
Integrity : CRC
Modulation: ASK Freq : 433.9 MHz
RSSI : -23.2 dB SNR : 16.5 dB Noise : -39.8 dB
Estimated noise level is -38.1 dB, adjusting minimum detection level to -35.1 dB
Current level -39.4 dB, estimated noise -38.7 dB
Estimated noise level is -39.1 dB, adjusting minimum detection level to -36.1 dB
Current level -39.6 dB, estimated noise -39.5 dB
Current level -39.6 dB, estimated noise -39.6 dB


time : 2021-07-17 10:48:07
model : Auriol-HG02832 id : 7
channel : 1 Battery : 1 Temperature: 18.6 C Humidity : 84 % Button : 0
Integrity : CRC

and so on!!!!!

Now it works very fast and found some more.

Thank you very much!

willi

@zuckschwerdt
Copy link
Collaborator

Oh, "Elonics E4000". You have a E4000 tuner, not an R820T? The original problem was with the R820T.

I'm wondering if this is really a hardware issue at all, or if this is a different version of librtlsdr, not setting the gain values as expected?

@Isa001 @zillawilli can you both please find out the exact version and source (debian package or such) of the librtlsdr used here? (e.g. on Debian apt-cache policy librtlsdr0)

@Isa001
Copy link
Contributor Author

Isa001 commented Jul 17, 2021

I'm using a R820T. It's about 5 - 6 years old with the "librtlsdr" from source https://github.com/librtlsdr/librtlsdr

@zuckschwerdt
Copy link
Collaborator

Ah ok, so not the commonly distributed https://github.com/osmocom/rtl-sdr/ source. We might need to look into the differences there.

@zuckschwerdt
Copy link
Collaborator

Turns out that the librtlsdr project version has different gain controls. https://github.com/librtlsdr/librtlsdr/blob/master/README_improvements.md
Much has been enhanced and improved. That's what we are really seeing here.

We might need to detect the rtlsdr lib flavour while building and change our input options accordingly.

@merbanan
Copy link
Owner

merbanan commented Jul 17, 2021 via email

@zuckschwerdt
Copy link
Collaborator

zuckschwerdt commented Jul 18, 2021

I can confirm that the librtlsdr version has a much slower autogain, resulting in the quiet levels we saw.

What you can do to enable (digital) AGC right now is: export LIBRTLSDR_OPT=dagc=1
Not recommended though ;) Setting the VGA to auto with export LIBRTLSDR_OPT=ifm=0 should behave more like the osmocom rtlsdr. See https://github.com/librtlsdr/librtlsdr/blob/master/src/librtlsdr.c#L2763-L2766
See also https://github.com/librtlsdr/librtlsdr/blob/master/include/rtl-sdr.h#L644-L668

@zillawilli
Copy link

Hello

Excuse my late answer, but i renovate my house and there is a lot of work.

After a system update on 26 Juli 2021 highnoon (12:00)

$ apt-cache policy librtlsdr0
librtlsdr0:
Installiert: 0.6.0-3
Installationskandidat: 0.6.0-3
Versionstabelle:
*** 0.6.0-3 500
500 http://at.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
100 /var/lib/dpkg/status

Hope this is useful for rtl_433.

Thanks and best regards
willi

@zuckschwerdt
Copy link
Collaborator

Thanks. In summary, using -Y autolevel -Y minlevel=-30 -Y magest fixes gain trouble for R820T with librtlsdr driver and also E4000 with default (osmocom) driver.

@rct
Copy link
Contributor

rct commented Aug 25, 2021

In summary, using -Y autolevel -Y minlevel=-30 -Y magest fixes gain trouble for R820T with librtlsdr driver and also E4000 with default (osmocom) driver.

So are there recommendations around which librtlsdr to use at this point?

Based on @merbanan's comment

Yes. They have support for 300kHz tuner filtrering and other stuff that most likely han improve reception of data.

It sounds like librtlsdr from https://github.com/librtlsdr/librtlsdr might have some benefits. But the above mentioned options are necessary and more testing is likely needed. Are those settings dependent on the feat-noise branch?

So, it might be safest to stick to the Osmocom version of librtlsdr for now, which is what is in the Debian repos at least as of Buster. (I haven't checked Bullseye).

Did I follow all that correctly?

@zuckschwerdt
Copy link
Collaborator

feat-noise was merged as #1763

The options are recommended anyway, and will someday be the default I guess. More testing is needed though (also with Y squelch).

The librtlsdr variant has many interesting changes/improvements, but only the gain change is noticeable I'd say.

@merbanan
Copy link
Owner

I think the 300kHz filter will improve reception overall. Maybe something like 10% more messages over a month.

@Sineos
Copy link

Sineos commented Aug 29, 2021

When building https://github.com/librtlsdr/librtlsdr#build for use with rtl_433, which build options are recommended / necessary?

Edit: And how to build rtl_433 against a custom librtlsdr?

@zuckschwerdt
Copy link
Collaborator

I'd say defaults are ok.

We use pkg-config to find the librtlsdr, then fall back to /usr/lib and /usr/local/lib (I guess on Linux that needs to match /etc/ld.so.conf order otherwise wrong headers might be used)
See https://github.com/merbanan/rtl_433/blob/master/cmake/Modules/FindLibRTLSDR.cmake

The effective search order (for headers and libs) should be PKG_CONFIG_PATH, pkg-config built-in (see pkg-config --variable pc_path pkg-config), /usr/lib, /usr/local/lib

For a custom path use e.g.
mkdir build ; cd build ; PKG_CONFIG_PATH=/usr/local/lib/pkgconfig cmake .. && cmake --build .

@zuckschwerdt
Copy link
Collaborator

With #1788 digital AGC is now available as -t digital_agc for rtlsdr and rtl_tcp driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request to add a feature (other than a decoder) question Not a bug, but a question. (Belongs in discussions or mailinglist)
Projects
None yet
Development

No branches or pull requests

7 participants