xmikos / qspectrumanalyzer

Spectrum analyzer for multiple SDR platforms (PyQtGraph based GUI for soapy_power, hackrf_sweep, rtl_power, rx_power and other backends)
GNU General Public License v3.0
1.18k stars 239 forks source link

Issues with rtl_power #80

Closed romanblanco closed 4 years ago

romanblanco commented 4 years ago

I've installed qspectrumanalyzer from AUR, as described in README: https://github.com/xmikos/qspectrumanalyzer#arch-linux

The program does launch and UI appears, but after trying to start capturing the program does not react.

In console, I'm seeing the following output:

rtl_power params:
{'bin_size': 10.0,
 'crop': 0.0,
 'device': '',
 'gain': 37.0,
 'hops': 0,
 'interval': 1.0,
 'ppm': 0,
 'sample_rate': 2560000.0,
 'single_shot': False,
 'start_freq': 87.0,
 'stop_freq': 108.0}

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
rtl_power: invalid option -- 'r'
rtl_power, a simple FFT logger for RTL2832 based DVB-T receivers

Use:    rtl_power -f freq_range [-options] [filename]
    -f lower:upper:bin_size [Hz]
     (bin size is a maximum, smaller more convenient bins
      will be used.  valid range 1Hz - 2.8MHz)
    [-i integration_interval (default: 10 seconds)]
     (buggy if a full sweep takes longer than the interval)
    [-1 enables single-shot mode (default: off)]
    [-e exit_timer (default: off/0)]
    [-d device_index (default: 0)]
    [-g tuner_gain (default: automatic)]
    [-p ppm_error (default: 0)]
    [-T enable bias-T on GPIO PIN 0 (works for rtl-sdr.com v3 dongles)]
    filename (a '-' dumps samples to stdout)
     (omitting the filename also uses stdout)

Experimental options:
    [-w window (default: rectangle)]
     (hamming, blackman, blackman-harris, hann-poisson, bartlett, youssef)
    [-c crop_percent (default: 0%, recommended: 20%-50%)]
     (discards data at the edges, 100% discards everything)
     (has no effect for bins larger than 1MHz)
    [-F fir_size (default: disabled)]
     (enables low-leakage downsample filter,
      fir_size can be 0 or 9.  0 has bad roll off,
      try with '-c 50%')
    [-P enables peak hold (default: off)]
    [-D enable direct sampling (default: off)]
    [-O enable offset tuning (default: off)]

CSV FFT output columns:
    date, time, Hz low, Hz high, Hz step, samples, dbm, dbm, ...

Examples:
    rtl_power -f 88M:108M:125k fm_stations.csv
     (creates 160 bins across the FM band,
      individual stations should be visible)
    rtl_power -f 100M:1G:1M -i 5m -1 survey.csv
     (a five minute low res scan of nearly everything)
    rtl_power -f ... -i 15m -1 log.csv
     (integrate for 15 minutes and exit afterwards)
    rtl_power -f ... -e 1h | gzip > log.csv.gz
     (collect data for one hour and compress it on the fly)

Convert CSV to a waterfall graphic with:
     http://kmkeen.com/tmp/heatmap.py.txt

I've tried to launch an example described from the output, getting the following output

$ rtl_power -f 100M:1G:1M -i 5m -1 survey.csv

Number of frequency hops: 900
Dongle bandwidth: 1000000Hz
Downsampling by: 1x
Cropping by: 0.00%
Total FFT bins: 900
Logged FFT bins: 900
FFT bin size: 698757.75Hz
Buffer size: 16384 bytes (8.19ms)
Reporting every 300 seconds
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
usb_claim_interface error -6
Failed to open rtlsdr device #0.

In issue https://github.com/steve-m/librtlsdr/issues/1#issuecomment-21822475, @steve-m suggests that the error usb_claim_interface error -6 could be fixed by blacklisting dvb_usb_rtl28xxu, which I already have:

$ lsmod | grep 'dvb_usb_rtl28xxu'

$ cat /etc/modprobe.d/rtlsdr.conf

# disable DVB drivers
blacklist rtl2830
blacklist rtl2832
blacklist dvb_usb_rtl28xxu
romanblanco commented 4 years ago
$ pacman -Q | grep 'rtl-sdr'
rtl-sdr 1:0.6.0-1
romanblanco commented 4 years ago

I see the problem now -- I'm not using the correct backend but the one from Arch Linux repository

After compiling the correct library I can run the qspectrumanalyzer without issues.

PATH=./rtl-sdr/build/src:$PATH qspectrumanalyzer

Closing issue.