Max d1ee843822 python: drop gru from import 2022-05-19 20:21:21 -04:00
corr Initial check-in. 2013-12-10 01:47:21 +01:00
oplog oplog update 2021-08-29 19:13:33 -04:00
tdma python: drop gru from import 2022-05-19 20:21:21 -04:00
tx python: drop gru from import 2022-05-19 20:21:21 -04:00
util python: drop gru from import 2022-05-19 20:21:21 -04:00
900.tsv udp configs: fix discrepancy 2021-12-10 19:08:14 -05:00
CMakeLists.txt Initial check-in. 2013-12-10 01:47:21 +01:00
README talkgroup goto: thx Triptolemus 2020-12-06 18:48:10 -05:00
README-July-2021 README-July-2021 updates 2021-08-01 17:10:40 -04:00
README-example-udp udp rx/tx linkage docs/examples 2020-12-25 15:27:48 -05:00
README-hls add hostname info to README-hls 2021-02-14 18:29:59 -05:00
alt-colors.json set default plot dark colors 2021-02-14 11:59:03 -05:00
audio.py hls hacks 2020-12-25 15:34:25 -05:00
cfg-900.json udp rx/tx linkage docs/examples 2020-12-25 15:27:48 -05:00
cfg-trunk.json cfg-trunk and cfg-trunk2 2021-10-01 14:19:03 -04:00
cfg-trunk2.json cfg-trunk and cfg-trunk2 2021-10-01 14:19:03 -04:00
cfg-trunkx.json core rc2-final 2021-07-25 20:46:14 -04:00
cfg-udp.json udp transport option for tx/rx 2020-08-02 15:29:47 -04:00
cfg.json December 25 2018 merge 2018-12-25 21:10:06 -05:00
color-map.json core rc2-final 2021-07-25 20:46:14 -04:00
correlation.json fix dmr correlation 2020-07-18 19:33:11 -04:00
create_image.py hls hacks 2020-12-25 15:34:25 -05:00
emap.py core rc2-final 2021-07-25 20:46:14 -04:00
example_liquidsoap.liq liquidsoap thx boatbod 2020-08-05 21:47:49 -04:00
ffmpeg.liq hls hacks 2020-12-25 15:34:25 -05:00
ffmpeg.sh hls hacks 2020-12-25 15:34:25 -05:00
gr_gnuplot.py python: drop gru from import 2022-05-19 20:21:21 -04:00
http_server.py http_server bugfixes 2021-09-21 17:31:48 -04:00
install-sql.sh install-sql.sh possible bugfix 2021-07-27 17:13:22 -04:00
log_ts.py add log_ts.py 2020-08-06 20:43:00 -04:00
multi_rx.py python: drop gru from import 2022-05-19 20:21:21 -04:00
nxdn_trunking.py add additional L3 message types 2020-07-22 18:10:31 -04:00
nyseg.tsv trunking release 1 2014-01-02 20:31:26 -05:00
onondaga.tsv trunking release 1 2014-01-02 20:31:26 -05:00
ontario.tsv trunking release 1 2014-01-02 20:31:26 -05:00
op25-liq.service liquidsoap thx boatbod 2020-08-05 21:47:49 -04:00
op25.liq liquidsoap thx boatbod 2020-08-05 21:47:49 -04:00
p25_decoder.py python: drop gru from import 2022-05-19 20:21:21 -04:00
p25_demodulator.py python: drop gru from import 2022-05-19 20:21:21 -04:00
plot-colors.json increase plot color intensity 2021-02-14 12:01:56 -05:00
runudp.sh udp rx/tx linkage docs/examples 2020-12-25 15:27:48 -05:00
rx.py python: drop gru from import 2022-05-19 20:21:21 -04:00
scope.py scope.py message update 2017-10-18 19:11:53 -04:00
site-alias.json core rc2-final 2021-07-25 20:46:14 -04:00
sockaudio.py python3 strikes again 2021-07-28 15:15:18 -04:00
sql_dbi.py core rc2-final 2021-07-25 20:46:14 -04:00
terminal.py terminal.py KeyError crash / fix 2021-12-07 20:40:27 -05:00
tompkins.tsv trunking release 1 2014-01-02 20:31:26 -05:00
trunk.tsv core rc2-final 2021-07-25 20:46:14 -04:00
trunking.py fix mbt00, add new AUTH_DMD mbt op 2022-01-06 17:40:43 -05:00
tsvfile.py core rc2-final 2021-07-25 20:46:14 -04:00
ui-settings.json core rc2-final 2021-07-25 20:46:14 -04:00


April, 2017

