KSDR no refresh rate but 4 * rtl_test is working

Discuss KerberosSDR - 4x Coherent RTL-SDR
Post Reply
zanco
Posts: 10
Joined: Fri Apr 26, 2019 5:31 pm

KSDR no refresh rate but 4 * rtl_test is working

Post by zanco » Fri Apr 26, 2019 5:46 pm

Hi,
My KSDR, powered from 3 Ampere USB C supply and connected by USB 2.0 to my computer.

Running Ubuntu 18.04.2 LTS with I5 @ 2.5 GHz

Followed the quickstart guide for " installing the software on a PC"

All without errors, so looked OK.

rtl_test for d0 and d1 without problems, d2 and / or d3 gave an error telling me I had to increase the usbfs_memory.

Followed these instructions:
https://importgeek.wordpress.com/2017/0 ... in-ubuntu/
first temporarily, to test, after which I could run rtl_test with all 4 devices after which I made it persistent as the instructions say. After reboot the usbfs_memory is reported to be 1000 MB so all ok and I can run the rtl_test with 4 devices without errors.

After starting the kerberos software however, the part from the quickstart " confirm that an update rate is showing" fails, there is no update rate showing....

I searched the forum, did read some topics and found that I could / should remove a little part of the run.sh file to have the output to the terminal instead of /dev/null. So I edited the run.sh and started the software again. As soon as I activate the software I get this error message in my terminal window:

Code: Select all

Starting KerberosSDR
kill: (1884): No such process
Traceback (most recent call last):
  File "/home/pe2bz/kerberossdr/_signalProcessing/hydra_signal_processor.py", line 167, in run
    self.module_receiver.download_iq_samples()
  File "/home/pe2bz/kerberossdr/_receiver/hydra_receiver.py", line 161, in download_iq_samples
    byte_data_np = np.frombuffer(byte_array_read, dtype='uint8', count=read_size)
ValueError: buffer is smaller than requested size

The buffer size in the run.sh is set at 256 (unchanged, default value)

Any hints what to check / change to get this running ?

Thanks for your time,

Ben

rtlsdrblog
Site Admin
Posts: 2873
Joined: Mon Nov 19, 2012 11:54 pm

Re: KSDR no refresh rate but 4 * rtl_test is working

Post by rtlsdrblog » Fri Apr 26, 2019 10:54 pm

Looks either one of the units isn't starting properly, or it's failing when the data transfer starts.

Can you try other USB ports, an confirm if you're using a high quality USB cable? The most common issue seems to be a poor quality microUSB cable which fails when the data starts to transfer.

Also I assume that you ran the setup file? Can you check in the _receiver/C folder and confirm that there are compiled files for gate, sync and rtl_daq there? You can try removing the /dev/null outputs for these files in the run.sh file too to see if they're the culprit.

zanco
Posts: 10
Joined: Fri Apr 26, 2019 5:31 pm

Re: KSDR no refresh rate but 4 * rtl_test is working

Post by zanco » Sat Apr 27, 2019 7:39 am

Hi, thanks for your reply, much appreciated!

You know your theory well :-)

I did run the setup file however I seem to have missed the error message in the output, so indeed there are no compiled receivers in the _recever/C folder.

The output of setup.sh:

Code: Select all

[email protected]:~/kerberossdr$ sh setup_init.sh
Compile C files
gcc -Wall -O3 -march=native rtl_daq.c -lpthread -lrtlsdr -o rtl_daq
rtl_daq.c: In function ‘main’:
rtl_daq.c:321:9: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
     int rc;
         ^~
