OP25 rx.py to multi_rx.py

Status
Not open for further replies.

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
On my setup I only track one P25 system with a single dongle.
Only broadcast to broadcastify, no need for audio coming out of the device(RBPi 3b+)

I've tried a couple times to make the change from rx to multi_rx but can't get it to work.


This is what I'm running now:
Code:
./rx.py --nocrypt --args "rtl" -N 'LNA:29' -l 'http:0.0.0.0:8080' -S 57600 -q 17 -d -200  -X -T trunk.tsv -V -2 -M meta.json -w 2>stderr.2


My meta.json
Code:
{"icecastPass": "myPass", "icecastMountpoint": "myMountPoint", "icecastServerAddress": "broadcastifyURL", "delay": "0.0", "icecastMountExt": ".m3u"}


I have a trunk.tsv that defines the system, another tsv file with ID and tag names used to send the proper id to broadcastify, and another file with a whitelist of IDs.

How should the cfg.json look like?
And what would the command to run it be? I guess it would be just replace the rx.py and its parameters to multi_rx.py without parameters correct?


Thanks in advance.
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
Forgot to attach my current non-working cfg.json




JSON:
{
    "channels": [
        {
            "device": "",
            "demod_type": "cqpsk",
            "cqpsk_tracking": true,
            "tracking_threshold": 30,
            "tracking_limit": 2400,
            "tracking_feedback": 0.85,
            "destination": "udp://127.0.0.1:56120",
            "excess_bw": 0.2,
            "filter_type": "rc",
            "if_rate": 24000,
            "name": "p25",
            "plot": "",
            "symbol_rate": 4800,
            "raw_output": "",
            "raw_input": "",
            "raw_seek": 0,
            "enable_analog": "off",
            "nbfm_deviation": 4000,
            "nbfm_squelch": -60

        }
    ],
    "devices": [
        {
            "args": "rtl=0",
            "frequency": 460100000,
            "gains": "lna:29",
            "gain_mode": false,
            "name": "device_0",
            "offset": -200,
            "ppm": 17,
            "rate": 1000000,
            "usable_bw_pct": 0.85,
            "tunable": false
        }
    ],
    "trunking": {
        "module": "tk_p25.py",
        "chans": [
            {
                "nac": "0x14",
                "sysname": "Bell",
                "control_channel_list": "857.4625,855.4875,856.4625,856.7375,858.0375,858.4265,858.7375,859.4625,859.7375",
                "whitelist": "bell.wlist",
                "tgid_tags_file": "bell.tsv",
                "crypt_behavior": 1
            }
        ]
    },
    "metadata": {
        "module": "icemeta.py",
        "streams": [
            {
                "stream_name": "Stream name",
                "meta_format_idle": "[idle]",
                "meta_format_tgid": "[%TGID%]",
                "meta_format_tag": "[%TGID%] %TAG%",
                "icecastServerAddress": "broadcastifyAddress:80",
                "icecastMountpoint": "myMountPoing",
                "icecastPass": "myPass",
                "icecastMountExt": ".xspf",
                "delay": 0.0
            }
        ]
    },
    "audio": {
        "module": "sockaudio.py",
        "instances": [
            {
                "instance_name": "audio0",
                "device_name": "default",
                "udp_port": 23456,
                "audio_gain": 1.0,
                "number_channels": 1
            }
        ]
    },
    "terminal": {
        "module": "terminal.py",
        "terminal_type": "curses",
        "#terminal_type": "http:127.0.0.1:8080",
        "terminal_timeout": 5.0,
        "curses_plot_interval": 0.2,
        "http_plot_interval": 1.0,
        "http_plot_directory": "../www/images",
        "tuning_step_large": 1200,
        "tuning_step_small": 100
    }
}
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
Can you also please post the stderr.2 log when you start multi_rx.py

Here it is. Thanks

