OP25 Unable to run rx.py

Status
Not open for further replies.

KC8VKB

Member
Joined
Jul 9, 2022
Messages
5
Location
Lansing, Michigan
New to OP25 but attempting to setup on a raspberry pi 4b. Fresh install of current Ubuntu LTS today. Followed the tutorial at

OP25 For Dummies - Or how to build a police scanner for $30 (Part 1) - John's Tech Blog

I am using an rtl-sdr v3. I have it working in gcrx. When attempting to run rx.py for the first time I am getting the following. Can anyone help? Please and thanks.

kc8vkb@kc8vkb-desktop:~/op25/op25/gr-op25_repeater/apps$ ./rx.py --args rtl -N LNA:47 -S 2500000 -x 2 -f 851.72500e6 -o 17e3 -x 2
Using Python /usr/bin/python3
gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.10.1.1
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
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
gain: name: LNA range: start 0 stop 49 step 0
setting gain LNA to 47
supported sample rates 250000-2560000 step 24000
Exact sample rate is: 2500000.107620 Hz
[R82XX] PLL not locked!
Using two-stage decimator for speed=2500000, decim=25/4 if1=100000 if2=25000
p25_frame_assembler_impl: do_imbe[0], do_output[0], do_audio_output[0], do_phase2_tdma[0], do_nocrypt[0]
Segmentation fault (core dumped)
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,013
Location
NE Wisconsin
You've provided very little tangible information to go on. Let's start with exactly what Linux image did you flash to the Raspberry Pi and then
what repo of op25? IE: Boatbod or Osmocom? Is there a good reason that you didn't flash your Pi with one of the Raspbian OS images?

The logfile fragment indicates that the OS apt repository has installed GNU Radio 3.10.x that requires specific installation parameters that
depends upon the exact OP25 version that was cloned (installed). Your rx.py command line is incomplete and has the -x 2 parameter was
repeated twice.
 

KC8VKB

Member
Joined
Jul 9, 2022
Messages
5
Location
Lansing, Michigan
Ok. The OS is Ubuntu 22.04.2. I used Ubuntu as I’m fairly familiar with it and it just so happens all the videos and instructions I found were people who happened to be using Ubuntu as well. OP25 is boatbod. I didn’t realize the -x was repeated. What is incomplete in the command?
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,013
Location
NE Wisconsin
Ok. The OS is Ubuntu 22.04.2. I used Ubuntu as I’m fairly familiar with it and it just so happens all the videos and instructions I found were people who happened to be using Ubuntu as well. OP25 is boatbod. I didn’t realize the -x was repeated. What is incomplete in the command?

A Raspberry Pi-4B running Ubuntu 22.04.2 requires a minimum of 4 GB of RAM. If your Pi-4B meets this requirement then you can
proceed to use it, otherwise I highly recommend flashing it with Raspbian OS Lite, especially if your end goal is to use it(Pi) to
serve as as a P25 receiver/scanner. Keep in mind that Desktop Environments (GUI) needlessly consume CPU and memory resources.

Regarding your Boatbod op25 installation, did you perform a git checkout gr310 after cloning the repo but before executing the
installer script? This is a most import aspect in that you must know the GR version to be installed for a given Linux OS and that
you choose the correct branch for installation. The GitHub default Boatbod branch is the Master branch that supports GNU Radio
version 3.7 and 3.8 installations only.

Your rx.py command line has no reference to trunk.tsv that is required to specify such parameters as the primary and alternate
control channel frequencies, the site NAC, and a few other attributes germane to scanning a P25 TRS. You need to tell rx.py where
to direct decoded audio. IE: -U specifies the systems default sound device.

The specified sample rate of -S 2500000 is at the maximum capacity of most RTL SDR's. OP25 tunes the SDR between the control channel
and voice channel frequencies and back again on a per call basis and doesn’t require a high bandwidth (sample rate). A good value
to use with rx.py would be to set -S 1000000 and then to simply drop the arbitrary offset -o 17e3. I don't know where these so-called
tutorials come up with this stuff?

