OP25 OP 25 multi_rx.py help

Status
Not open for further replies.
Joined
Sep 15, 2010
Messages
41
Well, I've got that working as well...

Basically all one has to do is structure the rx.py arguments properly and that's all folks!

What I did was create a variant of the op25.sh (op251, 252, 253, etc..) to suit each channel need and then I run them in separate shells.

The command with args looks like this for me..

Code:
./rx.py --nocrypt --args "rtl=2" --gains 'lna:36' -S 960000 -X -q -0 -v 1 -2 -V -U -w -W 127.0.0.1 -u 23476 -g 0.8 -T trunk5.tsv -l http:0.0.0.0:8085 2> stderr.2

Important the you change the rtl, -u [port] and -l host port values it would seem.. Now I've got the best of both worlds!! ;)

I do have another question as it pertains to audio though.. Is there a way to assign a name to the audio channel that is created? Currently, each new audio channel has "ALSA Playback" assigned to it, making it confusing which one is which..

I was looking within the rx.py script and I can see where the audio structuring takes place but it is not clear to me how the name property is set. I'm assuming this is because the name property is not set here?

Any guidance would be greatly appreciated.

Houston, we have a problem...

I think I may be taking the wrong approach here... So now I'm running 4 separate instances of rx.py instead of multi_rx.py.. I am doing this because of the tuning.. It just seems to work better. (I'll need to explore multi_rx.py again if someone can help me out with the tuning.) Anyhow, long story short, the cool pactl stuff I can do with multi_rx.py I am not able to do with rx.py.. It seems like every time the transmission ends, the pcm stream is also ended and therefor there is a new sink index for every transmission.. This is less than ideal from my perspective because I can no longer bind a null-sink to an index (since they change with every Rx)... I am trying to figure out how to do it with the media.name of the object or even the client id but I am not sure I can even do that.. As I said, I may be taking the wrong approach here...

What I ultimately need is an audio stream within the ALSA that I can pick up as an input as opposed to a playback.. (I think).. The idea is to have 4 separate (recording sources or output devices) within ALSA that I can pick up elsewhere as a source... By elsewhere I mean within the same PC but in an app that will recognize the source...

The audio must always be sent to the same place in order for me to use it.. I have no idea how to do this.. I've been at it so long that I'm starting to think it's probably best if I take a different approach.. I just have no idea what approach that should be. Please keep in mind that my first real exposure to any flavor of linux was about a week ago when I decided that Windows and DSDPlus Fastlane just weren't going to make the cut for me.

Thanks in advance!
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,540
Location
Talbot Co, MD
While you certainly can run multiple instances of rx.py, running one instance of multi_rx.py is easier to manage from a single terminal and does have some cpu utilization benefits if the channels are all derived from a single P25 system. That said, the boatbod multi_rx does not presently support the autotune mechanism found in rx.py. It might not be so hard to add, but I've also not seen it make a particularly significant improvement when running with TXCO dongles.
 
Joined
Sep 15, 2010
Messages
41
While you certainly can run multiple instances of rx.py, running one instance of multi_rx.py is easier to manage from a single terminal and does have some cpu utilization benefits if the channels are all derived from a single P25 system. That said, the boatbod multi_rx does not presently support the autotune mechanism found in rx.py. It might not be so hard to add, but I've also not seen it make a particularly significant improvement when running with TXCO dongles.
So then maybe I should focus on running multi_rx.py which I know I can get to work but I need to focus my attention on manual tuning.. I am not sure that I completely understand how to properly tune these receivers... Maybe you can point me in the right direction? Also, they seem to be tuned fine for a while and then one or two will lose signal.. It's easy enough to get them back in line but you can see how this isn't good..

I have these connected to a single USB 3.0 ss port on a hub that is being supplied with external 5VDC/4amp power. I also have 120mm DC (powered by another external source) fan blowing across all 4 rtl_sdr's to keep them from getting hot enough to fry eggs..

I'm positive that my problem is my own lack of knowledge with tuning..
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,540
Location
Talbot Co, MD
I've just pushed an update to multi_rx that adds the automatic tuning for CQPSK demod types. Right now it's not going to show the freq error value in the terminal but it does seem to work pretty well on my test systems. Tracking appears to maintain the freq error estimate less than 10hz. Update interval is once per second, so it can take 10+ seconds to fully stabilize.

You can see per-channel tracking in action if you enable -v 11 logging and search for "tracking" in the stderr.2 log, or alternatively watch the datascope plot re-center itself as you make tweaks to manual fine tuning.
 

NebraskaCoder

Member
Joined
Oct 26, 2016
Messages
325
Location
Omaha, NE
I've just pushed an update to multi_rx that adds the automatic tuning for CQPSK demod types. Right now it's not going to show the freq error value in the terminal but it does seem to work pretty well on my test systems. Tracking appears to maintain the freq error estimate less than 10hz. Update interval is once per second, so it can take 10+ seconds to fully stabilize.

You can see per-channel tracking in action if you enable -v 11 logging and search for "tracking" in the stderr.2 log, or alternatively watch the datascope plot re-center itself as you make tweaks to manual fine tuning.
What is the best way to disable it in a config file?
 

MTL_Emergencies

