-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Some R820T RTLSDR need digital AGC set #1749
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
Comments
Try adjusting the frequency. Most likely some stationary disturbance. |
Thanks for fast reply. I already tried many different parameters, frequencies, samplerate, ........ but no success. It seems that the script freezes. That's just a supposition. |
Try |
Running for 10 minutes, but no data decoded, no trace displayed .
|
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. |
That's what I got with: |
Another one with an other R820T |
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). |
Thanks for your help and the explanations. I had done several test with cu8 files and the spectrum app. At a glance, the spectrum doesn't represents what I'm able to receive on 433.92. 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 ?? |
Try with a fixed gain (-g 50 or so). It might be broken hardware. |
I had already tried with different fixed gain, without success. I think my R820T is no tuned to 433.92. Why ? |
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. |
Wrong conclusion, my R820T is on the right frequency. |
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 |
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. Out of curiosity, I recorded on others frequencies with strong known signals. However, I'm sure some signals are very strong on these frequencies. 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 ?? |
Can you try running rtl_433 under windows? I feel this is some kind of hardware issue. Maybe try with a usb extension cord? |
After some investigations, I'm pretty sure that's a problem with agc and/or gain settings. 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. 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 !! |
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. |
If you are using RTLSDR and not using |
Many thanks fer your help, I just put a PR. |
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 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. |
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. As you say, an option switch should be a good idea (-AGC on/off). I have 2 R820T and I got the same results. (The both maybe deaf, that's not exclude, but I don't think) |
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? |
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: "VGA GAIN manual / pin selector The librtlsdr tuner driver code seems to always enable this mode.
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 ? |
I already have a new PR ready to enable/disable AGC for rtl-sdr or rtl_tcp |
Please send the PR. |
It's in #1751 |
We don't want to enable this unconditionally. |
Please also test the feat-noise branch: https://github.com/merbanan/rtl_433/tree/feat-noise 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. Also a nice side-effect could be a "squelch" logic to skip decoding for empty frames and drastically reduce cpu load :) |
I've added a "squelch" test for noise-only frames. Load on the Raspi is only 50% compared to before, desktop 20%! |
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. Finaly, I don't longer need to enable AGC, don't need to use "-Y minlevel=-36 -Y magest" parameters |
Thanks for the detailed test! Yes, I was testing at 1M, the load decrease is more prominent with higher sample rate. 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. |
This work eerily well with CS16 and very fast AGC too.
On a signal the AGC quickly adjusts by +20 dB and still everything is fine.
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:
|
I'm still testing the "feat-noise" branch. |
Hello. I have exactly the same problem with this rtl-sdr: https://www.nooelec.com/store/sdr/nesdr-smartee-xtr.html Thank you for your great work! zillawilli |
@zillawilli try out the https://github.com/merbanan/rtl_433/tree/feat-noise branch. You should see @Isa001 the |
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? |
With #1763 there is now noise level tracking, AGC still needs to be added. |
Hello zuckschwerdt First I borrowed an RTLSDR receiver. This was very cheap but worked well. 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 "rtl_433 version 21.05-51-g35c43db8 branch master at 202107161054 inputs file rtl_tcp RTL-SDR" time : 2021-07-16 11:58:20 time : 2021-07-16 11:58:21 time : 2021-07-16 11:58:23 time : 2021-07-16 11:58:24 time : 2021-07-16 11:58:24 best regards |
Thanks! That's another one of those newer "(analog) auto gain not working" RTL-SDRs then. With the minimal noise around -40 dB and a 10 to 20 dB SNR we are fine here with low RSSI, really.
With further testing someday magest and autolevel will become the default. |
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. time : 2021-07-17 10:47:36 time : 2021-07-17 10:47:36 time : 2021-07-17 10:47:36 time : 2021-07-17 10:47:36 time : 2021-07-17 10:47:36 time : 2021-07-17 10:47:36 time : 2021-07-17 10:47:36 time : 2021-07-17 10:47:36 time : 2021-07-17 10:47:37 time : 2021-07-17 10:48:07 and so on!!!!! Now it works very fast and found some more. Thank you very much! willi |
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 |
I'm using a R820T. It's about 5 - 6 years old with the "librtlsdr" from source https://github.com/librtlsdr/librtlsdr |
Ah ok, so not the commonly distributed https://github.com/osmocom/rtl-sdr/ source. We might need to look into the differences there. |
Turns out that the librtlsdr project version has different gain controls. https://github.com/librtlsdr/librtlsdr/blob/master/README_improvements.md We might need to detect the rtlsdr lib flavour while building and change our input options accordingly. |
Yes. They have support for 300kHz tuner filtrering and other stuff that most likely han improve reception of data.
|
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: |
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 Hope this is useful for rtl_433. Thanks and best regards |
Thanks. In summary, using |
So are there recommendations around which librtlsdr to use at this point? Based on @merbanan's comment
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? |
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 The librtlsdr variant has many interesting changes/improvements, but only the gain change is noticeable I'd say. |
I think the 300kHz filter will improve reception overall. Maybe something like 10% more messages over a month. |
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? |
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) The effective search order (for headers and libs) should be For a custom path use e.g. |
With #1788 digital AGC is now available as |
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.
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
The text was updated successfully, but these errors were encountered: