RPi 3 & RTL-SDR/OP25?

Status
Not open for further replies.

apu

Member
Joined
Dec 19, 2002
Messages
123
@WB0VHB - do you have tabs or spaces between each item in your config file?
 

N6ML

Member
Premium Subscriber
Joined
Sep 26, 2008
Messages
1,156
Location
SF Bay / Delta, CA
"Sysname" "Control Channel List" "Offset" "NAC" "Modulation" "TGID Tags File" "Whitelist" "Blacklist" "Center Frequency"
"IOWA" "774.30625" "0" "0" "" "" "" "0" ""
Yeah, that doesn't look quite right. Did you pull boatbod's latest changes? What does 'git log -1' say?

Try making your .tsv look like this:

Code:
"Sysname"       "Control Channel List"  "Offset"        "NAC"   "Modulation"    "TGID Tags File"        "Whitelist"     "Blacklist"     "Center Frequency"
"IOWA"  "774.30625"     "0"     "0"
Looks like that's a Phase-II system, so make sure you have '-2' in your command-line arguments (rx.py line)
 

N6ML

Member
Premium Subscriber
Joined
Sep 26, 2008
Messages
1,156
Location
SF Bay / Delta, CA
P.S. As apu hints, and reiterating from earlier - be careful about tabs vs. spaces between the columns...
 

maus92

Member
Premium Subscriber
Joined
Jun 23, 2004
Messages
5,737
Location
Annapolis
Yes I see a very strong signal on 774.30625 and can see two other signals from the Lee Co. and Jefferson Co. sites. Also the strongest signal is on 774.34425 which isn't listed in the database but assume it is coming from the Des Moines Co site that is not very far from me.

I'm far from being real familiar with Linux but did not copy and paste the trunk.tsv example boatbod provided. Instead I opened that file in an editor and changed the data. I'm assuming saving after that edit maintained the correct file format?
Are you using Raspian or another flavor of Linux? What editor are you using? Libre Office that comes with several versions of Linux including Raspian has a spreadsheet program that will *try* to change the .tsv file to another format, so you have to be careful to save it as a CSV file while maintaining the .tsv extension. (I don't use a text editor to change a CSV file.)

Have you tried to run Unitrunker on any of those suspected control channels to verify that are actually carrying data?
 

boatbod

Member
Joined
Mar 3, 2007
Messages
2,789
Location
Talbot Co, MD
Are you using Raspian or another flavor of Linux? What editor are you using? Libre Office that comes with several versions of Linux including Raspian has a spreadsheet program that will *try* to change the .tsv file to another format, so you have to be careful to save it as a CSV file while maintaining the .tsv extension. (I don't use a text editor to change a CSV file.)

Have you tried to run Unitrunker on any of those suspected control channels to verify that are actually carrying data?
I'm old-school so I use "gvim" and "vi" as text editors, but most people are going to look for something more intuitive these days. Just make sure you can edit the file and save it without being altered by the underlying application. Libre Office is ok but you have to tell it how you want things delimited during the export.
 

WB0VHB

Member
Joined
Oct 30, 2009
Messages
123
Location
Mt. Union, Iowa
Are you using Raspian or another flavor of Linux? What editor are you using? Libre Office that comes with several versions of Linux including Raspian has a spreadsheet program that will *try* to change the .tsv file to another format, so you have to be careful to save it as a CSV file while maintaining the .tsv extension. (I don't use a text editor to change a CSV file.)

Have you tried to run Unitrunker on any of those suspected control channels to verify that are actually carrying data?
Running Raspian and used nano for an editor.
These towers are fairly new and a local tech wondered if there was any valid being sent now? I don't have Unitrunker installed and attempted to start my P25 phase 2 exploration using op25.
 

N6ML

Member
Premium Subscriber
Joined
Sep 26, 2008
Messages
1,156
Location
SF Bay / Delta, CA
Running Raspian and used nano for an editor.
These towers are fairly new and a local tech wondered if there was any valid being sent now? I don't have Unitrunker installed and attempted to start my P25 phase 2 exploration using op25.
The errors you were getting before indicated problems with your trunk.tsv file. I'm fairly sure that you'll at least see control traffic if you can get that sorted out....
 

boatbod

Member
Joined
Mar 3, 2007
Messages
2,789
Location
Talbot Co, MD
The errors you were getting before indicated problems with your trunk.tsv file. I'm fairly sure that you'll at least see control traffic if you can get that sorted out....
Correct. If the control channel is active, even with no voice traffic you'll still see a steady stream of tsbks rolling in.
 

maus92

Member
Premium Subscriber
Joined
Jun 23, 2004
Messages
5,737
Location
Annapolis
This is slightly OT, but in the NAC field of the trunk.tsv file, does NAC refer to the sysid or the site NAC? The site I'm monitoring coincidentally has the same site NAC as the radio system's SysID.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
2,789
Location
Talbot Co, MD
This is slightly OT, but in the NAC field of the trunk.tsv file, does NAC refer to the sysid or the site NAC? The site I'm monitoring coincidentally has the same site NAC as the radio system's SysID.
It's not SYSID, it's the site NAC which is sent in every tsbk seen on the control channel.
 

marklt1

Member
Feed Provider
Joined
Mar 5, 2005
Messages
49
Location
Streetsboro, OH
Mark - the main trick for better RPi3 audio is to reduce your sample rate to -S 57600 as that frees up cpu cycles that would otherwise be used for USB data transfer.

If you want to stream raw audio frames out of op25 to another client across the network you change the command line options:

Remove: -U
Add: -V -2 -w -W 192.168.100.100 -u 23456
(Note: you change the IP address to whatever destination host you are using)
I am using R820T2 dongle (both original and V3 styles) and I cannot seem to get the sample rate to anything under 250000. It's not a real issue with my newer Pi3b, but my slower PI units seem to be impacted.

My OP25 screen comes back with supported sample rates 250000-2560000 step 24000

The log returns this:
Using device #0 Realtek RTL2838UHIDIR SN: 105
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Invalid sample rate: 57600 Hz
Using two-stage decimator for speed=1024000, decim=16/2 if1=64000 if2=32000

Is there some other command line switch or setting to force these dongles to your recommended speed?
 

WB4EOT

Member
Joined
Dec 19, 2002
Messages
20
Location
Roanoke, VA
No Audio with OP25 rx.py command

Gents,

What am I doing wrong with this command line?

./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.1625e6 -o 25000 -q -1 -V -2 -U 2> stderr.2

I have no audio from RPI3 1/8 earphone jack. Audio IS present when using browser on local news websites.

Setup is RPI3 with RTL-SDR V3 dongle.

./rx.py does decode control channel with terminal window showing the following for Roanoke City/County P25 system in Virginia.

NAC 0x341 WACN 0xbee00 SYSID 0x349 857.162500/812.162500 tsbks 15480
voice frequency 854.412500 tgid(s) 221 None 241.7s ago count 65
voice frequency 854.962500 tgid(s) 321 None 270.7s ago count 51
voice frequency 856.062500 tgid(s) 21 None 119.4s ago count 51
voice frequency 856.437500 tgid(s) 221 None 226.1s ago count 24
voice frequency 856.462500 tgid(s) 223 None 64.2s ago count 52
voice frequency 856.662500 tgid(s) 221 None 123.3s ago count 51
voice frequency 856.962500 tgid(s) 202 None 258.1s ago count 17
voice frequency 857.262500 tgid(s) 223 None 42.3s ago count 130
voice frequency 857.437500 tgid(s) 221 None 161.0s ago count 99
voice frequency 857.462500 tgid(s) 221 None 208.9s ago count 24
voice frequency 857.737500 tgid(s) 21 None 154.7s ago count 29
voice frequency 857.762500 tgid(s) 201 None 152.9s ago count 178
voice frequency 858.262500 tgid(s) 202 None 220.3s ago count 70
voice frequency 858.462500 tgid(s) 41 None 15.9s ago count 17

Control Channel level is -40 db.
Constellation plot shows symbols in corners of quadrants.
Symbol and Data Scope appear to be acceptable.
Mixer balance levels fluctuate between 15 to 27. I have no idea how to reduce Mixer balance to lower levels

No *.tsv files have been created as this was typed.

Joe
WB4EOT
 

marklt1

Member
Feed Provider
Joined
Mar 5, 2005
Messages
49
Location
Streetsboro, OH
If you're using a linux machine to play the audio, there is a utility that's part of the op25 distro to act as a stand-alone audio player.

Code:
./audio.py

Usage: audio.py [options]

Options:
  -h, --help            show this help message and exit
  -O AUDIO_OUTPUT, --audio-output=AUDIO_OUTPUT
                        audio output device name
  -u WIRESHARK_PORT, --wireshark-port=WIRESHARK_PORT
                        Wireshark port
  -2, --two-channel     single or two channel audio
  -x AUDIO_GAIN, --audio-gain=AUDIO_GAIN
                        audio gain (default = 1.0)
By default you don't need any command line options unless you want to use a different port or audio device.
At this point, I am running my Pi3b headless with UDP audio to a Windows application which I developed to play, archive and catalog calls to mp3 file, and stream the audio out to Broadcastify. The sound quality is fantastic and I am very pleased with the results so far.
I get the Tagname, TGID, and System name from making http queries to OP25. When I make the query, I receive anywhere between 1600 and 4500 bytes depending on the size and channels of the listening site. I get around 220ms turnaround time for each query which isn't bad for what I am doing. I am repeatedly making this query so that I can determine when call start and end. Although I do not see the CPU even budge when I am making these queries, sometimes I get timeouts, which I would like to minimize. This method is the only reasonable way I know to extract this kind of information into my Windows application.

I would like to find a way to receive only the few bits of information ( Tagname, TGID, and System name)that I really need to determine which TGID is in use.
I have experimented with rx.py around line 705 ( def process_qmsg(self, msg):) trying different modifications, posting different http JSON parameters ([{""command"":""update"",""data"":0}]), and the like but I cannot seem to retrieve anything less than a dump of all the values returned to the main screen.
If there is a location where I could comment out the code providing all the data I do not need from the query, that would be helpful too.

Ideally, I think the best solution would be to connect as a remote terminal from my WIndows application so that the screen information would be streamed to my application through a UDP connection. I've looked through terminal.py to get some ideas, but I am not too familiar with it to fully understand the mechanics.

I am a seasoned DotNet developer and systems engineer, but my weakness is
in Python, although I am working my way through it.

Any ideas on how to accomplish this without a huge amount of effort?
Thanks in advance.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
2,789
Location
Talbot Co, MD
I am using R820T2 dongle (both original and V3 styles) and I cannot seem to get the sample rate to anything under 250000. It's not a real issue with my newer Pi3b, but my slower PI units seem to be impacted.

My OP25 screen comes back with supported sample rates 250000-2560000 step 24000

The log returns this:
Using device #0 Realtek RTL2838UHIDIR SN: 105
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Invalid sample rate: 57600 Hz
Using two-stage decimator for speed=1024000, decim=16/2 if1=64000 if2=32000

Is there some other command line switch or setting to force these dongles to your recommended speed?
Curious. 57600 works fine on all my 820T2 dongles. By the way the "supported sample rates" thing says that on mine system even though it works just fine. The "Invalid sample rate" is what's stopping you. Try working upwards (or downwards) in multiples of 9600 until you find the lowest it will accept.

Overall though, I would say anything slower than the RPi3 is probably not going to work very well. The Pi3 is on the edge of being acceptable with audio decode.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
2,789
Location
Talbot Co, MD
Gents,

What am I doing wrong with this command line?

./rx.py --args 'rtl' -N 'LNA:47' -S 2400000 -f 857.1625e6 -o 25000 -q -1 -V -2 -U 2> stderr.2

I have no audio from RPI3 1/8 earphone jack. Audio IS present when using browser on local news websites.

Setup is RPI3 with RTL-SDR V3 dongle.

./rx.py does decode control channel with terminal window showing the following for Roanoke City/County P25 system in Virginia.

NAC 0x341 WACN 0xbee00 SYSID 0x349 857.162500/812.162500 tsbks 15480
voice frequency 854.412500 tgid(s) 221 None 241.7s ago count 65
voice frequency 854.962500 tgid(s) 321 None 270.7s ago count 51
voice frequency 856.062500 tgid(s) 21 None 119.4s ago count 51
voice frequency 856.437500 tgid(s) 221 None 226.1s ago count 24
voice frequency 856.462500 tgid(s) 223 None 64.2s ago count 52
voice frequency 856.662500 tgid(s) 221 None 123.3s ago count 51
voice frequency 856.962500 tgid(s) 202 None 258.1s ago count 17
voice frequency 857.262500 tgid(s) 223 None 42.3s ago count 130
voice frequency 857.437500 tgid(s) 221 None 161.0s ago count 99
voice frequency 857.462500 tgid(s) 221 None 208.9s ago count 24
voice frequency 857.737500 tgid(s) 21 None 154.7s ago count 29
voice frequency 857.762500 tgid(s) 201 None 152.9s ago count 178
voice frequency 858.262500 tgid(s) 202 None 220.3s ago count 70
voice frequency 858.462500 tgid(s) 41 None 15.9s ago count 17

Control Channel level is -40 db.
Constellation plot shows symbols in corners of quadrants.
Symbol and Data Scope appear to be acceptable.
Mixer balance levels fluctuate between 15 to 27. I have no idea how to reduce Mixer balance to lower levels

No *.tsv files have been created as this was typed.

Joe
WB4EOT
The lack of "-T trunk.tsv" is what's preventing audio. If you have pulled updates that I posted last night, you should be able to hit "t" in the terminal to get it working at least temporarily until you make the required .tsv file.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
2,789
Location
Talbot Co, MD
At this point, I am running my Pi3b headless with UDP audio to a Windows application which I developed to play, archive and catalog calls to mp3 file, and stream the audio out to Broadcastify. The sound quality is fantastic and I am very pleased with the results so far.
I get the Tagname, TGID, and System name from making http queries to OP25. When I make the query, I receive anywhere between 1600 and 4500 bytes depending on the size and channels of the listening site. I get around 220ms turnaround time for each query which isn't bad for what I am doing. I am repeatedly making this query so that I can determine when call start and end. Although I do not see the CPU even budge when I am making these queries, sometimes I get timeouts, which I would like to minimize. This method is the only reasonable way I know to extract this kind of information into my Windows application.

I would like to find a way to receive only the few bits of information ( Tagname, TGID, and System name)that I really need to determine which TGID is in use.
I have experimented with rx.py around line 705 ( def process_qmsg(self, msg):) trying different modifications, posting different http JSON parameters ([{""command"":""update"",""data"":0}]), and the like but I cannot seem to retrieve anything less than a dump of all the values returned to the main screen.
If there is a location where I could comment out the code providing all the data I do not need from the query, that would be helpful too.

Ideally, I think the best solution would be to connect as a remote terminal from my WIndows application so that the screen information would be streamed to my application through a UDP connection. I've looked through terminal.py to get some ideas, but I am not too familiar with it to fully understand the mechanics.

I am a seasoned DotNet developer and systems engineer, but my weakness is
in Python, although I am working my way through it.

Any ideas on how to accomplish this without a huge amount of effort?
Thanks in advance.
The area of code you are looking for is in trunking.py. Search for "json" (there are two methods - one calls the other).

My recommendation would be to write a new request message type that could be handled minimally without impacting existing functionality. You'd need to change several python modules to do this though.
 

WB4EOT

Member
Joined
Dec 19, 2002
Messages
20
Location
Roanoke, VA
OP25 Audio Decode

The lack of "-T trunk.tsv" is what's preventing audio. If you have pulled updates that I posted last night, you should be able to hit "t" in the terminal to get it working at least temporarily until you make the required .tsv file.
Boatbod, thanks for reply. How do I pull the updates? And will the updates have ./op25.sh in apps directory?
 

maus92

Member
Premium Subscriber
Joined
Jun 23, 2004
Messages
5,737
Location
Annapolis
Curious. 57600 works fine on all my 820T2 dongles. By the way the "supported sample rates" thing says that on mine system even though it works just fine. The "Invalid sample rate" is what's stopping you. Try working upwards (or downwards) in multiples of 9600 until you find the lowest it will accept.

Overall though, I would say anything slower than the RPi3 is probably not going to work very well. The Pi3 is on the edge of being acceptable with audio decode.

Do you think the new RP3A+ will run OP25? I think the only silicon change is 512Mb vs 1Gb onboard memory.
 

WB4EOT

Member
Joined
Dec 19, 2002
Messages
20
Location
Roanoke, VA
Boatbod, thanks for reply. How do I pull the updates? And will the updates have ./op25.sh in apps directory?
Boatbod,

I found my answer in one of your earlier posts.

cd ~/op25
git pull
./install.sh

Tonight I'll pull updates, build *.tsv files and try once again.
 

maus92

Member
Premium Subscriber
Joined
Jun 23, 2004
Messages
5,737
Location
Annapolis
Boatbod,

I found my answer in one of your earlier posts.

cd ~/op25
git pull
./install.sh

Tonight I'll pull updates, build *.tsv files and try once again.
What I did to get a "quick and dirty" trunk.tsv file was to simply edit the .tsv file that was part of the default install, using the Libre Office spreadsheet app. Retains the format of the file, but make sure tab delimiter and csv format are selected when saving. You *might* have to delete the extra extension that could be appended. eg. trunk.tsv.csv -> trunk.tsv. Super simple, and generally idiot-proof.
 
Status
Not open for further replies.
Top