From c85400063c517b621c467d217e81e35285c3d5ee Mon Sep 17 00:00:00 2001 From: Jim Ancona Date: Mon, 2 Nov 2020 07:11:54 -0500 Subject: [PATCH 1/4] Initial HPSDR radio support --- owrx/feature.py | 8 ++++++++ owrx/source/hpsdr.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 owrx/source/hpsdr.py diff --git a/owrx/feature.py b/owrx/feature.py index c3d7259..c81d8c7 100644 --- a/owrx/feature.py +++ b/owrx/feature.py @@ -68,6 +68,7 @@ class FeatureDetector(object): "red_pitaya": ["soapy_connector", "soapy_red_pitaya"], "radioberry": ["soapy_connector", "soapy_radioberry"], "fcdpp": ["soapy_connector", "soapy_fcdpp"], + "hpsdr": ["hpsdr_connector"], # optional features and their requirements "digital_voice_digiham": ["digiham", "sox"], "digital_voice_dsd": ["dsd", "sox", "digiham"], @@ -492,3 +493,10 @@ class FeatureDetector(object): [OpenWebRX wiki](https://github.com/jketterl/openwebrx/wiki/DRM-demodulator-notes). """ return self.command_is_runnable("dream --help", 0) + + def has_hpsdr_connector(self): + """ + In order to use the HPSDR connector, you will need to install [hpsdrconnector] + (https://github.com/jancona/hpsdrconnector). + """ + return self.command_is_runnable("hpsdrconnector -h") diff --git a/owrx/source/hpsdr.py b/owrx/source/hpsdr.py new file mode 100644 index 0000000..f97cc6b --- /dev/null +++ b/owrx/source/hpsdr.py @@ -0,0 +1,31 @@ +from .direct import DirectSource +from owrx.command import Flag, Option + +# In order to use an HPSDR radio, you must install hpsdrconnector from https://github.com/jancona/hpsdrconnector +# These are the command line options available: +# --frequency uint +# Tune to specified frequency in Hz (default 7100000) +# --gain uint +# LNA gain between 0 (-12dB) and 60 (48dB) (default 20) +# --radio string +# IP address of radio (default use first radio discovered) +# --samplerate uint +# Use the specified samplerate: one of 48000, 96000, 192000, 384000 (default 96000) +# +# If you omit `remote` from config_webrx.py, hpsdrconnector will use the HPSDR discovery protocol +# to find radios on your local network and will connect to the first radio it discovered. + +class HpsdrSource(DirectSource): + def getCommandMapper(self): + return super().getCommandMapper().setBase("hpsdrconnector").setMappings( + { + "tuner_freq": Option("--frequency"), + "samp_rate": Option("--samplerate"), + "remote": Option("--radio"), + "rf_gain": Option("--gain"), + } + ) + + def getFormatConversion(self): + return ["csdr convert_s24_f"] + From 91572c56e22df8b8ebd717a3efe4ae5f9714d0cd Mon Sep 17 00:00:00 2001 From: Jim Ancona Date: Mon, 9 Nov 2020 19:19:34 -0500 Subject: [PATCH 2/4] Make hpsdrconnector into a true connector. --- owrx/source/hpsdr.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/owrx/source/hpsdr.py b/owrx/source/hpsdr.py index f97cc6b..383a1db 100644 --- a/owrx/source/hpsdr.py +++ b/owrx/source/hpsdr.py @@ -1,4 +1,4 @@ -from .direct import DirectSource +from .connector import ConnectorSource from owrx.command import Flag, Option # In order to use an HPSDR radio, you must install hpsdrconnector from https://github.com/jancona/hpsdrconnector @@ -11,21 +11,24 @@ from owrx.command import Flag, Option # IP address of radio (default use first radio discovered) # --samplerate uint # Use the specified samplerate: one of 48000, 96000, 192000, 384000 (default 96000) +# --debug +# Emit debug log messages on stdout # # If you omit `remote` from config_webrx.py, hpsdrconnector will use the HPSDR discovery protocol # to find radios on your local network and will connect to the first radio it discovered. -class HpsdrSource(DirectSource): +class HpsdrSource(ConnectorSource): def getCommandMapper(self): - return super().getCommandMapper().setBase("hpsdrconnector").setMappings( + return ( + super() + .getCommandMapper() + .setBase("hpsdrconnector") + .setMappings( { "tuner_freq": Option("--frequency"), "samp_rate": Option("--samplerate"), "remote": Option("--radio"), "rf_gain": Option("--gain"), - } + "debug": Flag("--debug"), + }) ) - - def getFormatConversion(self): - return ["csdr convert_s24_f"] - From c0d4b2f6a5b3b700b988ecabdd7822658e4ed596 Mon Sep 17 00:00:00 2001 From: Jim Ancona Date: Thu, 12 Nov 2020 17:36:36 -0500 Subject: [PATCH 3/4] Remove debug option, mention in config_webrx.py --- config_webrx.py | 4 ++-- owrx/source/hpsdr.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config_webrx.py b/config_webrx.py index 6e0765f..4d77812 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -99,7 +99,7 @@ digital_voice_unvoiced_quality = 1 digital_voice_dmr_id_lookup = True """ -Note: if you experience audio underruns while CPU usage is 100%, you can: +Note: if you experience audio underruns while CPU usage is 100%, you can: - decrease `samp_rate`, - set `fft_voverlap_factor` to 0, - decrease `fft_fps` and `fft_size`, @@ -116,7 +116,7 @@ Note: if you experience audio underruns while CPU usage is 100%, you can: # Currently supported types of sdr receivers: # "rtl_sdr", "rtl_sdr_soapy", "sdrplay", "hackrf", "airspy", "airspyhf", "fifi_sdr", -# "perseussdr", "lime_sdr", "pluto_sdr", "soapy_remote" +# "perseussdr", "lime_sdr", "pluto_sdr", "soapy_remote", "hpsdr" # # 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 diff --git a/owrx/source/hpsdr.py b/owrx/source/hpsdr.py index 383a1db..50cac77 100644 --- a/owrx/source/hpsdr.py +++ b/owrx/source/hpsdr.py @@ -29,6 +29,5 @@ class HpsdrSource(ConnectorSource): "samp_rate": Option("--samplerate"), "remote": Option("--radio"), "rf_gain": Option("--gain"), - "debug": Flag("--debug"), }) ) From 2579b9be26f26a83904ddc27125695c8d7912208 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Thu, 12 Nov 2020 23:44:02 +0100 Subject: [PATCH 4/4] remove specific instructions, complete list --- config_webrx.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/config_webrx.py b/config_webrx.py index 1fbcca2..0bb707f 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -116,21 +116,11 @@ Note: if you experience audio underruns while CPU usage is 100%, you can: # Currently supported types of sdr receivers: # "rtl_sdr", "rtl_sdr_soapy", "sdrplay", "hackrf", "airspy", "airspyhf", "fifi_sdr", -# "perseussdr", "lime_sdr", "pluto_sdr", "soapy_remote", "hpsdr" -# -# 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 -# connector. -# -# 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 -# -# and do the proper changes to the sdrs object below -# (see also Wiki in https://github.com/jketterl/openwebrx/wiki/Sample-configuration-for-Perseus-HF-receiver). -# +# "perseussdr", "lime_sdr", "pluto_sdr", "soapy_remote", "hpsdr", "red_pitaya", "uhd", +# "radioberry", "fcdpp", "rtl_tcp" + +# For more details on specific types, please checkout the wiki: +# https://github.com/jketterl/openwebrx/wiki/Supported-Hardware#sdr-devices sdrs = { "rtlsdr": {