Initial HPSDR radio support

This commit is contained in:
Jim Ancona 2020-11-02 07:11:54 -05:00
parent e6a04aa5e9
commit c85400063c
2 changed files with 39 additions and 0 deletions

View File

@ -68,6 +68,7 @@ class FeatureDetector(object):
"red_pitaya": ["soapy_connector", "soapy_red_pitaya"], "red_pitaya": ["soapy_connector", "soapy_red_pitaya"],
"radioberry": ["soapy_connector", "soapy_radioberry"], "radioberry": ["soapy_connector", "soapy_radioberry"],
"fcdpp": ["soapy_connector", "soapy_fcdpp"], "fcdpp": ["soapy_connector", "soapy_fcdpp"],
"hpsdr": ["hpsdr_connector"],
# optional features and their requirements # optional features and their requirements
"digital_voice_digiham": ["digiham", "sox"], "digital_voice_digiham": ["digiham", "sox"],
"digital_voice_dsd": ["dsd", "sox", "digiham"], "digital_voice_dsd": ["dsd", "sox", "digiham"],
@ -492,3 +493,10 @@ class FeatureDetector(object):
[OpenWebRX wiki](https://github.com/jketterl/openwebrx/wiki/DRM-demodulator-notes). [OpenWebRX wiki](https://github.com/jketterl/openwebrx/wiki/DRM-demodulator-notes).
""" """
return self.command_is_runnable("dream --help", 0) 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")

31
owrx/source/hpsdr.py Normal file
View File

@ -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"]