From f38b158c4486539a7652a5d5914b9289ad75566c Mon Sep 17 00:00:00 2001 From: Eric Tendian Date: Mon, 17 Apr 2023 22:21:44 -0500 Subject: [PATCH] Add SpyServer support --- Dockerfile | 10 ++--- lib/gr-osmosdr/airspy_source_c.cc.patch | 51 ------------------------- 2 files changed, 4 insertions(+), 57 deletions(-) delete mode 100644 lib/gr-osmosdr/airspy_source_c.cc.patch diff --git a/Dockerfile b/Dockerfile index 98df1797f..f423ed582 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,7 @@ RUN apt-get update && \ libfreesrp-dev \ libgmp-dev \ libhackrf-dev \ + libmirisdr-dev \ liborc-0.4-dev \ libpthread-stubs0-dev \ librtlsdr-dev \ @@ -43,17 +44,14 @@ RUN apt-get update && \ wget && \ rm -rf /var/lib/apt/lists/* -COPY lib/gr-osmosdr/airspy_source_c.cc.patch /tmp/airspy_source_c.cc.patch - # Fix the error message level for SmartNet RUN sed -i 's/log_level = debug/log_level = info/g' /etc/gnuradio/conf.d/gnuradio-runtime.conf -# Compile gr-osmosdr ourselves so we can install the Airspy serial number patch +# Compile gr-osmosdr ourselves using a fork with various patches included RUN cd /tmp && \ - git clone https://git.osmocom.org/gr-osmosdr && \ + git clone https://github.com/racerxdl/gr-osmosdr.git && \ cd gr-osmosdr && \ - git apply ../airspy_source_c.cc.patch && \ mkdir build && \ cd build && \ cmake -DENABLE_NONFREE=TRUE .. && \ @@ -61,7 +59,7 @@ RUN cd /tmp && \ make install && \ ldconfig && \ cd /tmp && \ - rm -rf gr-osmosdr airspy_source_c.cc.patch + rm -rf gr-osmosdr WORKDIR /src diff --git a/lib/gr-osmosdr/airspy_source_c.cc.patch b/lib/gr-osmosdr/airspy_source_c.cc.patch deleted file mode 100644 index f63b5b822..000000000 --- a/lib/gr-osmosdr/airspy_source_c.cc.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/lib/airspy/airspy_source_c.cc b/lib/airspy/airspy_source_c.cc -index 25f73d4..52b1d81 100644 ---- a/lib/airspy/airspy_source_c.cc -+++ b/lib/airspy/airspy_source_c.cc -@@ -90,12 +90,25 @@ airspy_source_c::airspy_source_c (const std::string &args) - _vga_gain(0), - _bandwidth(0) - { -- int ret; - -+ int ret; -+ _dev = NULL; - dict_t dict = params_to_dict(args); - -- _dev = NULL; -- ret = airspy_open( &_dev ); -+ // the block below allows one to open airspy by serial number -+ // 2016-Apr-5 - by Lawrence Glaister VE7IT ve7it@shaw.ca -+ // (allowing multiple airspy source blocks to be used) Note: each airspy should be -+ // plugged into its own USB bus controller to support the high data rates involved. -+ // osmocom Source block usage: Device arguments: airspy=0x644064DC317C1FCD -+ // if no device arguments are given or s/n=0, the first found airspy device will be used -+ // use airspy_info utility to identify device serial number strings -+ uint64_t sn; -+ std::stringstream ss; -+ ss << std::hex << dict["airspy"]; -+ ss >> sn; -+ std::cerr << "Attempting to open airspy by s/n= " -+ << boost::format("0x%016X") % (sn) << std::endl; -+ ret = airspy_open_sn( &_dev, sn ); - AIRSPY_THROW_ON_ERROR(ret, "Failed to open AirSpy device") - - uint8_t board_id; -@@ -106,11 +119,15 @@ airspy_source_c::airspy_source_c (const std::string &args) - memset(version, 0, sizeof(version)); - ret = airspy_version_string_read( _dev, version, sizeof(version)); - AIRSPY_THROW_ON_ERROR(ret, "Failed to read version string") --#if 0 -+ - airspy_read_partid_serialno_t part_serial; - ret = airspy_board_partid_serialno_read( _dev, &part_serial ); - AIRSPY_THROW_ON_ERROR(ret, "Failed to read serial number") --#endif -+ std::cerr << "Opened Device Serial Number= " -+ << boost::format("0x%08X") % (part_serial.serial_no[2]) -+ << boost::format("%08X") % (part_serial.serial_no[3]) -+ << std::endl; -+ - uint32_t num_rates; - airspy_get_samplerates(_dev, &num_rates, 0); - uint32_t *samplerates = (uint32_t *) malloc(num_rates * sizeof(uint32_t));