OP25 Export Talkgroups Using OP25

Status
Not open for further replies.

LateNightGaming

Member
Premium Subscriber
Joined
Feb 7, 2021
Messages
50
Hey all, I was wondering if there was a way I could export the talkgroups that OP25 receives into another python file so I can use them for a project. Is this at all possible? I know I would have to import a file but dont know which one to use.
Thanks Guys
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,339
Location
Talbot Co, MD
Hey all, I was wondering if there was a way I could export the talkgroups that OP25 receives into another python file so I can use them for a project. Is this at all possible? I know I would have to import a file but dont know which one to use.
Thanks Guys
The easiest way would be to run at log level "-v 1" and parse the "voice update:" log messages.
 

LateNightGaming

Member
Premium Subscriber
Joined
Feb 7, 2021
Messages
50
The easiest way would be to run at log level "-v 1" and parse the "voice update:" log messages.
Would I need to run OP25 by calling it from another file for that to work or can I just call it from adding some code into rx.py
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,339
Location
Talbot Co, MD
Run op25 normally, redirecting stderr to a file (stderr.2) in the usual manner.
In a separate terminal, tail the stderr.2 file and pipe it to your python program. In the example below, everything except the numeric tgid is stripped before being passed to 'your_python_script.py'
Code:
tail -f stderr.2 | grep "tg(" | awk '{FS=" "} {print $6}' | sed 's/[^0-9]*//g' | your_python_script.py
 

LateNightGaming

Member
Premium Subscriber
Joined
Feb 7, 2021
Messages
50
Run op25 normally, redirecting stderr to a file (stderr.2) in the usual manner.
In a separate terminal, tail the stderr.2 file and pipe it to your python program. In the example below, everything except the numeric tgid is stripped before being passed to 'your_python_script.py'
Code:
tail -f stderr.2 | grep "tg(" | awk '{FS=" "} {print $6}' | sed 's/[^0-9]*//g' | your_python_script.py
I ended up using popen and if line contains to get it. Thanks for the help as always
 
Status
Not open for further replies.
Top