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
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!
Every now and then, shortly after startup I am seeing the error shown in
the attached screenshot. It causes the program to exit. It doesn't
show up every time, and if it doesn't appear within 30 seconds or so, it
won't ever.
I have no clue what's causing it; I don't think it's related to my
patches (at least, the offending line is well before any of my changes).
Maybe something isn't always initialized properly?
John
I've much improved the frequency/talkgroup logging in the patch I sent
to the list on Monday. That version just dumped out, once per second,
the freq and talkgroup list shown in the console main window (one line
per freq, with last used tgid.
New version:
-v 5 prints:
[timestamp] new freq: [freq]
[timestamp] new tgid: [tgid] [tag if tagfile present]
[timestamp] set control freq: [freq] (note: only if cc_trunk changes)
This makes it easy to build a list of all the frequencies and talkgroups
seen on the system, without creating excess output.
-v 6 includes the above and adds a line for every tgid whether new or not:
[timestamp] set tgid: [tgid] (note: tag not included)
In addition to the above, this allows simple traffic analysis (how often
is this tgid used, and when).
Also changed: there was a fairly frequent line printed to console about
"process_data_unit timeout". I changed that to go to stderr when -v is
set to 10 or above, and also added a timestamp. I have no idea what
this message means, but it doesn't seem to affect program operation.
Attached are both the original patch file from Monday, and the new
patch. Apply the original one, then patch2 on top of it.
John
Max.
I am having difficulty getting sockaudio.py working. See my error log
below. Any idea of what I have wrong?
gr-osmosdr 0.1.3 (0.1.3) gnuradio 3.7.5
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf
rfspace airspy
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Found Rafael Micro R820T tuner
Project 25 IMBE Encoder/Decoder Fixed-Point implementation
Developed by Pavel Yazev E-mail: pyazev(a)gmail.com
Version 1.0 (c) Copyright 2009
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; see the file ``LICENSE'' for details.
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO[149919077
3.506202]p25p1_fdma::rx_sym() timeout
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO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OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOO
Thank you,
Bill
William G. Becks, WA8WG
N7027 Shady Lane Circle
Porterfield, WI 54159
E-Mail: wa8wg(a)centurytel.net
I know that a while back there was a grc flowraph of op25 that handled DES. Any chance of a pybombs recipe for op25 that handles RC4 as implemented in Advanced Digital Privacy?
In normal operation, it seems that stderr.2 captures mainly messages
retuning to the control channel (which is what helped me catch the issue
noted in my other message, so that's not all bad).
But I think it would be very useful to have the option to log each
channel/talkgroup handoff (I'm not sure of the terminology). In
particular, building a list of talkgroups would be handy to identify
ones that don't have tags.
I don't know the difficulty involved, I think it would be really nice to
include something like this:
1434343.003423423 frequency: 853.500 talkgroup: 57234
for each handoff. You could then use command line tools (cut, sort,
uniq) to build up channel and talkgroup lists.
For extra credit, do this at different debug levels. For example,
default would print only tuning errors and other things that need user
attention. Then at -v 5 print handoffs, at -v 6 print handoffs plus
control channel, and leave -v 10 and above as-is. Or maybe add a new
command line option to specify the output file.
I'm willing to work on this. If I have time, I'll play around with it
this week. I will happily accept hints on how to go about it.
73,
John
My local site switched to an alternate control channel a few weeks ago.
To address this, I added the primary and 3 alternate CCs in trunk.tsv.
(Then last night they switched back to the primary...)
I noticed from tail -f'ing stderr.2 that the program (trunking.py?)
cycles through all the listed control channels, in order from trunk.tsv,
each time it returns from a voice channel. If the active CC is last on
the list, the time spent doing that results in dead time when calls are
missed.
What if the program reordered the control channel list so the active
channel is first? That way the retune would immediately go to the
active channel and only if it failed would the other channels be scanned
(and then the new active channel would go to the head of the list).
73,
John
I think it would be helpful to display the available commands, e.g.
"(H)old, (L)ockout, (S)kip, (Q)uit" on either the top or bottom of the
terminal window.
Also, would it be feasible to add a pair of commands (maybe up/down
arrow) that would allow adjusting the frequency correction while the
program is running?
Thanks!
John
Fresh install of Rasbian jesse and careful following of Max's
instructions got rx.py running for me. However, it crashes after a few
minutes. Attached is a screenshot of stderr.2 when the crash occurs.
Any ideas?
I'm also have trouble when trying to use the "-P" option. I'll try to
capture details of that later.
(BTW -- I found I had better luck using the -T option than just running
the command line. Among other things, my local system has apparently
shifted to one of the alternate control frequencies, so listening on the
primary didn't get me anywhere. Since trunk.tsv specified the
alternates, after a few seconds rx.py was able to find the active
channel and sync up to it.)
John