rtl_daq.c: In function ‘fifo_read_tf’:
rtl_daq.c:109:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
         fread(&signal, sizeof(signal), 1, fd);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:128:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&center_freq_read, sizeof(uint32_t), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:129:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&sample_rate_read, sizeof(uint32_t), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:130:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&gain_read, sizeof(int), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:132:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&gain_read_2, sizeof(int), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:133:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&gain_read_3, sizeof(int), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:134:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&gain_read_4, sizeof(int), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccBkMV01.o: In function `read_thread_entry':
rtl_daq.c:(.text+0x2e1): undefined reference to `rtlsdr_set_dithering'
/tmp/ccBkMV01.o: In function `main':
rtl_daq.c:(.text.startup+0x3fa): undefined reference to `rtlsdr_set_gpio'
rtl_daq.c:(.text.startup+0x41c): undefined reference to `rtlsdr_set_gpio'
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'rtl_daq' failed
make: *** [rtl_daq] Error 1
[ INFO ] Set file executation rights
chmod: cannot access '_receiver/C/rtl_daq': No such file or directory
chmod: cannot access '_receiver/C/sim': No such file or directory
chmod: cannot access '_receiver/C/sync': No such file or directory
chmod: cannot access '_receiver/C/gate': No such file or directory
mkdir: cannot create directory ‘/ram’: File exists
ln: failed to create symbolic link '_webDisplay/pr.jpg': File exists
ln: failed to create symbolic link '_webDisplay/DOA_value.html': File exists
ln: failed to create symbolic link '_webDisplay/spectrum.jpg': File exists
ln: failed to create symbolic link '_webDisplay/sync.jpg': File exists
ln: failed to create symbolic link '_webDisplay/doa.jpg': File exists
ln: failed to create symbolic link '_webDisplay/pr.jpg': File exists
[email protected]:~/kerberossdr$ 
I hope the errors make more sense to you than they do to me ?

Thanks,
Ben

zanco
Posts: 10
Joined: Fri Apr 26, 2019 5:31 pm

Re: KSDR no refresh rate but 4 * rtl_test is working

Post by zanco » Sat Apr 27, 2019 7:53 am

Hi, I noticed the error was also described in this topic:

viewtopic.php?t=4557

So I am following those steps now.

zanco
Posts: 10
Joined: Fri Apr 26, 2019 5:31 pm

Re: KSDR no refresh rate but 4 * rtl_test is working

Post by zanco » Sat Apr 27, 2019 8:43 am

Hi,
After manually removing all librtlsdr files (from SoapySDR, SDRangel, Gnuradio and so on) and removing the rtl-sdr-kerberos directory, then re-doing the rtl-sdr-kerberos driver installation my setup_init.sh finishes with no errors:

for the logging the output here:

Code: Select all

[email protected]:~/kerberossdr$ sh setup_init.sh
Compile C files
gcc -Wall -O3 -march=native rtl_daq.c -lpthread -lrtlsdr -o rtl_daq
rtl_daq.c: In function ‘main’:
rtl_daq.c:321:9: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
     int rc;
         ^~
rtl_daq.c: In function ‘fifo_read_tf’:
rtl_daq.c:109:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
         fread(&signal, sizeof(signal), 1, fd);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:128:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&center_freq_read, sizeof(uint32_t), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:129:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&sample_rate_read, sizeof(uint32_t), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:130:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&gain_read, sizeof(int), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:132:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&gain_read_2, sizeof(int), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:133:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&gain_read_3, sizeof(int), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rtl_daq.c:134:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(&gain_read_4, sizeof(int), 1, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -Wall -O3 -march=native sync.c -lpthread -o sync
sync.c: In function ‘fifo_read_tf’:
sync.c:62:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
         fread(&signal, sizeof(signal), 1, fd);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sync.c:78:13: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
             fread(delays, sizeof(*delays), 4, fd);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -Wall -O3 -march=native gate.c -lpthread -o gate
gate.c: In function ‘fifo_read_tf’:
gate.c:49:9: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
         fread(&trigger_read, sizeof(trigger_read), 1, fd);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -Wall -O3 -march=native sim.c -o sim
[ INFO ] Set file executation rights
[sudo] password for pe2bz: 
mkdir: cannot create directory ‘/ram’: File exists
ln: failed to create symbolic link '_webDisplay/pr.jpg': File exists
ln: failed to create symbolic link '_webDisplay/DOA_value.html': File exists
ln: failed to create symbolic link '_webDisplay/spectrum.jpg': File exists
ln: failed to create symbolic link '_webDisplay/sync.jpg': File exists
ln: failed to create symbolic link '_webDisplay/doa.jpg': File exists
ln: failed to create symbolic link '_webDisplay/pr.jpg': File exists
Now the excecutables have appeared :-)

[email protected]:~/kerberossdr/_receiver/C$ ls
gate Makefile rtl_daq.c sim sync sync.h
gate.c rtl_daq rtl_rec.h sim.c sync.c


4 channels now updating , spectrum display working, update rate 325 mS. Now let' s add some antenna' s :-)

Regards,

Ben

rtlsdrblog
Site Admin
Posts: 2873
Joined: Mon Nov 19, 2012 11:54 pm

Re: KSDR no refresh rate but 4 * rtl_test is working

Post by rtlsdrblog » Sun Apr 28, 2019 3:07 am

Glad to hear it's working now.

For future reference, the actual errors started here:

rtl_daq.c:(.text+0x2e1): undefined reference to `rtlsdr_set_dithering'
/tmp/ccBkMV01.o: In function `main':
rtl_daq.c:(.text.startup+0x3fa): undefined reference to `rtlsdr_set_gpio'
rtl_daq.c:(.text.startup+0x41c): undefined reference to `rtlsdr_set_gpio'

That means that you had old drivers installed, and that the rtl-sdr-kerberos drivers weren't installed properly. If you've installed RTL-SDR drivers via apt-get before, then those will probably take priority. So make sure to uninstall apt-get remove rtl-sdr and librtlsdr-dev first, as you've done. GNURadio/GQRX etc might also install the drivers too, so you'd need to remove whatever they installed.

That's why I recommend starting on a fresh system, or a dedicated Pi3/Tinkerboard as the Kerberos uses slightly modified drivers that might not work with other programs.

zanco
Posts: 10
Joined: Fri Apr 26, 2019 5:31 pm

Re: KSDR no refresh rate but 4 * rtl_test is working

Post by zanco » Sun Apr 28, 2019 10:45 am

Thanks for the clarification !

Given the fact that the PI3 comes "cheap" these days, how would the performance (refresh rate) be compared to an I5 at 2.5 GHz ?

My Ubuntu I5 is running only for SDR experiments so fresh install would have been the next thing to happen ;-)


Kind regards,
Ben

rtlsdrblog
Site Admin
Posts: 2873
Joined: Mon Nov 19, 2012 11:54 pm

Re: KSDR no refresh rate but 4 * rtl_test is working

Post by rtlsdrblog » Sun Apr 28, 2019 11:27 pm

Ultimately the refresh rate is bounded by how fast the RTL-SDR data comes in, and the buffering scheme (which needs to be updated in the future to make it faster), but a fast PC should be able to get up to maybe a ~5 Hz refresh rate on passive radar.

Post Reply