From 97cb51d990b4929211ffe5463e25c117cf81f418 Mon Sep 17 00:00:00 2001 From: Andrea Montefusco Date: Sun, 15 Mar 2020 17:24:36 +0100 Subject: [PATCH] Perseus SDR HF receiver first support --- config_webrx.py | 53 ++++++++++++++++++++++++++++++++++++++- owrx/feature.py | 21 ++++++++++++++++ owrx/source/perseussdr.py | 31 +++++++++++++++++++++++ 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 owrx/source/perseussdr.py diff --git a/config_webrx.py b/config_webrx.py index a568481..5ef9866 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -99,7 +99,7 @@ Note: if you experience audio underruns while CPU usage is 100%, you can: ################################################################################################# # Currently supported types of sdr receivers: -# "rtl_sdr", "sdrplay", "hackrf", "airspy", "airspyhf", "fifi_sdr" +# "rtl_sdr", "sdrplay", "hackrf", "airspy", "airspyhf", "fifi_sdr", "perseussdr" # # In order to use rtl_sdr, you will need to install librtlsdr-dev and the connector. # In order to use sdrplay, airspy or airspyhf, you will need to install soapysdr, the corresponding driver, and the @@ -107,6 +107,10 @@ Note: if you experience audio underruns while CPU usage is 100%, you can: # # https://github.com/jketterl/owrx_connector # +# In order to use Perseus HF you need to install the libperseus-sdr +# +# https://github.com/Microtelecom/libperseus-sdr +# # NOTE: The connector sources have replaced the old piped nmux style of reading input. If you still have any sdrs # configured that have type endin in "_connector", simply remove that suffix. @@ -137,6 +141,53 @@ sdrs = { }, }, }, + "perseussdr": { + "name": "Microtelecom Perseus HF receiver", + "type": "perseussdr", + "ppm": 0, + "profiles": { + "40m": { + "name": "40m", + "center_freq": 7150000, + "rf_gain": 0, + "samp_rate": 500000, + "start_freq": 7050000, + "start_mod": "lsb", + }, + "20m": { + "name": "20m", + "center_freq": 14150000, + "rf_gain": 0, + "samp_rate": 500000, + "start_freq": 14070000, + "start_mod": "usb", + }, + "30m": { + "name": "30m", + "center_freq": 10125000, + "rf_gain": 0, + "samp_rate": 192000, + "start_freq": 10142000, + "start_mod": "usb", + }, + "80m": { + "name": "80m", + "center_freq": 3650000, + "rf_gain": 0, + "samp_rate": 500000, + "start_freq": 3570000, + "start_mod": "usb", + }, + "49m": { + "name": "49m Broadcast", + "center_freq": 6000000, + "rf_gain": 0, + "samp_rate": 500000, + "start_freq": 6070000, + "start_mod": "am", + }, + }, + }, "airspy": { "name": "Airspy HF+", "type": "airspyhf", diff --git a/owrx/feature.py b/owrx/feature.py index 7e7bf9c..e18aae9 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -25,6 +25,7 @@ class FeatureDetector(object): "rtl_sdr_soapy": ["soapy_connector", "soapy_rtl_sdr"], "sdrplay": ["soapy_connector", "soapy_sdrplay"], "hackrf": ["hackrf_transfer"], + "perseussdr": ["perseustest"], "airspy": ["soapy_connector", "soapy_airspy"], "airspyhf": ["soapy_connector", "soapy_airspyhf"], "lime_sdr": ["soapy_connector", "soapy_lime_sdr"], @@ -150,6 +151,26 @@ class FeatureDetector(object): # TODO also check if it has the stdout feature return self.command_is_runnable("hackrf_transfer --help") + def has_perseustest(self): + """ + To use a Microtelecom Perseus HF receiver, compile and + install the libperseus-sdr: + ``` + sudo apt install libusb-1.0-0-dev + cd /tmp + wget https://github.com/Microtelecom/libperseus-sdr/releases/download/v0.7.5/libperseus_sdr-0.7.5.tar.gz + tar -zxvf libperseus_sdr-0.7.5.tar.gz + cd libperseus_sdr-0.7.5/ + ./configure + make + sudo make install + sudo ldconfig + perseustest + ``` + """ + return self.command_is_runnable("perseustest -d -1 -a -t 1") + + def has_digiham(self): """ To use digital voice modes, the digiham package is required. You can find the package and installation diff --git a/owrx/source/perseussdr.py b/owrx/source/perseussdr.py new file mode 100644 index 0000000..29c382a --- /dev/null +++ b/owrx/source/perseussdr.py @@ -0,0 +1,31 @@ +from .direct import DirectSource +from owrx.command import Flag, Option + + +# +# perseustest -s 768000 -u 0 -f 14150000 -r-|csdr convert_s8_f|nmux --bufsize 192512 --bufcnt 260 --port 35989 --address 127.0.0.1 +# perseustest -a -t0 -o - +# perseustest -d 9 -a -t 100000 -o - -s 768000 -u 0 -f 14150000 -r- + +class PerseussdrSource(DirectSource): + def getCommandMapper(self): + return super().getCommandMapper().setBase("perseustest -p -d -1 -a -t 100000 -o - ").setMappings( + { + "samp_rate": Option("-s"), + "tuner_freq": Option("-f"), + "rf_gain": Option("-u"), + "lna_gain": Option("-g"), + "rf_amp": Option("-x"), + } + ).setStatic("-r-") + + def getEventNames(self): + return super().getEventNames() + [ + "lna_gain", + "rf_amp", + ] + + def getFormatConversion(self): +# return ["csdr convert_s24_f --bigendian"] +# return ["csdr convert_s24_f", "csdr gain_ff 20"] + return ["csdr gain_ff 20"]