mutability / dump1090

Dump1090 is a simple Mode S decoder for RTLSDR devices
528 stars 137 forks source link

FC0012 tuner #229

Closed Basti77 closed 6 years ago

Basti77 commented 6 years ago

Hello, I may have found a solution for FC0012 tuner. The USB stick must first be initialized to a different frequency <980Mhz, then you can switch to the 1090Mhz. Under windows SDR# it works! Is there a coder that could install this in dump1090-fa?

mutability commented 6 years ago

I don't have fc0012 on hand to test with, but a couple of questions:

Does it actually get data at 1090mhz? It's possible that the second tuning attempt is silently failing

Does this work on more than one unit? I wonder how much variation between chips there is. The limits for a r820t vary from chip to chip

Finally if this is a somewhat reliable thing then it is probably worth trying to get it into librtlsdr itself rather than a hack in dump1090

Basti77 commented 6 years ago

I can reproduce it. Tuners start at 980 and then switch to 1090. I can not say if it works wonders. I did not want to buy another one;)

But the stick had a great gain compared to another stick with E4000 tuner.

mutability commented 6 years ago

I ordered a FC0012 (£6, they have got really cheap!) so I can try this out in a few days

Basti77 commented 6 years ago

Spontaneously made in the office:

The signal is not clean because I took only a piece of wire as an antenna for the screenshot.

At home with a 1090 antenna on the roof it is better.

1090atfc0012

Basti77 commented 6 years ago

Another info. the stick can do a lot more. 2400atfc0012

a further note for this debugging. I tested another software. SDR Console. Since the stick is running without "tricks".

mutability commented 6 years ago

No luck with the FC0012 I have here unfortunately.

a) tuning to 980MHz fails (rtlsdr complains the PLL parameters are out of range) b) tuning to 1090MHz fails (same as case a) c) tuning to 940MHZ doesn't complain

If I tune to 940 then to 1090 then I don't actually hear any Mode S signals.

Sat Mar 31 17:11:14 2018 BST  dump1090-fa  starting up.
rtlsdr: using device #0: Generic RTL2832U OEM (Realtek, RTL2838UHIDIR, SN 00000001)
Found Fitipower FC0012 tuner
rtlsdr: tuner gain set to 19.2 dB
tune to 940MHz..
tune to 1090MHz..
[FC0012] no valid PLL combination found for 1090000000 Hz!

Usually librtlsdr bails out when it can't find a suitable PLL setting and doesn't actually retune the chip, so this is not surprising - the tuner is still tuned to 940MHz in this case.

I tried tweaking librtlsdr so that it ignores the PLL-out-of-range problem and goes ahead and writes the changes to the tuner anyway, but that made no difference.

So I guess you should check that you really are tuned to 1090MHz and not some other frequency. (Check if you can actually demodulate mode S data at 1090MHz). If you can get 1090MHz data from SDR# et al, I can only assume they're initializing the tuner differently to what rtlsdr does and I'd need details of what they are doing differently to do anything more.

mutability commented 6 years ago

