Attached is a patch file that updates Max's terminal.py and trunking.py
in a few ways:
1. terminal.py reads the window size at startup and adjusts the curses
settings accordingly. If you set xterm or equivalent to more rows (I'm
using 38), you can handle sites with more than 20 frequencies without
crashing. This is the patch I posted a week or so ago. (Max, I think
your idea of making the main window two columns is still a good one, and
the space that frees up could be used to display other interesting info.
I don't think I'll have the time to learn how to implement that, though.)
2. terminal.py now displays an info line at the bottom of the screen
showing the keyboard commands that are available. I also added a blank
line or two to make the display look (IMHO) a bit cleaner.
3. If you set -v to 5 or higher, every frequency or talkgroup command
is output on stderr (this will generate a lot of output on a busy
system!). If you want to generate a list of every unique frequency used
by the system, this will produce it from the stderr.2 file:
grep freq: stderr.2 | cut -d" " -f3 | sort | uniq
or to get all the unique talkgroups:
greg freq: stderr.2 | cut -d" " -f5 | sort | uniq
Max, this was actually a bit less trivial than first thought. The code
is easy, but where to put it wasn't. Your suggestion about the end of
update_state() led to only one update per second, and lost many
freq/talkgroup set commands. I think I found a spot that doesn't miss
any. Lots of output, but lets you build a comprehensive tgid list.
4. The stderr output of "set trunk_cc..." was not all that useful, so
it's now set to appear only when the -v level is set to 6 or greater.
(Behavior of -v 10 includes the above but is otherwise unchanged.)
5. I cleaned up all the logging/status/debug outputs in trunking.py to
use "sys.stderr.write()" rather than "print". That will stop them from
showing up in the terminal screen. While I was at it, I also added
newlines to the end of all output and did some other cleanup.
Hope this is useful.
73,
John
Hi --
Back in July I got Max's then-current branch running on my RPi 3, and
then proceeded to make some changes around the edges. In terminal.py I
did a couple of things:
1. Made the terminal window size-aware so that you can display more
than 20 "voice frequency..." lines without crashing Without this, if a
site has more than 20 channels, the program will crash when the 21st
shows up. With the patch, just make the console window taller and avoid
the problem.
2. Cleaned up the console display a bit, and added a "help" line to
display the available commands.
I don't think there have been any recent changes that would impact these
changes and my diff seems to apply cleanly to the current version.
The more interesting set of changes are in trunking.py where I cleaned
up the log lines for consistency, moved one set of messages from console
to stderr, added some granularity to the -v settings, and added a couple
of new log messages that provide additional info.
As a result, the stderr.2 output is now (IMHO) more useful, and you can
analyze it to learn fun facts. For example, attached if Yahoo allows
are screenshots of activity by hour, and a sorted list of the most
active talkgroups on the site. I wrote a shell script that reads
stderr.2 to generate this data.
I see that there's been some recent activity in Graham's new fork. It
looks like trunking.py has been updated and I don't know if my changes
might conflict. My patch-fu is not the greatest, and I don't want to
screw things up, but I'd like to contribute my stuff to the project.
Graham, I don't have your direct email address. Can I send you my files
(based on the Max branch as of mid-July) and ask you to diff them and
add them to your repo if they are OK? I'll also provide the traffic
analysis script. Of course, I'm happy to send the files to anyone else
who might want them.
Thanks,
John N8UR
jra(a)febo.com
PS -- and I am hoping to make a ready-to-go RPi op25 image file
available as soon as I get these patches integrated.
I attempted to built the MAX branch of OP25 on the August release of Raspbian Jessie Stretch Lite but was unable to compile the code resulting in the following error during make.
[ 52%] Building CXX object op25/gr-op25_repeater/lib/imbe_vocoder/CMakeFiles/imbe_vocoder.dir/pitch_est.cc.o
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘32970’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
};
^
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘33226’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘33482’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘33482’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘33738’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘33994’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘34250’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘34506’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘34506’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘34762’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘35018’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘35274’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘35530’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘35530’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘35786’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘36042’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘36298’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘36554’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘36554’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘36810’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘37066’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘37322’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘37578’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘37578’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘37834’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘38090’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘38346’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘38602’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘38602’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘38858’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘39114’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘39370’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
/home/pi/op25/op25/gr-op25_repeater/lib/imbe_vocoder/pitch_est.cc:60:1: error: narrowing conversion of ‘39626’ from ‘int’ to ‘Word16 {aka short int}’ inside { } [-Wnarrowing]
op25/gr-op25_repeater/lib/imbe_vocoder/CMakeFiles/imbe_vocoder.dir/build.make:326: recipe for target 'op25/gr-op25_repeater/lib/imbe_vocoder/CMakeFiles/imbe_vocoder.dir/pitch_est.cc.o' failed
make[2]: *** [op25/gr-op25_repeater/lib/imbe_vocoder/CMakeFiles/imbe_vocoder.dir/pitch_est.cc.o] Error 1
CMakeFiles/Makefile2:737: recipe for target 'op25/gr-op25_repeater/lib/imbe_vocoder/CMakeFiles/imbe_vocoder.dir/all' failed
make[1]: *** [op25/gr-op25_repeater/lib/imbe_vocoder/CMakeFiles/imbe_vocoder.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
Any ideas on how to patch Raspbian Jessie Stretch Lite to correct the Makefile recipe error?
Thank you,
Bill, WA8WG
Hi All,
I'm looking for hints as to how to get P25 frames to decode properly using
rx.py and wireshark. I'm using the max branch of OP25 on Debian 8. I'm
trying to monitor a phase 2 system.
I have compiled wireshark 1.8.6, with the OP25 patches and have it running
on Ubuntu 14.04 on another machine. I can see P25 frames in wireshark, they
show up but I have very strange information in them. Lots of TGIDs set to
0, etc.
There are also very few if any LDU1 and LDU2 frames making it into the
traces on both Phase 1 and 2. Mostly HDU and link control stuff. I'm
watching OP25 switch to a voice channel in the console so I know that there
is audio on one of the monitored TGs.
Does anyone have any pointers or gotchas for this? I have tried both with
and without the -2 and -v switches. I am using -w and -W 224.0.0.1. Should
I be using the old branch for this? Is this possible?
I have also noticed on Phase I systems that the TGID, ALGID, and MI shows
up in the stderr file when debug (-v) is set to 10, I think. But this does
not happen on Phase 2. Any way to make this happen on Phase 2?
Thanks for any assistance.
James
Hi again all,
I'm trying to get the main branch running with some of the changes that Joe
incorporated last year. Everything compiles fine (this is a fresh install
of Ubuntu 14.04) but when running scope.py I'm getting and undefined symbol
error:
(most recent call last):
File "./scope.py", line 55, in <module>
import op25_repeater
File "/usr/local/lib/python2.7/dist-packages/op25_repeater/__init__.py",
line 45, in <module>
from op25_repeater_swig import *
File
"/usr/local/lib/python2.7/dist-packages/op25_repeater/op25_repeater_swig.py",
line 28, in <module>
_op25_repeater_swig = swig_import_helper()
File
"/usr/local/lib/python2.7/dist-packages/op25_repeater/op25_repeater_swig.py",
line 24, in swig_import_helper
_mod = imp.load_module('_op25_repeater_swig', fp, pathname, description)
ImportError: /usr/local/lib/libgnuradio-op25_repeater.so: undefined
symbol: _ZN8p25p2_vf12encode_dstarEPhPKi
Searching around for this does not turn up anything really. Has anyone
seen this before?
Thanks,
James
Trying to get op25 running was pretty much an exercise in frustration and annoyance. I've been doing computers for quite a few years, but I'm not a linux power user. After quite a bit of trial and error, wading through multiple forum posts, and doing more trial and error, I came up with a (hopefully) complete set of step by step instructions for getting op25 up and running. These instructions assume that you have just done a clean install of ubuntu 14.04 32bit linux. I ran into multiple problems with the 64 bit version. While I'm sure that they could be overcome, it seems the 32 bit version is easier.
There are also probably other easier and/or faster ways of doing some of this stuff. Some of the stuff may be redundant. The bottom line is this is what worked for me. Your mileage may vary. Batteries not included.
So, without further ado....
Make sure you have a working internet connection.
Click on the settings icon on the left. When the system settings window opens, click on "software and updates".
The first tab (ubuntu software) should have everything checked.
Click on the second tab (other software).
The first two options should be unchecked. Check them. You may be asked for your password to authenticate after checking the first one. Give it, then check on the second one.
Click close on the lower right.
You'll be told that the software needs to be updated. Let it.
x out of the system settings window.
Open a terminal window by typing <CTRL><ALT>t
type in the following sequence of commands, pressing the enter key after each line. Anything in parentheses is a comment.
sudo apt-get update
sudo apt-get update
sudo apt-get install aptitude
sudo apt-get install aptitude
sudo aptitude update
(Yes, some of the commands are issued twice. I found that it makes it work. )
sudo apt-get update
sudo apt-get build-dep gnuradio
(hum the theme from Final Jeopardy. Make a sandwich. Get some chips to go with the sandwich. Get a cold drink to go with the sandwich and chips. Eat the sandwich and chips, and drink the cold drink. Quietly hum In A Gadda Da Vida. The long version. You're going to be here a while.)
sudo apt-get install gnuradio gnuradio-dev gr-osmosdr librtlsdr-dev libuhd-dev libhackrf-dev libitpp-dev libpcap-dev git
(go refill the cold drink and get some cookies for dessert. Eat the cookies slowly, and drink your cold drink.)
cd ~
sudo git clone git://op25.osmocom.org/op25.git
cd op25
sudo mkdir build
cd build
sudo cmake ../
sudo make
sudo make install
sudo ldconfig
Now, we're going to blacklist the standard rtlsdr driver. To do this, use the following series of commands:
cd /etc
cd modprobe.d
sudo gedit blacklist.conf
Go to the end of the file, hit enter to add a blank line (for readability) and type in the following two lines:
# this line prevents the standard dvb driver from loading
blacklist dvb_usb_rtl28xxu
At this point, you should have gnuradio and op25 installed. The next thing to do is to edit the files invoking op25 so you can listen to your system of interest.
use the following sequence of commands to create a shell file to invoke op25 on your system of interest:
cd ~
sudo gedit op25
Now, type in the following lines. We're going to assume that you want to listen to a P25 Phase II system.
#!/bin/bash
cd ~/op25/op25/gr-op25_repeater/apps
python scope.py --args 'rtl' -g 65 -f 851.200e6 -N 'LNA:49' -2 -V -v 0 -S 1000000 -q 2 -T trunk.tsv
cd ~
Save the file, and x out of gedit.
An explanation of each of the command line arguments is available in the documentation. For now, we'll point out that the number following -f is the frequency of the control channel of interest, and the number following -q is the correction factor in ppm for the sdr stick that you're using.
Next, we have to edit the trunking control files. Do the following series of commands:
cd ~/op25/op25/gr-op25_repeater/apps
sudo gedit trunk.tsv
The default file that comes with the install lists a number of systems. Delete everything after the double quotes around "Center Frequency". Hit enter to get to the beginning of a new line. Type in the following line:
"Kokomo"<tab>"851.200"<tab>"0"<tab>"0x734"<tab>"CQPSK"<tab>"trunkk.tsv"
where <tab> is the tab key. Do not insert any spaces -- use tab only.
By way of explanation, the first is the name of the system. Then comes the frequency of the control channel. You could insert several control channel frequencies separated by commas between the quotes, but I've found that this gives less than optimal performance. The remaining fields are offset, then the system ID (which you can find on RadioReference.com), the modulation type, and a file listing talkgroups. Substitute the appropriate data for your system. There is also a provision for whitelisting and blacklisting particular talkgroups, which I won't cover here.
*** Make sure that there is absolutely nothing after the final quotes. Any spaces will make the program crash. ***
At this point, save the file, and x out of gedit.
Almost there.....
Finally, we need to create a listing of talkgroups and names. This is actually optional, but it's much better listening when you can see what talkgroup is active, rather than just a number.
While there are several ways of getting a talkgroup listing into a file, I'm only going to cover manually entering talkgroups. Talkgroups are in a tab delimited file, without quotes around the talkgroup numbers and tag names. For the example file, I'm only going to put in a couple of talkgroups -- just enough that the idea is obvious.
If you've been following, you should still be in the ~/op25/op25/gr-op25_repeater/apps directory.
Perform the following series of commands:
sudo gedit trunkk.tsv
Then, enter the following lines. Press the <tab> key between the talkgroup number and talkgroup name, and press enter after the talkgroup name.
10008 County All-Talk
10022 EMS Dispatch
After you've entered your desired talkgroups, save the file, and x out of gedit.
Go back to your home directory by typing:
cd ~
To start op25, type the following
bash op25
The operation of the program has been documented elsewhere, and it's mostly self-explanatory.
A couple of hints: If you're getting choppy audio, turn off the displays for the tabs from spectrum through symbols. A Celeron 530 at 1.73 GHz would barely handle the audio with the displays turned off.
If you get a NAC error when trying to start the program, check for trailing spaces in your trunk.tsv file. *Any* spaces at the end will crash the program.
Hopefully, this will make it easier for people to get op25 up and running. Enjoy!