Update CygnusRFI.py to use recent top_level.py #2

Open
opened 2023-01-21 11:10:58 -07:00 by rs-mighty · 3 comments
Collaborator

Gnuradio can read the old pfb.grc fine. It can also export a top_level.py ok. The problem is CygnusRFI.py can only work with the old top_level.py not the new one generated by recent GNUradio.

Update CygnusRFI.py to work with latest gnuradio.

Gnuradio can read the old `pfb.grc` fine. It can also export a `top_level.py` ok. The problem is `CygnusRFI.py` can only work with the old `top_level.py` not the new one generated by recent GNUradio. Update `CygnusRFI.py` to work with latest gnuradio.
Poster
Collaborator

Need to remove

catch_exceptions=True
Need to remove ``` catch_exceptions=True ```
Poster
Collaborator

The new top_block.py export from gnuradio works for the first pass. But for the second pass it fails:

jebba@cruftpi4:~/devel/spacecruft/CygnusRFI $ python CygnusRFI.py -b 2400000 -c 2048 -t 0.5 -d 5 -f 400000000 -F 430000000 

+=================================================================+
| CygnusRFI: An open-source Radio Frequency Interference analyzer |
+=================================================================+

RFI Measurement Parameters:
Frequency range to scan: 400.0-430.0 MHz
Bandwidth per spectrum: 2.4 MHz
Integration time per spectrum: 5 sec
Number of channels per spectrum (FFT Size should be a power of 2): 2048
Integration time per FFT sample: 0.5 sec

Estimated completion time: 62.5 sec

+=================================================================+
| [+]  Starting measurement...                                    |
+=================================================================+


---------------------------------------------------------------------------
  [*] Currently monitoring f_center = 400.0 +/- 1.2 MHz (iteration: 0)...
---------------------------------------------------------------------------

gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.2.0
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp 
[INFO] [UHD] linux; GNU C++ version 10.2.1 20201207; Boost_107400; UHD_3.15.0.0-4+b1
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
[R82XX] PLL not locked!
Allocating 15 zero-copy buffers

---------------------------------------------------------------------------
  [*] Currently monitoring f_center = 402.4 +/- 1.2 MHz (iteration: 1)...
---------------------------------------------------------------------------

gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.2.0
built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp 
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
usb_claim_interface error -6
Traceback (most recent call last):
  File "/home/jebba/devel/spacecruft/CygnusRFI/CygnusRFI.py", line 140, in <module>
    exec(compile(open("top_block.py", "rb").read(), "top_block.py", "exec"))
  File "top_block.py", line 223, in <module>
    main()
  File "top_block.py", line 206, in main
    tb = top_block_cls(c_freq=options.c_freq, nbin=options.nbin, nchan=options.nchan, obs_time=options.obs_time, samp_rate=options.samp_rate)
  File "top_block.py", line 71, in __init__
    self.RTL820T = osmosdr.source(
  File "/usr/lib/python3/dist-packages/osmosdr/osmosdr_swig.py", line 1074, in make
    return _osmosdr_swig.source_make(*args, **kwargs)
RuntimeError: Failed to open rtlsdr device.

The new top_block.py export from gnuradio works for the first pass. But for the second pass it fails: ``` jebba@cruftpi4:~/devel/spacecruft/CygnusRFI $ python CygnusRFI.py -b 2400000 -c 2048 -t 0.5 -d 5 -f 400000000 -F 430000000 +=================================================================+ | CygnusRFI: An open-source Radio Frequency Interference analyzer | +=================================================================+ RFI Measurement Parameters: Frequency range to scan: 400.0-430.0 MHz Bandwidth per spectrum: 2.4 MHz Integration time per spectrum: 5 sec Number of channels per spectrum (FFT Size should be a power of 2): 2048 Integration time per FFT sample: 0.5 sec Estimated completion time: 62.5 sec +=================================================================+ | [+] Starting measurement... | +=================================================================+ --------------------------------------------------------------------------- [*] Currently monitoring f_center = 400.0 +/- 1.2 MHz (iteration: 0)... --------------------------------------------------------------------------- gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.2.0 built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp [INFO] [UHD] linux; GNU C++ version 10.2.1 20201207; Boost_107400; UHD_3.15.0.0-4+b1 Using device #0 Realtek RTL2838UHIDIR SN: 00000001 Found Rafael Micro R820T tuner [R82XX] PLL not locked! [R82XX] PLL not locked! Allocating 15 zero-copy buffers --------------------------------------------------------------------------- [*] Currently monitoring f_center = 402.4 +/- 1.2 MHz (iteration: 1)... --------------------------------------------------------------------------- gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.2.0 built-in source types: file fcd rtl rtl_tcp uhd hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp Using device #0 Realtek RTL2838UHIDIR SN: 00000001 usb_claim_interface error -6 Traceback (most recent call last): File "/home/jebba/devel/spacecruft/CygnusRFI/CygnusRFI.py", line 140, in <module> exec(compile(open("top_block.py", "rb").read(), "top_block.py", "exec")) File "top_block.py", line 223, in <module> main() File "top_block.py", line 206, in main tb = top_block_cls(c_freq=options.c_freq, nbin=options.nbin, nchan=options.nchan, obs_time=options.obs_time, samp_rate=options.samp_rate) File "top_block.py", line 71, in __init__ self.RTL820T = osmosdr.source( File "/usr/lib/python3/dist-packages/osmosdr/osmosdr_swig.py", line 1074, in make return _osmosdr_swig.source_make(*args, **kwargs) RuntimeError: Failed to open rtlsdr device. ```
Poster
Collaborator
usb_claim_interface error -6

It thinks something is using the device. Probably itself. It releases the device, so script can be re-run immediately.

``` usb_claim_interface error -6 ``` It thinks something is using the device. Probably itself. It releases the device, so script can be re-run immediately.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: spacecruft/CygnusRFI#2
There is no content yet.