This file contains notes on the new version OP25 receiver (rx.py) which 
replaces the prior version scope.py.  The primary differences are:
 * The dependency on WX is completely removed.  By default OP25 runs in
   a console window in text-only mode.
 * An optional real-time plot can be selected when launching rx.py:
   contellation, datascope (eye pattern), or symbol trace.
 * cqpsk versus fsk4 mode is now selected as a command line parameter.
 * most rx.py command-line parameters are compatible with scope.py.
 * reduced CPU consumption, as the frame assembler block now runs as a
   sink-only GR block.
 * dependency on 14.04 is completely removed.  Should now run in later
   ubuntu and fedora versions with only minor changes (not yet tested).

sudo apt-get install gnuplot-x11

./rx.py  --args 'rtl' --gains 'lna:49' -f 456.7e6 -T tsys.tsv -q -1  -S 1000000 -P symbol -o 50000 -w 2> stderr.2

Running stderr to a file (e.g., "2> stderr.2") is recommended to avoid 
screen misprinting.

NOTE: For phase1 voice the "-V" option is not used.  Instead the 
"-w" option is used (see AUDIO SERVER section, below).  For P25 phase 2/TDMA,
the "-2" option is required in addition to the "-w" option.

After starting rx.py if plotting is in use a separate gnuplot window
should open.  You must click on the terminal window to restore it to
focus, otherwise all keystrokes are consumed by gnuplot.  Once in the
terminal window there are several keyboard commands:
 h - hold
 H - hold/goto the specified tgid
 l - lockout
 s - skip
 q - quit program
There are also two experimental commands (should not be used in -T mode)
 f - manually change frequencies
 t - if currently tuned to a CC, autostart scanning talkgroups
The "t" command allows trunk tracking without setting up a trunking TSV
file.  However running with the -T <filename> command line option is
preferred as that allows use of white/black lists and talkgroup tags files.

If the terminal window freezes there may have been a crash.  Press Ctrl-Z
to suspend the program and examine stderr.2 for error messages.  If there
is a traceback please report the full traceback (and the command line) to
the mail list.

Adding (for example) "-l 56111" to the rx.py command starts rx.py but does
not attach a curses terminal.  Instead the program runs as normal in the
foreground (hit CTRL-C to end rx.py as desired).  To connect to a running 
instance of rx.py, (in this example)
    ./terminal.py 56111
NOTE: rx.py and terminal.py need not run on the same machine.  The machine
where terminal.py is running need not have an SDR device directly attached;
but GNU Radio (and OP25) must be available.

WARNING: there is no security or encryption on the UDP port.

Starting rx.py with the "-w -W host" options directs udp audio data to
be sent over the network to the specified remote host.  It can then be
received and played back with either of the following methods:
1. Execute ./audio.sh on a remote machine equipped with python2.7,
   libasound.so.2 and the sockaudio.py file. 
2. Execute the command:
   nc -kluvw 1 23456 | aplay -c1 -f S16_LE -r 8000

NOTE: audio underruns are to be expected when using nc | aplay as the
pcm stream is interrupted every time a radio transmission ends.  The
sockaudio player is designed to handle this more gracefully, and generally
only underruns due to high cpu utilization or reception/decoding errors.

Starting rx.py with the "-U" command line option enables an internal udp
audio server which will play received audio through the default ALSA
device.  Optionally you may specify which ALSA device to use by setting
the "-O audio_out" option along with "-U".

As of this writing (Aug 2017) it is still necessary to specify the "-w"
(wireshark) option if using either the internal or external audio server.

Three types of plotting are currently implemented, via the -P parameter:
 * constellation
 * datascope
 * symbol
The symbol mode is allowed both in fsk4 and cqpsk modes.  The datascope
mode works only with fsk4 demod mode (-D fsk4).  The constellation mode
only works when the cqpsk demod mode is selected (or defaulted).

A couple of notes specific to plot mode:

1. At program startup time the gnuplot window is given the focus after
it opens.  Before you can enter terminal commands you need to click on
the terminal window once to make it the active window.

2. In some cases the gnuplot window is displayed on top of the terminal
window used by OP25.  If so it may be necessary to move one or the other
of the two windows.