Code:
Using Python /usr/bin/python
Configuring audio instance #0 [audio0]
using ALSA sound system
audio device: default
Listening on 127.0.0.1:23456
Configuring metadata stream #0 [Police and Fire]: audio3.broadcastify.com:80/
04/02/22 05:02:35.293145 [Bell] Initializing P25 system
04/02/22 05:02:35.293389 [Bell] reading system tgid_tags_file: bell.tsv
04/02/22 05:02:35.304524 [Bell] reading system whitelist file: bell.wlist
04/02/22 05:02:35.304827 [Bell] added talkgroup 50670 from bell.wlist
04/02/22 05:02:35.304955 [Bell] added talkgroup 51158 from bell.wlist
04/02/22 05:02:35.305051 [Bell] added talkgroup 50529 from bell.wlist
04/02/22 05:02:35.305143 [Bell] added talkgroup 50545 from bell.wlist
04/02/22 05:02:35.305226 [Bell] added talkgroup 50561 from bell.wlist
04/02/22 05:02:35.305310 [Bell] added talkgroup 50577 from bell.wlist
04/02/22 05:02:35.305392 [Bell] added talkgroup 50593 from bell.wlist
04/02/22 05:02:35.305474 [Bell] added talkgroup 50595 from bell.wlist
04/02/22 05:02:35.305555 [Bell] added talkgroup 50596 from bell.wlist
04/02/22 05:02:35.305637 [Bell] added talkgroup 50597 from bell.wlist
04/02/22 05:02:35.305718 [Bell] added talkgroup 50598 from bell.wlist
04/02/22 05:02:35.305798 [Bell] added talkgroup 50599 from bell.wlist
04/02/22 05:02:35.305880 [Bell] added talkgroup 50600 from bell.wlist
04/02/22 05:02:35.305961 [Bell] added talkgroup 50601 from bell.wlist
04/02/22 05:02:35.306043 [Bell] added talkgroup 50603 from bell.wlist
04/02/22 05:02:35.306130 [Bell] added talkgroup 50604 from bell.wlist
04/02/22 05:02:35.306212 [Bell] added talkgroup 50605 from bell.wlist
04/02/22 05:02:35.306642 [Bell] added talkgroup 50619 from bell.wlist
04/02/22 05:02:35.306726 [Bell] added talkgroup 50717 from bell.wlist
04/02/22 05:02:35.306821 [Bell] added talkgroup 50428 from bell.wlist
04/02/22 05:02:35.306902 [Bell] added talkgroup 50429 from bell.wlist
04/02/22 05:02:35.306989 [Bell] added talkgroup 50673 from bell.wlist
04/02/22 05:02:35.307070 [Bell] added talkgroup 50674 from bell.wlist
04/02/22 05:02:35.307151 [Bell] added talkgroup 50675 from bell.wlist
04/02/22 05:02:35.307232 [Bell] added talkgroup 50676 from bell.wlist
04/02/22 05:02:35.307313 [Bell] added talkgroup 50677 from bell.wlist
04/02/22 05:02:35.307401 [Bell] added talkgroup 50272 from bell.wlist
04/02/22 05:02:35.307500 [Bell] added talkgroup 50289 from bell.wlist
04/02/22 05:02:35.307583 [Bell] added talkgroup 50301 from bell.wlist
04/02/22 05:02:35.307675 [Bell] added talkgroup 50305 from bell.wlist
04/02/22 05:02:35.307756 [Bell] added talkgroup 50337 from bell.wlist
04/02/22 05:02:35.307837 [Bell] added talkgroup 50350 from bell.wlist
04/02/22 05:02:35.307918 [Bell] added talkgroup 50353 from bell.wlist
04/02/22 05:02:35.307999 [Bell] added talkgroup 50354 from bell.wlist
04/02/22 05:02:35.308080 [Bell] added talkgroup 50357 from bell.wlist
04/02/22 05:02:35.308161 [Bell] added talkgroup 50358 from bell.wlist
04/02/22 05:02:35.308241 [Bell] added talkgroup 50359 from bell.wlist
04/02/22 05:02:35.308322 [Bell] added talkgroup 50360 from bell.wlist
04/02/22 05:02:35.308403 [Bell] added talkgroup 50364 from bell.wlist
04/02/22 05:02:35.308484 [Bell] added talkgroup 50366 from bell.wlist
04/02/22 05:02:35.308565 [Bell] added talkgroup 50369 from bell.wlist
04/02/22 05:02:35.308653 [Bell] added talkgroup 50372 from bell.wlist
04/02/22 05:02:35.308761 [Bell] added talkgroup 50386 from bell.wlist
04/02/22 05:02:35.308846 [Bell] added talkgroup 50449 from bell.wlist
04/02/22 05:02:35.308941 [Bell] added talkgroup 50497 from bell.wlist
04/02/22 05:02:35.309038 [Bell] added talkgroup 50498 from bell.wlist
04/02/22 05:02:35.309129 [Bell] added talkgroup 50499 from bell.wlist
04/02/22 05:02:35.309212 [Bell] added talkgroup 50508 from bell.wlist
04/02/22 05:02:35.309292 [Bell] added talkgroup 51185 from bell.wlist
04/02/22 05:02:35.309373 [Bell] added talkgroup 51058 from bell.wlist
04/02/22 05:02:35.309455 [Bell] added talkgroup 50417 from bell.wlist
Enabled trunking module: tk_p25.py
device: {u'args': u'rtl=0', u'gain_mode': False, u'gains': u'lna:29', u'usable_bw_pct': 0.85, u'ppm': 17, u'rate': 1000000, u'frequency': 460100000, u'tunable': False, u'offset': -200, u'name': u'device_0'}
Device name: "device_0", osmosdr args: "rtl=0"
gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.13.4
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp
Using device #0 Realtek RTL2838UHIDIR2 SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
gr-osmosdr driver gain_mode: False
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
* * * Channel 'p25' not attached to any device - ignoring!
python version detected: 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0]
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
I think you already answered my initial question.
* * * Channel 'p25' not attached to any device - ignoring!

