rs1729 / RS

radiosonde decoding
GNU General Public License v3.0
170 stars 56 forks source link

Missing db.txt #54

Closed davidpodeur closed 1 year ago

davidpodeur commented 1 year ago

Dear all, I am just trying to get started but do not exactly where to start.

I started ./scan_multi_rs.pl but it complains about a missing db.txt file.

Could you please state what it is and where I can find it and/or how I can generate it?

Thanks in advance for your feedback !

Here is what I did:

casa@DPR:~/RS/RS/scan$ ./scan_multi_rs.pl 

[scan 403660000:404620000:405580000]

rtl_sdr -g 40.2 -p 45 -f 404620000 -s 1920000

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

Using device 0: Generic RTL2832U OEM
Detached kernel driver
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Sampling at 1920000 S/s.
Tuned to 404620000 Hz.
Tuner gain set to 40.20 dB.
Tuner error set to 45 ppm.
Reading samples in async mode...

User cancel, exiting...
Reattached kernel driver
sh: 1: ./scan_pow: not found
rs-peaks: 0
Traceback (most recent call last):
  File "plot_fft_pow.py", line 8, in <module>
    data = np.genfromtxt( 'db.txt', delimiter=';', names=['1','2','3','4','5','6','7','8', '9'] )
  File "/usr/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 1549, in genfromtxt
    fhd = iter(np.lib._datasource.open(fname, 'rbU'))
  File "/usr/lib/python2.7/dist-packages/numpy/lib/_datasource.py", line 151, in open
    return ds.open(path, mode)
  File "/usr/lib/python2.7/dist-packages/numpy/lib/_datasource.py", line 501, in open
    raise IOError("%s not found." % path)
IOError: db.txt not found.

Thanks in advance for your feedback !

David

rs1729 commented 1 year ago

Sorry, the programs and scripts in rs1729/RS/scan are a messy collection of now outdated tools, no documentation. ;( Only up-to-date tool is dft_detect.c. I have to recollect what I was doing back then, most of it was just to show how it could be done in principle, as shown in some of the older videos here, in particular this.

In scan_multi_rs.pl you would want to set some parameters for rtl_sdr

my $ppm = 0;      # set ppm offset of rtl-sdr
my $gain = 40.2;  # set gain
my $center_freq = 404620e3;

(e.g. the gain would usually be set much lower if used with bias-tee)

Now db.txt is produced by scan_pow, so first you would have to compile

gcc scan_fft_pow.c -lm -o scan_pow

And you would also need dft_detect

gcc dft_detect.c -lm -o dft_detect

and of course the decoders. However the decoders that are listed in the script are outdated. It would be more useful to use the decoders from https://github.com/rs1729/RS/tree/master/demod/mod. (There is also a Makefile.) Only the iMet-4 decoder imet4iq.cis in a different location: https://github.com/rs1729/RS/tree/master/imet (gcc imet4iq.c -lm -o imet4iq) These decoders can decode the IQ data, so csdr and sox are no longer needed.

If I remember correctly, the FIFOs for multiple signals would have to be created first, as implied here. Probably it would be better to automatically create as many FIFOs as there are peaks...

I'll try to modifying and simplify scan_multi_rs.pl a bit, though I have to wait for live signals for testing.

You see, this scan-script is very limited, it stops working if there is no signal in the scan. Also it does not update, add, remove signals over time. Probably it would be better to use a server/client approach with the tools here. That said, there is a more complete scan-decode-toolchain radiosonde_auto_rx, so I've focused on providing the decoders for auto_rx.

rs1729 commented 1 year ago

The test branch has an update (needs more testing).

Compile dft_detect.c, scan_fft_pow.c and the decoders from RS/demod/mod and RS/imet/imet4iq.c (see above). Put everything in the same directory. Create the 3 FIFOs

mkfifo /tmp/sdr.0; mkfifo log.0
mkfifo /tmp/sdr.1; mkfifo log.1
mkfifo /tmp/sdr.2; mkfifo log.2

Set the rtl-sdr parameters in scan_multi_rs.pl, and run ./scan_multi.sh (gnome) or ./scan_multi.sh xfce4 (xfce4). Then it should scan for signals as shown in the video. There is a time limit of 120 seconds for decoding. Scanning/Decoding could be repeated. Or reset $ts = "" in scan_multi_rs.pl:197.

Keep in mind, this is just a very simple scanning/decoding script. Don't expect too much.

EDIT: update2: fix imet4 (test branch RS/scan)

davidpodeur commented 1 year ago

As proposed, I switched to radiosonde_auto_rx. Thanks for the hint!