Merge pull request #86 from amontefusco/iw0hdv

Perseus HF Receiver integration
This commit is contained in:
Jakob Ketterl
2020-03-21 15:40:54 +01:00
committed by GitHub
3 changed files with 68 additions and 1 deletions

View File

@ -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.8.2/libperseus_sdr-0.8.2.tar.gz
tar -zxvf libperseus_sdr-0.8.2.tar.gz
cd libperseus_sdr-0.8.2/
./configure
make
sudo make install
sudo ldconfig
perseustest
```
"""
return self.command_is_runnable("perseustest -h")
def has_digiham(self):
"""
To use digital voice modes, the digiham package is required. You can find the package and installation

39
owrx/source/perseussdr.py Normal file
View File

@ -0,0 +1,39 @@
from .direct import DirectSource
from owrx.command import Flag, Option
#
# In order to interface Perseus hardware, we resolve to use the
# perseustest utility that comes with libperseus-sdr support package.
# Below the base options used are shown:
#
# -p output I/Q samples as 32 bits floating point
# -d -1 suppress debug messages
# -a don't test attenuators on startup
# -t 0 runs indefinitely
# -o - output samples on stdout
#
# As we are already returning I/Q samples as pairs of 32 bits
# floating points (option -p),no need for further conversions,
# so the method getFormatConversion(self) is not implemented at all.
class PerseussdrSource(DirectSource):
def getCommandMapper(self):
return super().getCommandMapper().setBase("perseustest -p -d -1 -a -t 0 -o - ").setMappings(
{
"samp_rate": Option("-s"),
"tuner_freq": Option("-f"),
"attenuator": Option("-u"),
"adc_preamp": Option("-m"),
"adc_dither": Option("-x"),
"wideband": Option("-w"),
}
)
def getEventNames(self):
return super().getEventNames() + [
"attenuator",
"adc_preamp",
"adc_dither",
"wideband",
]