Usage: rx.py [options]

  -h, --help            show this help message and exit
  --args=ARGS           device args
  --antenna=ANTENNA     select antenna
  -a, --audio           use direct audio input
  -A, --audio-if        soundcard IF mode (use --calibration to set IF freq)
  -I AUDIO_INPUT, --audio-input=AUDIO_INPUT
                        pcm input device name.  E.g., hw:0,0 or /dev/dsp
  -i INPUT, --input=INPUT
                        input file name
  -b Hz, --excess-bw=Hz
                        for RRC filter
  -c Hz, --calibration=Hz
                        USRP offset or audio IF frequency
  -C Hz, --costas-alpha=Hz
                        value of alpha for Costas loop
  -D DEMOD_TYPE, --demod-type=DEMOD_TYPE
                        cqpsk | fsk4
  -P PLOT_MODE, --plot-mode=PLOT_MODE
                        constellation | symbol | datascope
  -f Hz, --frequency=Hz
                        USRP center frequency
  -F IFILE, --ifile=IFILE
                        read input from complex capture file
  -H HAMLIB_MODEL, --hamlib-model=HAMLIB_MODEL
                        specify model for hamlib
  -s SEEK, --seek=SEEK  ifile seek in K
  -l TERMINAL_TYPE, --terminal-type=TERMINAL_TYPE
                        'curses' or udp port or 'http:host:port'
                        number of demodulators to instantiate
  -S SAMPLE_RATE, --sample-rate=SAMPLE_RATE
                        source samp rate
  -t, --tone-detect     use experimental tone detect algorithm
  -T TRUNK_CONF_FILE, --trunk-conf-file=TRUNK_CONF_FILE
                        trunking config file name
  -v VERBOSITY, --verbosity=VERBOSITY
                        message debug level
  -V, --vocoder         voice codec
  -o Hz, --offset=Hz    tuning offset frequency [to circumvent DC offset]
  -p, --pause           block on startup
  -w, --wireshark       output data to Wireshark
                        Wireshark host
  -r RAW_SYMBOLS, --raw-symbols=RAW_SYMBOLS
                        dump decoded symbols to file
  -R RX_SUBDEV_SPEC, --rx-subdev-spec=RX_SUBDEV_SPEC
                        select USRP Rx side A or B (default=A)
  -g GAIN, --gain=GAIN  set USRP gain in dB (default is midpoint) or set audio
  -G GAIN_MU, --gain-mu=GAIN_MU
                        gardner gain
  -N GAINS, --gains=GAINS
                        gain settings
  -O AUDIO_OUTPUT, --audio-output=AUDIO_OUTPUT
                        audio output device name
  -q FREQ_CORR, --freq-corr=FREQ_CORR
                        frequency correction
  -2, --phase2-tdma     enable phase2 tdma decode
  -Z DECIM_AMT, --decim-amt=DECIM_AMT
                        spectrum decimation

New as of Jan. 2018, the OP25 dashboard is accessible to any Web browser over
HTTP.  Include the option "-l http:<host>:<port>" when starting the rx.py app,
where <host> is either "" to limit access from only this host, or
"" if HTTP access from anywhere is to be allowed*.  After rx.py has
started it begins listening on the specified port for incoming connections.

Once connected the status page should automatically update to show trunking
system status, frequency list, adjacent sites, and other data.

Example:  you have started rx.py with the option "-l http:".
To connect, set your web browser URL to "".

If one or more plot modes has been selected using the "-P" option you may
view them by clicking the "PLOT" button.  The plots are updated approx.
every five seconds.  Click "STATUS" to return to the main status page.

*WARNING*: there is no security or encryption.  Be careful when using ""
as the listening address since anyone with access to the network can connect.

NOTE: the python-pyramid package is required when using this option.   It can
be installed by running
     sudo apt-get install python-pyramid

The multi_rx.py app allows an arbitrary number of SDR devices and channels
to be defined.  Each channel may have one or more plot windows attached.

Configuration is achieved via a json file (see cfg.json for an example).
In this version, channels are automatically assigned to the first device
found whose frequency span includes the selected frequency.

As of this writing (winter, 2017), neither trunking nor P25 P2/TDMA are
supported in multi_rx.py.  The rx.py app should be used for P25 trunking,
for either P1/FDMA or P2/TDMA.

Below is a summary of the major config file keys:
demod_type:     'cqpsk' for qpsk p25 only; 'fsk4' for ysf/dstar/dmr/fsk4 p25
filter_type:    'rc' for p25; 'rrc' for dmr and ysf; 'gmsk' for d-star
plot:           'fft', 'constellation', 'datascope', 'symbol'
                [if more than one plot desired, provide a comma-separated list]
destination:    'udp://host:port' or 'file://<filename>'
name:           arbitrary string used to identify channels and devices

bug: 'fft' and 'constellation' currently mutually exclusive
bug: 'gmsk' needs work

Note: DMR audio for the second time slot is sent on the specified port number
plus two.  In the example 'udp://', audio for the first slot
would use 56122; and 56124 for the second.

The command line options for multi_rx:
Usage: multi_rx.py [options]

  -h, --help            show this help message and exit
  -c CONFIG_FILE, --config-file=CONFIG_FILE
                        specify config file name
  -v VERBOSITY, --verbosity=VERBOSITY
                        message debug level
  -p, --pause           block on startup