OP25 on a Raspberry Pi (part 3)

In my last part I set the Pi up to stream to Broadcastify.  In this one we are just going to pump audio out through the headphone jack.

I’m doing this with an old generic black RTL-SDR and it works and it works fine but it is kind of susceptible to heat and cold and the ppm correction drifts a bit.  I really recommend getting a v3 RTL-SDR or a NESDR Smart as they seem more stable.  At any rate it doesn’t matter, you’ll just have to deal with the drift if you have any.

My assumption here is that you have Raspbian installed on at least a Pi 3.  I haven’t tried it on a lesser Pi but I had it on a Pi 3 B + and then I found a couple Pi 3 B’s laying around and figured I’d reclaim my B+ for another project on another day.  OP25 runs fine on the Pi 3.

With Raspbian ensure that you are all up to date.  Make sure you are FEEDING THE BEAST AT LEAST 2AMPS.  YOUR RTL WILL PULL A LITTLE MORE CURRENT THAN JUST THE PI DOES.  You could get dropped audio, crashes, etc. if you don’t have enough power supplied to the Pi.  2 amps is enough.

sudo apt-get update
sudo apt-get upgrade

Now lets install op25.

git clone https://github.com/boatbod/op25.git
cd op25
./install.sh
sudo apt-get install gnuplot-x11

Now lets make sure the volume is up on the Pi.  Not the SYSTEM volume but rather the BCM2835 device volume.

alsamixer

Should look like this except your volume will be way down.  Hit the shift key and the + key to increase to max volume.

Now go to this directory:

cd /home/pi/op25/op25/gr-op25_repeater/apps

Now run this command.  Bear in mind you MUST KNOW THE FREQUENCY OF THE CONTROL CHANNEL YOU WANT TO FOLLOW AND CHANGE THE -f PART TO THE CORRECT FREQUENCY.

./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.2625e6 -o 25000 -q -2

This box will pop up.  Notice the top line has a bunch of zeros in it.  This indicates YOU ARE NOT TUNED TO THE CONTROL CHANNEL

You have to adjust the -q -2 part until you see numbers filled in.  For example I had to add -q 2 (not -2) to my command to get it to lock in.   THIS DEPENDS ON YOUR INDIVIDUAL SDR.  You many have to play around to find it and GNUPLOT can help with this.

Note that not only am I tuned correctly to the control channel it is already picking up voice transmissions.

NOTE:  WITH THIS OLD GENERIC RTL I CAN START USING -q 2 HOWEVER, IF I RUN FOR A WHILE, SHUT IT DOWN AND TRY TO START BACK UP IT IS HOT AND NOW REQUIRES -q 8 TO START.  WHAT AN AMAZING PAIN THAT WOULD BE.  I STRONGLY RECOMMEND GETTING A NEWER, BETTER, FASTER V3 STICK THAT IS VERY STABLE AND HAS LESS DRIFT.

Now we can add to our commands.  You need to have a trunk.tsv file set up and you need a talk group file set up.  I talk about that here. 

Now add to your last command the following:

-T trunk.tsv -V -2 -U 2> stderr-stream0.2

That makes the entire command: (remember to get your -q -whatever correct. Removing it completely can also work)

./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.2625e6 -o 25000 -q 2 -T trunk.tsv -V -2 -U 2> stderr-stream0.2

Provided your trunk.tsv file and talk group tsv file are configured correctly sound should now be coming out of your headphone jack.