Offsets can be useful for augmenting frequency corrections after applying the best possible PPM correction values, but they were actually
intended to be used to offset the IF spectrum such as to move a spike that occurs with virtually all RTL devices away from the center such
that it doesn't degrade the performance of the demodulator.

The example bolded below represents a typical rx.py command line that you'd submit form the local terminal to receive a P25 Phase-1
TRS that assumes a properly crafted trunk.tsv file exists with audio output directed to the default system audio device.

./rx.py --args 'rtl=0' --gains 'lna:40' -T trunk.tsv -q 0 -S 1000000 -D cqpsk -U -V -v 5 2>stderr.2
 

KC8VKB

Member
Joined
Jul 9, 2022
Messages
5
Location
Lansing, Michigan
I appreciate the help and advice. I did run git checkout gr310 before running the install script. I do have 4gb of ram. I was thinking of just disabling the gui in Ubuntu and only running the back end. If that doesn’t give me the required performance then I’ll just switch over to rasbian light as you suggested. Tonight or tomorrow I’ll go through and run the correct commands and see what happens. Thanks a bunch.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,013
Location
NE Wisconsin
The example bolded below represents a typical rx.py command line that you'd submit form the local terminal to receive a P25 Phase-1
TRS that assumes a properly crafted trunk.tsv file exists with audio output directed to the default system audio device.

./rx.py --args 'rtl=0' --gains 'lna:40' -T trunk.tsv -q 0 -S 1000000 -D cqpsk -U -V -v 5 2>stderr.2

Update:

The parameter -D cqpsk isn't actually required as this is the default demodulator. I have just gotten into the habit of including it for
my own clarity. Technically, Phase-1 systems use C4FM unless they also employ simulcast (LSM) whereby CQPSK is specifically
required. But no harm and using it, and by doing so, op25 will allow use of the constellation plot for C4FM transmissions.
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,013
Location
NE Wisconsin
I appreciate the help and advice. I did run git checkout gr310 before running the install script. I do have 4gb of ram. I was thinking of just disabling the gui in Ubuntu and only running the back end. If that doesn’t give me the required performance then I’ll just switch over to rasbian light as you suggested. Tonight or tomorrow I’ll go through and run the correct commands and see what happens. Thanks a bunch.

I am sure it will play nice once you get op25 configured considering you have plenty of RAM available. Most of my RPi's run
headless and I typically only flash them with "Lite". Doing so also avoids having to deal with pulseaudio issues that make it difficult
setup op25 with liquidsoap that I use for streaming under control of systemd. "Lite" only has ALSA that makes the task of
running headless via system service very easy to accomplish.

The bit job once you have your cofigs sorted out is getting the SDR trimmed to frequency. Some need little if any correction
while others can be a real PITA.
 

KC8VKB

Member
Joined
Jul 9, 2022
Messages
5
Location
Lansing, Michigan
Alrighty. I ended up starting completely over with the raspberry pi OS light. I now have op25 up and tracking the local p25 system. Only issue is I am getting a lot of garbled, choppy audio. Not sure what I can do to fix this? I see some references to fine tuning the SDR but am not sure how to do that
 

KC8VKB

Member
Joined
Jul 9, 2022
Messages
5
Location
Lansing, Michigan
I also see from your post above that pulse audio can be an issue? I’m currently running a Bluetooth speaker connected to the pi. Only way I could figure out how to do that is with pulse audio
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,013
Location
NE Wisconsin
I also see from your post above that pulse audio can be an issue? I’m currently running a Bluetooth speaker connected to the pi. Only way I could figure out how to do that is with pulse audio
Could be a pulse audio issue and suggest testing audio quality using either the Pi's headphone jack or via an attached HDMI monitor
that has audio capability. It you're still getting choppy audio, then post your FFT, Constellation, and Mixer plots.
 
Status
Not open for further replies.
Top