]> pere.pagekite.me Git - homepage.git/blob - blog/data/2023-04-07-radio-freq-scanning.txt
Generated.
[homepage.git] / blog / data / 2023-04-07-radio-freq-scanning.txt
1 Title: rtlsdr-scanner, software defined radio frequency scanner for Linux - nice free software
2 Tags: english, debian, nice free software
3 Date: 2023-04-07 23:10
4
5 <p>Today I finally found time to track down a useful radio frequency
6 scanner for my software defined radio. Just for fun I tried to locate
7 the radios used in the areas, and a good start would be to scan all
8 the frequencies to see what is in use. I've tried to find a useful
9 program earlier, but ran out of time before I managed to find a useful
10 tool. This time I was more successful, and after a few false leads I
11 found a description of
12 <a href="https://www.kali.org/tools/rtlsdr-scanner/">rtlsdr-scanner
13 over at the Kali site</a>, and was able to track down
14 <a href="https://gitlab.com/kalilinux/packages/rtlsdr-scanner.git">the
15 Kali package git repository</a> to build a deb package for the
16 scanner. Sadly the package is missing from the Debian project itself,
17 at least in Debian Bullseye. Two runtime dependencies,
18 <a href="https://gitlab.com/kalilinux/packages/python-visvis.git">python-visvis</a>
19 and
20 <a href="https://gitlab.com/kalilinux/packages/python-rtlsdr.git">python-rtlsdr</a>
21 had to be built and installed separately. Luckily '<tt>gbp
22 buildpackage</tt>' handled them just fine and no further packages had
23 to be manually built. The end result worked out of the box after
24 installation.</p>
25
26 <p>My initial scans for FM channels worked just fine, so I knew the
27 scanner was functioning. But when I tried to scan every frequency
28 from 100 to 1000 MHz, the program stopped unexpectedly near the
29 completion. After some debugging I discovered USB software radio I
30 used rejected frequencies above 948 MHz, triggering a unreported
31 exception breaking the scan. Changing the scan to end at 957 worked
32 better. I similarly found the lower limit to be around 15, and ended
33 up with the following full scan:</p>
34
35 <p><a href="http://www.hungry.com/~pere/blog/images/2023-04-07-radio-freq-scanning.png"><img src="http://www.hungry.com/~pere/blog/images/2023-04-07-radio-freq-scanning.png" width="100%"></a></p>
36
37 <p>Saving the scan did not work, but exporting it as a CSV file worked
38 just fine. I ended up with around 477k CVS lines with dB level for
39 the given frequency.</p>
40
41 <p>The save failure seem to be a missing UTF-8 encoding issue in the
42 python code. Will see if I can find time to send a patch
43 <a href="https://github.com/CdeMills/RTLSDR-Scanner/">upstream</a>
44 later to fix this exception:</p>
45
46 <pre>
47 Traceback (most recent call last):
48 File "/usr/lib/python3/dist-packages/rtlsdr_scanner/main_window.py", line 485, in __on_save
49 save_plot(fullName, self.scanInfo, self.spectrum, self.locations)
50 File "/usr/lib/python3/dist-packages/rtlsdr_scanner/file.py", line 408, in save_plot
51 handle.write(json.dumps(data, indent=4))
52 TypeError: a bytes-like object is required, not 'str'
53 Traceback (most recent call last):
54 File "/usr/lib/python3/dist-packages/rtlsdr_scanner/main_window.py", line 485, in __on_save
55 save_plot(fullName, self.scanInfo, self.spectrum, self.locations)
56 File "/usr/lib/python3/dist-packages/rtlsdr_scanner/file.py", line 408, in save_plot
57 handle.write(json.dumps(data, indent=4))
58 TypeError: a bytes-like object is required, not 'str'
59 </pre>
60
61 <p>As usual, if you use Bitcoin and want to show your support of my
62 activities, please send Bitcoin donations to my address
63 <b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>