18 thoughts on “OP25 on a Raspberry Pi (part 3)

  1. Randy

    I followed the install instructions and everything went OK, no errors. But when I issue the following script, (with my local control freq inserted) I just get a blank screen with OP25 at the top and the function commands at the bottom. I don’t even get the NAC ……Sysid with all zeroes line like you show in the tutorial.

    ./rx.py –args ‘rtl’ -N ‘LNA:47’ -S 2400000 -f 857.2625e6 -o 25000 -q -2

    Any pointers?

    Reply
    1. Alex Bowman

      Looks like the command you are using has the author’s local control frequency. Unless you are access the same site, you’ll need to change the frequency to your control channel. If you are on the correct frequency play with the -q. My setup works with -q 1, it’ll usually be different for every setup

      Reply
  2. Brian

    Thank you very much for these tutorials. I was able to get everything working except that the alpha tags are not flowing over to broadcasting and then through my feed. Any suggestions?

    Reply
  3. Robert Fisher

    Any tips for troubleshooting audio decoding on a RPi 3B? It looks like i’m successfully capturing and decoding the talkgroups, but for the life of me I cannot get any audio output either through streaming the output or through directly piping the audio to the headphones with -O plughw:0,1. I’ve confirmed my audio actually works (headphones and streaming both!) w/ speaker-test, and have tried both -D fsk4 and cqpsk. I’m running a 2.4A power brick, so power isn’t an issue…..

    Reply
    1. SoundGuyBW

      I have the same issue with the RPi 3B (non-plus). I’ve tried everything you have and still cannot get any sound from op25. I can hear playback via an mp3 and speaker-test through the headphone jack. I have also tried -D fsk4 and cqpsk in the command line and in my trunk.tsv file. I can see P25 Phase 2 transmissions and the various talkgroups come up. It looks like it’s decoding fine. I’m at -q 6. I am running a 2.5A power supply so power shouldn’t be an issue. Linux 4.14.79-v7+ #1159 . ALSA mixer is at 100% and not muted. Tried all the various combinations of -O to try forcing the various hardware outputs.
      Here’s my command:
      ./rx.py –args ‘rtl’ -N ‘LNA:47’ -S 1800000 -f 770.43125e6 -o 25000 -q 6 -T trunk.tsv -V -2 -U 2> clarindaerr.2

      It’s very frustrating, but I haven’t given up yet. If anyone has any ideas to try, let me know. Thanks!

      Reply
      1. SoundGuyBW

        I figured it out! I was NOT tuned correctly. Using “-q 6” was too far out of range to actually decode traffic, but it WAS tuned just enough for op25 to see the control channel. A -q value of -1 or 0 was what solved my issue. I was then able to see the 4 tight dots on the constellation plot, 4 distinct lines at 3, 1, -1 and -3 on the symbol plot, and see just exactly how close I was to center in the mixer plot.
        Now that I figured it out, my advice if you have the same issue or can’t see the plots is to guess how close you are initially by the indicated ‘tsbks’ number. When I started working with op25, I was seeing 1-5 tsbks per second. Once my -q value was set properly, I was seeing 40+ per second. This makes sense because If op25 can’t get enough data packets to decode an audio stream, it simply won’t produce one. It gets enough packets from the control frequency to see the talkgroups and transmit frequency, but isn’t tuned accurately enough to decode the audio stream.
        The frequency (where it initially says 000.00000/000.00000) and System ID (starts as 0x) in the command window should populate almost immediately after starting your op25 command if you’re tuned/centered correctly. If op25 doesn’t populate those values and start seeing a decent tsbks number, you are not tuned accurately enough yet so try another -q value.
        More experienced users may wish to chime in and correct me and I welcome it! We need much more troubleshooting documentation on this amazingly free software. I’m sure it will come with time as P25 Phase 2 adoption is really just getting started.
        It’s frustrating, but don’t give up!

        Reply
        1. John Hagensieker Post author

          Awesome. I literally tried every month or so for a year with a little sit down session with OP25 for an hour here and there before I got it. My whole goal with this page was to make it easier and compile a lot of the info in one place to get it up and running. Glad to see you got it.

          Reply
    2. SoundGuyBW

      I have the same issue with the RPi 3B (non-plus). I’ve tried everything you have and still cannot get any sound from op25. I can hear playback via an mp3 and speaker-test through the headphone jack. I have also tried -D fsk4 and cqpsk in the command line and in my trunk.tsv file. I can see P25 Phase 2 transmissions and can see the various talkgroups pop up. It looks like it’s decoding fine. I’m at -q 6. I am running a 2.5A power supply so power shouldn’t be an issue. Linux 4.14.79-v7+ #1159 . ALSA mixer is at 100% and not muted. Tried all the various combinations of -O to try different hardware outputs.

      ./rx.py –args ‘rtl’ -N ‘LNA:47’ -S 1800000 -f 770.43125e6 -o 25000 -q 6 -T trunk.tsv -V -2 -U 2> clarindaerr.2

      It’s very frustrating, but I haven’t given up yet. If anyone has any ideas to try, let me know. Thanks!

      Reply
  4. Jason

    Great tutorial, all is working as described/expected EXCEPT audio out sounds like a super slow talking synthesised robot. Any hints on the cause? Using Raspberry Pi 3 Model B Rev 1.2

    Reply
  5. Jeremy Goodin

    my issue after executing on a RPi 3, RTL2832U R820T2

    pi@feed1:~/op25/op25/gr-op25_repeater/apps $ ./rx.py –args ‘rtl’ -N ‘LNA:47’ -S 2400000 -f 774.78125 -o 25000 -q -2

    Traceback (most recent call last): File “./rx.py”, line 52, in
    import op25
    ImportError: No module named op25

    Reply

Leave a Reply to Brian Cancel reply

Your email address will not be published. Required fields are marked *