nb: I tested the same antenna (it's in a terrible spot) with a generic R820T dongle and that setup can hear Mode S, though not much if I reduce the nominal gain back to 20dB (default is ~50dB). I don't know how the total gain of the FC0012 compares with the total gain of the R820T.

Basti77 commented 6 years ago

I can only interpret from the spectrum. unfortunately there is no longer the streaming plugin for SRD # to download, or I did not find it. The question is, what makes the windows driver different?

Here is the signal with my ADS antenna (no wire) should I record? 1090

mutability commented 6 years ago

Yeah if you can get an IQ capture @ 2.4MSPS then I can look at that

Basti77 commented 6 years ago

https://drive.google.com/file/d/1Gu28SvNvdc26gD0AmOyUDVPTkjfByIB5/view?usp=sharing

mutability commented 6 years ago

The header on that claims to be 2.8MSPS, not 2.4MSPS?

mutability commented 6 years ago

I ran this through dump1090 both as-is and after resampling to 2.4MSPS with no luck, though it's possible that I got the format conversion wrong (it seems OK from eyeballing it at least)

Basti77 commented 6 years ago

https://drive.google.com/file/d/10-Hcp5iOjXXI0p3ZUlLDBApN7dh2kaQw/view?usp=sharing

Excuse me. that was my fault. I just repeated the recording with 2.4Mb.

mutability commented 6 years ago

Unfortunately no luck with that one either, dump1090 can't find anything useful in it.

This is what I'm running, fwiw:

$ sox --show-progress Downloads/SDRSharp_20180404_081023Z_1090000000Hz_IQ.wav  -r 2400000 -e signed-integer -b 16 --channels 2 --endian little test2.raw stats

Input File     : 'Downloads/SDRSharp_20180404_081023Z_1090000000Hz_IQ.wav'
Channels       : 2
Sample Rate    : 2.4e+06
Precision      : 16-bit
Duration       : 00:02:32.66 = 366387200 samples ~ 11449.6 CDDA sectors
File Size      : 1.47G
Bit Rate       : 76.8M
Sample Encoding: 16-bit Signed Integer PCM

In:100%  00:02:32.66 [00:00:00.00] Out:366M  [======|======] Hd:1.6 Clip:0    
             Overall     Left      Right
DC offset  -0.000000  0.000000 -0.000000
Min level  -0.823456 -0.823456 -0.817169
Max level   0.825348  0.825348  0.816711
Pk lev dB      -1.67     -1.67     -1.75
RMS lev dB    -11.72    -11.72    -11.72
RMS Pk dB     -11.56    -11.56    -11.56
RMS Tr dB     -11.81    -11.81    -11.81
Crest factor       -      3.18      3.15
Flat factor     0.00      0.00      0.00
Pk count           2         2         2
Bit-depth      16/16     16/16     16/16
Num samples     366M
Length s     152.661
Scale max   1.000000
Window s       0.050
Done.

$ git/dump1090-fa/dump1090 --ifile test2.raw --iformat SC16 --stats
Wed Apr  4 17:20:00 2018 BST  dump1090-fa  starting up.
Wed Apr  4 17:20:04 2018 BST  Waiting for receive thread termination

Statistics: Wed Apr  4 17:20:00 2018 BST - Wed Apr  4 17:20:04 2018 BST
Local receiver:
  366387200 samples processed
  0 samples dropped
  0 Mode A/C messages received
  3406300 Mode-S message preambles received
    2218096 with bad message format or invalid CRC
    1188204 with unrecognized ICAO address
    0 accepted with correct CRC
  -8.7 dBFS noise power
  0 messages with signal power above -3dBFS
0 total usable messages
0 surface position messages received
0 airborne position messages received
0 global CPR attempts with valid positions
0 global CPR attempts with bad data
  0 global CPR attempts that failed the range check
  0 global CPR attempts that failed the speed check
0 global CPR attempts with insufficient data
0 local CPR attempts with valid positions
  0 aircraft-relative positions
  0 receiver-relative positions
0 local CPR attempts that did not produce useful positions
  0 local CPR attempts that failed the range check
  0 local CPR attempts that failed the speed check
0 CPR messages that look like transponder failures filtered
0 non-ES altitude messages from ES-equipped aircraft ignored
0 unique aircraft tracks
0 aircraft tracks where only one message was seen
CPU load: 144.0%
  4335 ms for demodulation
  1931 ms for reading from USB
  1 ms for network input and background tasks
Wed Apr  4 17:20:04 2018 BST  Normal exit.
Basti77 commented 6 years ago

I just tried to reproduce all with the E4000 stick. So I see no signal even though he displays with Piaware aircraft. very strange.

mutability commented 6 years ago

This seems to be unlikely to work with the current information available; rtlsdr doesn't know how to program the FC0012 for 1090MHz as far as I can see.