I added the device and trunking system to the channel section. Now it loads and I can see it starts going trough the control channels but can't lock to any. I know I had this problem with rx.py and had to play with the graphs and the -q and -d settings. Which one is equivalent to offset and which one to ppm?

Also noticed, the http server at port 8080 is no longer coming up.
 
Last edited:

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
Spent a couple hours playing with this trying to tune it to no avail. If I switch to rx.py it works without problem.
It seems to be tunned (graph 1 spikes in the center) but it keeps cycling trough the control channels and won't lock up.
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
Don't you need to set your center device frequency to the area of the CC frequencies, or at least set the device tunable to true.
I copied the cfg file from samples and adjusted whatever settings I had on my original rx.py command but therr are a lot more things that I have no idea what they are on that cfg file..

Those you mention for example.

My plan was to get it working and start removing settings one by one to see if they are needed on the file or not..

But I never got it to work.
 

lwvmobile

DSD-FME
Joined
Apr 26, 2020
Messages
1,484
Reaction score
1,025
Going by the example json file you posted, if you just change the device frequency from 460100000 to 857000000 and also change "tunable": false into "tunable": true then you might start having some luck on tuning the control channel.

Usually, not always, but usually [R82XX] PLL not locked! means it can't hit the frequency and lock on to it, and in this case, I think its due to having the device set to 460100000 and your control channel frequencies being in the 857000000 range and that its not allowed to tune with the tunable false parameter set.
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
Going by the example json file you posted, if you just change the device frequency from 460100000 to 857000000 and also change "tunable": false into "tunable": true then you might start having some luck on tuning the control channel.

Usually, not always, but usually [R82XX] PLL not locked! means it can't hit the frequency and lock on to it, and in this case, I think its due to having the device set to 460100000 and your control channel frequencies being in the 857000000 range and that its not allowed to tune with the tunable false parameter set.
Ok got to play a bit more.. the frequency line was removed altogether.. I remember I had to remove it from the rx.py command as I was providing the control channels on a separate file.

I did change the rate setting to 250000 and now it is locking to the system and I can see the traffic and the Tags are being picked up from my file... That's some progress.

Still can't see the web GUI on port 8080.. And although I can see the traffic I can't hear anything.. looks like the connection to broadcastify is not working
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
Begining of stderr file

Code:
Using Python /usr/bin/python
Configuring audio instance #0 [audio0]
using ALSA sound system
audio device: default
Listening on 127.0.0.1:23456
Configuring metadata stream #0 [Bell County Police and Fire]: audio3.broadcastify.com/wjn9cq154zk
04/02/22 11:54:15.596378 [Bell] Initializing P25 system
04/02/22 11:54:15.596617 [Bell] reading system tgid_tags_file: bell.tsv
04/02/22 11:54:15.607868 [Bell] reading system whitelist file: bell.wlist
04/02/22 Enabled trunking module: tk_p25.py
device: {u'args': u'rtl=0', u'gain_mode': False, u'gains': u'lna:29', u'usable_bw_pct': 0.85, u'ppm': 17, u'rate': 250000, u'tunable': True, u'offset': 0, u'name': u'device_0'}
Device name: "device_0", osmosdr args: "rtl=0"
gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.13.4
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp
Using device #0 Realtek RTL2838UHIDIR2 SN: 00000001
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
gr-osmosdr driver gain_mode: False
Exact sample rate is: 250000.000414 Hz
[R82XX] PLL not locked!
channel (dev device_0): {u'raw_seek': 0, u'plot': u'', u'cqpsk_tracking': True, u'nbfm_deviation': 4000, u'nbfm_squelch': -60, u'demod_type': u'cqpsk', u'tracking_feedback': 0.85, u'destination': u'udp://127.0.0.1:56120', u'excess_bw': 0.2, u'trunking_sysname': u'Bell', u'filter_type': u'rc', u'tracking_limit': 2400, u'device': u'device_0', u'symbol_rate': 4800, u'tracking_threshold': 30, u'raw_output': u'', u'if_rate': 24000, u'raw_input': u'', u'enable_analog': u'off', u'name': u'p25'}