Member++
Database Admin
Joined
Sep 6, 2019
Messages
164
Location
Quebec, Canada
I'm trying to run multi_rx.py but am getting this message in the stderr file:
Code:
Using Python /usr/bin/python2
Traceback (most recent call last):
  File "./multi_rx.py", line 1040, in <module>
    rx = rx_main()
  File "./multi_rx.py", line 1004, in __init__
    config = json.loads(open(options.config_file).read())
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

My .json file contains the following code:
Code:
{
    "channels": [
        {
            "name": "SERAM Public Safety",
            "device": "sdr0",
            "trunking_sysname": "SERAM",
            "meta_stream_name": "metastream_0",
            "demod_type": "cqpsk",
            "cqpsk_tracking": true,
            "tracking_threshold": 30,
            "tracking_feedback": 0.85,
            "destination": "udp://127.0.0.1:23456",
            "excess_bw": 0.2,
            "filter_type": "rc",
            "frequency": 770506250,
            "if_rate": 24000,
            "plot": "",
            "symbol_rate": 4800,
            "enable_analog": "off",
            "blacklist": "",
            "whitelist": "seram.wlist"
        },
    ],
    "devices": [
        {
            "args": "rtl=0",
            "gains": "LNA:248",
            "gain_mode": false,
            "name": "sdr0",
            "offset": 0,
            "ppm": 0.0,
            "rate": 2400000,
            "usable_bw_pct": 0.85,
            "tunable": true
        },
    ],
    "trunking": {
        "module": "tk_p25.py",
        "chans": [
            {
                "nac": "0xcf1",
                "sysname": "SERAM",
                "control_channel_list": "770.50625",
                "whitelist": "50001, 50002, 50003, 50004, 50005",
                "blacklist": "",
                "tgid_tags_file": "montreal.tsv",
                "rid_tags_file": "rid-mtl.tsv",
                "tdma_cc": false,
                "crypt_behavior": 2
            }
        ]
    },
    "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",
        "curses_plot_interval": 0.1,
        "http_plot_interval": 1.0,
        "http_plot_directory": "../www/images",
        "tuning_step_large": 1200,
        "tuning_step_small": 100
    }
}

As you can see, I'm trying to run a single P25 system for personal use (not streaming).
I am running OP25 to the latest version.

I think the error might be the seram.wlist file as I'm not sure what to include in it (I just included the talkgroups I want to listen to, each separated by an endline).
 

MTL_Emergencies

Member++
Database Admin
Joined
Sep 6, 2019
Messages
164
Location
Quebec, Canada
I just removed it as you told me but am still getting the error...
Code:
Using Python /usr/bin/python2
Traceback (most recent call last):
  File "./multi_rx.py", line 1040, in <module>
    rx = rx_main()
  File "./multi_rx.py", line 1004, in __init__
    config = json.loads(open(options.config_file).read())
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
It says "No JSON object could be decoded". I wonder what means.
 

boatbod

Member
Joined
Mar 3, 2007
Messages
3,540
Location
Talbot Co, MD
I just removed it as you told me but am still getting the error...
Code:
Using Python /usr/bin/python2
Traceback (most recent call last):
  File "./multi_rx.py", line 1040, in <module>
    rx = rx_main()
  File "./multi_rx.py", line 1004, in __init__
    config = json.loads(open(options.config_file).read())
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
It says "No JSON object could be decoded". I wonder what means.
It means your .json file is improperly formatted.

The way I check .json format is to open it in a json-aware editor such as gvim and the problem just pops up in red.
 

MTL_Emergencies

Member++
Database Admin
Joined
Sep 6, 2019
Messages
164
Location
Quebec, Canada
The other issue I'm having is that I'm not able to connect to the web interface from another device:
With rx.py I was able to view OP25's web interface (running on a RPi 3B+) on a laptop by just typing the Pi's ip adress and :8080 on a web browser.

Is there a way to have access to that when running multi_rx.py?

I tried looking into terminal.py but didn't find anything that could help me do that.
 
Joined
Sep 15, 2010
Messages
41
The other issue I'm having is that I'm not able to connect to the web interface from another device:
With rx.py I was able to view OP25's web interface (running on a RPi 3B+) on a laptop by just typing the Pi's ip adress and :8080 on a web browser.

Is there a way to have access to that when running multi_rx.py?

I tried looking into terminal.py but didn't find anything that could help me do that.
Try changing the terminal type from
Code:
"#terminal_type": "http:127.0.0.1:8080",

to
Code:
"#terminal_type": "http:0.0.0.0:8080",

I believe that this will allow any IP address to connect to the IP address of your Pi on that port...

using 127.0.0.1 only allows a connection from the localhost
 

NebraskaCoder

Member
Joined
Oct 26, 2016
Messages
325
Location
Omaha, NE
Try changing the terminal type from
Code:
"#terminal_type": "http:127.0.0.1:8080",

to
Code:
"#terminal_type": "http:0.0.0.0:8080",

...

To anybody referencing this in the future, make sure there isn't a # in there as that turns the statement into a comment. Make sure if you have another terminal_type (such as curses) that the # is there instead.
 

DP1947

Member
Premium Subscriber
Joined
Sep 29, 2005
Messages
22
Location
Indiana
OK, I have another question. I'm using multi-rx and two sdr's to stream two systems. All is working fine. My liquidsoap service is putting one on the left channel, the other on the right. I'm very happy!
However, I do not see the control channel or talk group on the terminal port for the second system. I believe I can set that up in rx-py with the -l option, but not in multi's json.
Any help or clarification is appreciated!
 
Status
Not open for further replies.
Top