RPi 3 & RTL-SDR/OP25?

Status
Not open for further replies.

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
These launch gnuplot:
./rx.py --args rtl -f 772.63125e6 -g 65 -o 17 -N LNA:35 -V -D cqpsk -P constellation
./rx.py --args rtl -f 772.63125e6 -g 65 -o 17 -N LNA:35 -V -D cqpsk -P fft

However they really don't look like much
 

Attachments

  • screen.jpg
    screen.jpg
    43.7 KB · Views: 1,040
Last edited:

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
Yeah I had a typo.. updated the pic and text. Now if I could just get some audio out of this thing.

Making process, it's just slow.
 

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
The biggest problem I see with rx.py (gnu plot based) replacing scope.py (used wxwidgets) is there is no traffic tab, enabling you to look for the NAC, etc. (just constellation, fft, symbol and datascope) Or maybe I am missing something. Is there another way?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,316
Location
Talbot Co, MD
A couple thoughts about rx.py
- it's a work in progress and Max is currently integrating some enhancements I worked on. These include improvements to the FFT plot for time based averaging and a tuning line to make it easier to see where the centre is. If you want to try these before they hit the git repo, look in the "virtual op25" thread for my recent posts.

- The traffic tab is superseded by the curses terminal screen and the log file. A tuned nac is displayed at the top of the terminal and tuning errors etc can be found in stderr.2. I always run mine with a dedicated command window running "tail -f stderr.2"

Much as with scope.py, you can start rx.py without the -T parameter and have it report the nac of whatever it tunes to.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,316
Location
Talbot Co, MD
Here's a screenshot of my system up and running. At the time there was no voice session being tracked. When there is, additional info including tgid and slot is displayed at the bottom left of the curses terminal window.

ETA: second screen shot is with a voice session established (captured from a different computer monitoring the same radio system). Note that the stderr.2 logging of voice updates is a custom local addition I've added just for my debugging purposes.
 

Attachments

  • op25 screenshot.jpg
    op25 screenshot.jpg
    39.7 KB · Views: 1,091
  • op25 screenshot 2.jpg
    op25 screenshot 2.jpg
    36.8 KB · Views: 1,063
Last edited:

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
A couple thoughts about rx.py
- it's a work in progress and Max is currently integrating some enhancements I worked on. These include improvements to the FFT plot for time based averaging and a tuning line to make it easier to see where the centre is. If you want to try these before they hit the git repo, look in the "virtual op25" thread for my recent posts.

- The traffic tab is superseded by the curses terminal screen and the log file. A tuned nac is displayed at the top of the terminal and tuning errors etc can be found in stderr.2. I always run mine with a dedicated command window running "tail -f stderr.2"

Much as with scope.py, you can start rx.py without the -T parameter and have it report the nac of whatever it tunes to.

Okay thanks for the explanation. I think I need to pull things down from github again. Last I did that was June 29th. I get a screwed up screen output, from rx.py, where the text basically over rights itself, etc.

Here is an animated gif example of that:
https://gifyu.com/image/brt2

Another guy who who is working on this in parallel with me, has gotten a little further and reports he has some broken audio. Do you have any insight on that?

Code:
pi@raspberrypi:~ $  nc -kluvw 1 127.0.0.1 23456 | aplay -c1 -f S16_LE -r 8000
Listening on [127.0.0.1] (family 0, port 23456)
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Connection closed, listening again.
underrun!!! (at least 3221.663 ms long)
underrun!!! (at least 510.575 ms long)
Connection closed, listening again.
Connection closed, listening again.
 
Last edited:

PiccoIntegra

Member
Premium Subscriber
Joined
Dec 19, 2002
Messages
530
Location
North Texas
Add a -q -1 or -q -2 to your rx.py command line. You're not tuned on center, which is why you see the -1200 errors.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,316
Location
Talbot Co, MD
Okay thanks for the explanation. I think I need to pull things down from github again. Last I did that was June 29th. I get a screwed up screen output, from rx.py, where the text basically over rights itself, etc.

Here is an animated gif example of that:
https://gifyu.com/image/brt2

Another guy who who is working on this in parallel with me, has gotten a little further and reports he has some broken audio. Do you have any insight on that?