Using two-stage decimator for speed=250000, decim=5/2 if1=50000 if2=25000       op25_audio::open_socket(): enabled udp host(127.0.0.1), wireshark(56120), audio(56120)
python version detected: 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0]
Allocating 15 zero-copy buffers


Something that caught my eye
Code:
04/02/22 11:54:19.917457 [0] p25_framer::nid_codeword: NAC check fail: received=feb, expected=014
Flowgraph complete. Exiting
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,712
Reaction score
1,113
Location
Talbot Co, MD
The nac error is probably caused by tuning to/from a voice channel and the disturbance this causes to the demodulator tracking and frame assembly. As long as it is only occasional you can ignore it.

If you want to change your terminal type to http you'll need to edit this section of the cfg.json. Specifically, remove the "#" from the "#terminal_type": "http..." entry and add it to the "terminal_type": "curses" entry instead.
Code:
    "terminal": {
        "module": "terminal.py",
        "terminal_type": "curses",
        "#terminal_type": "http:127.0.0.1:8080",
        "terminal_timeout": 5.0,
        "curses_plot_interval": 0.2,
        "http_plot_interval": 1.0,
        "http_plot_directory": "../www/images",
        "tuning_step_large": 1200,
        "tuning_step_small": 100
    }
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
The nac error is probably caused by tuning to/from a voice channel and the disturbance this causes to the demodulator tracking and frame assembly. As long as it is only occasional you can ignore it.

If you want to change your terminal type to http you'll need to edit this section of the cfg.json. Specifically, remove the "#" from the "#terminal_type": "http..." entry and add it to the "terminal_type": "curses" entry instead.
Code:
    "terminal": {
        "module": "terminal.py",
        "terminal_type": "curses",
        "#terminal_type": "http:127.0.0.1:8080",
        "terminal_timeout": 5.0,
        "curses_plot_interval": 0.2,
        "http_plot_interval": 1.0,
        "http_plot_directory": "../www/images",
        "tuning_step_large": 1200,
        "tuning_step_small": 100
    }
Ahhhh I knew it had to be something with that #. I took it off but also left the curses line. Now it's working.

Only thing left to sort out is the broadcastify issue. Any idea on that?

Also, I don't use the device audio for anything.. so if disabling it somehow helps with CPU/memory... Is that a thing?

The only audio output for this device should be what is what's sent to broadcastify.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,712
Reaction score
1,113
Location
Talbot Co, MD
Ahhhh I knew it had to be something with that #. I took it off but also left the curses line. Now it's working.

Only thing left to sort out is the broadcastify issue. Any idea on that?

Also, I don't use the device audio for anything.. so if disabling it somehow helps with CPU/memory... Is that a thing?

The only audio output for this device should be what is what's sent to broadcastify.

Sure!
Disabling the local audio is a prerequisite for Liquidsoap anyway, so go ahead and remove the audio instance name "audio0" and make it "". This will disable the local audio player and alllow a liquidsoap instance to connect to the same port (23456). You'll have to set that up in a .liq file, probably identical to how you had it running with rx.py.
Code:
    "audio": {
        "module": "sockaudio.py",
        "instances": [
            {
                "instance_name": "",
                "device_name": "default",
                "udp_port": 23456,
                "audio_gain": 1.0,
                "number_channels": 1
            }
        ]
    },
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
That didn't seem to work.. probably something missing.

I can start the liq and leave it running.
If I the start Rx in a couple seconds the feed comes online ... If I then stop Rx and start mukti_rx I can see the activity in the terminal but nothing is being heard.

I didn't change anything on the liq file. Do I have to specify something else on the cfg?
 

wgbecks

Active Member
Joined
Jan 17, 2005
Messages
1,206
Reaction score
462
Location
NE Wisconsin
JAAS666,

I would be willing to help you remotely. If you like some help, send me a PM with your contact information and I will respond to that we can initiate dialog to arrange to work offline.

Bill
 

JAAS666

Member
Premium Subscriber
Joined
Nov 5, 2012
Messages
30
Reaction score
3
Location
Killeen, TX
JAAS666,

I would be willing to help you remotely. If you like some help, send me a PM with your contact information and I will respond to that we can initiate dialog to arrange to work offline.

Bill
Thanks. Message sent
 
Status
Not open for further replies.
Top