Code:
pi@raspberrypi:~ $  nc -kluvw 1 127.0.0.1 23456 | aplay -c1 -f S16_LE -r 8000
Listening on [127.0.0.1] (family 0, port 23456)
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
Connection closed, listening again.
underrun!!! (at least 3221.663 ms long)
underrun!!! (at least 510.575 ms long)
Connection closed, listening again.
Connection closed, listening again.

Audio underruns are to be expected with the nc | aplay method of playing the audio because aplay has no idea when the audio samples are going to arbitrarily stop arriving when the transmission ends. For this very reason I implemented the built-in socket audio player (sockaudio.py) which can detect end of transmissions based on specific sequences of null samples sent over udp. If you want to try it, changed files are in my google drive and instructions are over near the end of the big op25 thread.
 

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
I grabbed the four files and placed them in their respective places, apps and lib directories (per this message https://forums.radioreference.com/2782328-post1153.html)..

Code:
pi@raspberrypi:~/op25/build $ sudo make install
[ 24%] Built target gnuradio-op25
[ 27%] Built target test-op25
[ 29%] Built target _op25_swig_doc_tag
[ 30%] Built target _op25_swig_swig_tag
[ 35%] Built target pygen_op25_gr_op25_swig_c8dae
[ 40%] Built target _op25_swig
[ 42%] Built target pygen_op25_gr_op25_python_59195
[ 42%] Built target pygen_op25_gr_op25_apps_383eb
[ 61%] Built target imbe_vocoder
[ 62%] Building CXX object op25/gr-op25_repeater/lib/CMakeFiles/gnuradio-op25_repeater.dir/p25p1_fdma.cc.o
/home/pi/op25/op25/gr-op25_repeater/lib/p25p1_fdma.cc:243:25: error: no ‘void gr::op25_repeater::p25p1_fdma::reset_timer()’ member function declared in class ‘gr::op25_repeater::p25p1_fdma’
 p25p1_fdma::reset_timer()
                         ^
op25/gr-op25_repeater/lib/CMakeFiles/gnuradio-op25_repeater.dir/build.make:326: recipe for target 'op25/gr-op25_repeater/lib/CMakeFiles/gnuradio-op25_repeater.dir/p25p1_fdma.cc.o' failed
make[2]: *** [op25/gr-op25_repeater/lib/CMakeFiles/gnuradio-op25_repeater.dir/p25p1_fdma.cc.o] Error 1
CMakeFiles/Makefile2:682: recipe for target 'op25/gr-op25_repeater/lib/CMakeFiles/gnuradio-op25_repeater.dir/all' failed
make[1]: *** [op25/gr-op25_repeater/lib/CMakeFiles/gnuradio-op25_repeater.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
pi@raspberrypi:~/op25/build $

/Edit
Nevermind, found the missing file p25p1_fdma.h and it looks like the make install is going to complete now.
 
Last edited:

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
That's okay, I should have read more of the thread.

I'm still not convinced this is working right on the Pi. I start it with:
Code:
./rx.py --args 'rtl' -N LNA:49 -f 772.63125e6 -S 2560000 -q 0 -V -T trunk.tsv 2>stderr.2
tail -F stderr.2
All I ever see is:

I assume I'll see something more when there is voice traffic.
And I think this indicates I have good signal, so what is missing?
 

Attachments

  • Image1.jpg
    Image1.jpg
    24.4 KB · Views: 969
  • constellation.jpg
    constellation.jpg
    53.7 KB · Views: 985

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
I ran dos2unix on the files, which fixed the startup error with sockaudio.py. But the sockaudio.py app now starts and then terminates. There is no sign of it at all doing a ps –aux |more etc.

How does socksaudio work? Does it require any command line options?
 

mrlindstrom

Member
Premium Subscriber
Joined
Sep 15, 2008
Messages
104
Location
Klein, TX
For the life of me I cannot find the README file or the rx.py file in the apps folder. I've checked that I'm on the max branch:

$ git branch
master
* max

and I'm looking in the ~/op25/op25/gr-op25_repeater/apps folder, all I see is scope.py

Any ideas?

(Ubuntu 14.04 64bit)
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,316
Location
Talbot Co, MD
That's okay, I should have read more of the thread.

I'm still not convinced this is working right on the Pi. I start it with:
Code:
./rx.py --args 'rtl' -N LNA:49 -f 772.63125e6 -S 2560000 -q 0 -V -T trunk.tsv 2>stderr.2
tail -F stderr.2
All I ever see is:

I assume I'll see something more when there is voice traffic.
And I think this indicates I have good signal, so what is missing?

I think you're missing some startup options. (Specifically the "-w" and "-2") Here is mine for comparison:
Code:
./rx.py -P fft --args "rtl=0" --gains 'lna:36' -O 'default' -D cqpsk -f 773.84375e6 -S 1440000 -q 0 -T trunk-leo.tsv -q 1 -2 -w 2> stderr.2

I'm also curious to see that your system has only received 3 tsbks and hasn't yet picked up the SYSID, so either the NAC is incorrect, it isn't tuned accurately, or it's a very weak signal.
 
Last edited:

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
I have tried it with -w. -2 appears to be for if the system is Phase 2, which mine is not. It is a simulcast system however.

What I believe is correct:
Code:
./rx.py  --args 'rtl' --gains 'lna:49' -f 772.63125e6 -T trunk.tsv -q 1 -D cqpsk  -S 2560000 -P constellation -w 2> stderr.2

I moved my antenna a bit and now have a tsbks 5.

I have another guy working in parallel with me, Pi platform, his is not simulcast, and he does get broken audio with the netcat method.. And you explained that... He tried the sockaudio.py method, and hasn't heard anything that way yet.

We both see that sockaudio.py app starts and then terminates. There is no sign of it at all doing a ps –aux |more etc.

The NAC reported by unitrunker is 4A1.
 
Last edited:

boatbod

Member
Joined
Mar 3, 2007
Messages
3,316
Location
Talbot Co, MD
You don't manually run sockaudio.py, it is started automatically (behind the scenes in its own thread) by rx.py when wireshark audio decoding mode -w is enabled. If you look in the log you should see a line starting with "audio device: ", which comes from sockaudio.py. If not, it hasn't been enabled or something went wrong.

On a system that is tuned and receiving the control channel properly, tsbks will count up continually. Is anything appearing in stderr.2? Relative to no audio on your friend's system, I'd be interested to see the startup sequence logged in stderr.2. Wouldn't surprise me to see something in there about unable to open pcm device.

You might try reducing the sample window a little. From memory, I think my rtl only goes up to about 2.4mhz, but I usually run at 1.44mhz to reduce CPU impact.
 
Last edited:

KA1RBI

Member
Joined
Aug 15, 2008
Messages
799
Location
Portage Escarpment
kb9mwr, let's see about getting the trunk CC tuned in properly first before worrying about the voice. We know that if the CC isn't coming in well it's unlikely you'll get a good voice decode. Looking at the results, when you see the "tsbks 3" (or 5) it is receiving something, but not very well. What you should see at that point is the "tsbks" number should be increasing at a steady rate. If it goes up very slowly, grudgingly as you seem to be seeing that indicates the tuning and/or reception isn't quite right. The constellation diagram indicates an LSM (CQPSK) system, with pretty marginal marginal signal strength at the receiver.

Both these conditions suggest that the tuning is probably on frequency and not the issue at this point. During my tests with the r-pi I used a sampling rate of 1,000,000 [-S 1000000] so it's just possible your rate is too high causing overruns at rx, if that were the case I'd expect some indication of that in the stderr file.

It seems likely that improving the signal strength at the rx would help. It would also be good to rule out the spike at DC, so if you could add an "offset" to the command line that you're running.

So here are some suggested things to try...
1) add an offset [-o 50000] parameter to the command line
2) using the constellation plot as a guide, re-arrange the antenna until you get a good 4-point constellation. What you want to do is to get rid of the cluster of symbols at the center of the plot so all the symbols move outward into four discrete groups.
3) look in the stderr file for anything untoward.

I'd also like to see what the "datascope" plot looks like. To get this you need to temporarily run the program in "fsk4" demod mode, which is incorrect for your system, but it's what's needed to get the datascope plot...

Max
 
Status
Not open for further replies.
Top