diff --git a/docs/source/sdr_guides/blade.rst b/docs/source/sdr_guides/blade.rst index 8f9197e..b52ffd6 100644 --- a/docs/source/sdr_guides/blade.rst +++ b/docs/source/sdr_guides/blade.rst @@ -40,10 +40,16 @@ Limitations - USB 3.0 connectivity is required for optimal performance; using USB 2.0 will significantly limit data transfer rates. -Set up instructions (Linux) +Set up instructions (Linux, Radioconda) --------------------------- -Step 1: Install the base dependencies and drivers ('Easy method') +Step 1: Activate your Radioconda environment. + +.. code-block:: bash + + conda activate + +Step 2: Install the base dependencies and drivers ('Easy method') .. code-block:: bash @@ -53,33 +59,19 @@ Step 1: Install the base dependencies and drivers ('Easy method') sudo apt-get install libbladerf-dev sudo apt-get install bladerf-fpga-hostedxa4 # Necessary for installation of bladeRF 2.0 Micro A4. - -Step 2: Create and/or activate your virtual environment +Step 3: Install a udev rule by creating a link into your radioconda installation. .. code-block:: bash - python3 -m venv venv - pip install -r requirements.txt # If relevant - source venv/bin/activate - - -Step 3: from within the virtual environment, clone the bladerf host repo, then build and install the wheel for -bladerf python bindings. - -.. code-block:: bash - - cd ~ - mkdir workarea - cd workarea - git clone --depth 1 https://github.com/Nuand/bladeRF.git - cd bladeRF/host - cd libraries/libbladeRF_bindings/python - sudo python3 setup.py bdist_wheel - pip install dist/*.whl + sudo ln -s $CONDA_PREFIX/lib/udev/rules.d/88-nuand-bladerf1.rules /etc/udev/rules.d/88-radioconda-nuand-bladerf1.rules + sudo ln -s $CONDA_PREFIX/lib/udev/rules.d/88-nuand-bladerf2.rules /etc/udev/rules.d/88-radioconda-nuand-bladerf2.rules + sudo ln -s $CONDA_PREFIX/lib/udev/rules.d/88-nuand-bootloader.rules /etc/udev/rules.d/88-radioconda-nuand-bootloader.rules + sudo udevadm control --reload + sudo udevadm trigger Further Information ------------------- - `Official Website `_ -- `BladeRF Documentation `_ -- `GitHub Repository `_ +- `BladeRF GitHub Repository `_ +- `Radioconda Github Repository ` diff --git a/docs/source/sdr_guides/hackrf.rst b/docs/source/sdr_guides/hackrf.rst index f7a1b8f..741e140 100644 --- a/docs/source/sdr_guides/hackrf.rst +++ b/docs/source/sdr_guides/hackrf.rst @@ -39,18 +39,47 @@ Limitations - Bandwidth is limited to 20 MHz. - USB 2.0 connectivity might limit data transfer rates compared to USB 3.0 or Ethernet-based SDRs. -Set up instructions (Linux) +Set up instructions (Linux, Radioconda) +--------------------------- + +Step 1: Activate your Radioconda environment. + +.. code-block:: bash + + conda activate + +Step 2: Install the System Package (Ubuntu / Debian) + +.. code-block:: bash + + sudo apt-get update + sudo apt-get install hackrf + +Step 3: Install a udev rule by creating a link into your radioconda installation. + +.. code-block:: bash + + sudo ln -s $CONDA_PREFIX/lib/udev/rules.d/53-hackrf.rules /etc/udev/rules.d/53-radioconda-hackrf.rules + sudo udevadm control --reload + sudo udevadm trigger + +Make sure your user account belongs to the plugdev group in order to access your device: + +.. code-block:: bash + + sudo usermod -a -G plugdev + +You may have to restart for this change to take effect. + --------------------------- `HackRF Software Installation Guide `_ -.. todo:: - - Addition HackRF installation instructions Further information ------------------- - `Official Website `_ - `Project Documentation `_ -- `GitHub Repository `_ +- `HackRF GitHub Repository `_ +- `Radioconda Github Repository ` diff --git a/docs/source/sdr_guides/pluto.rst b/docs/source/sdr_guides/pluto.rst index f1cf70e..61413b8 100644 --- a/docs/source/sdr_guides/pluto.rst +++ b/docs/source/sdr_guides/pluto.rst @@ -43,28 +43,49 @@ Limitations affect stability. - USB 2.0 connectivity might limit data transfer rates compared to USB 3.0 or Ethernet-based SDRs. -Set up instructions (Linux) +Set up instructions (Linux, Radioconda) --------------------------- -The PlutoSDR Python API can be installed via pip. To build and install the drivers from source, see the instructions below: +Step 1: Activate your Radioconda environment. .. code-block:: bash - # Install required packages - sudo apt-get update - sudo apt-get install -y \ - build-essential \ - git \ - libxml2-dev \ - bison \ - flex \ - libcdk5-dev \ - cmake \ - python3-pip \ - libusb-1.0-0-dev \ - libavahi-client-dev \ - libavahi-common-dev \ - libaio-dev + conda activate + +Step 2: Install system dependancies. + +.. code-block:: bash + + sudo apt-get update + sudo apt-get install -y \ + build-essential \ + git \ + libxml2-dev \ + bison \ + flex \ + libcdk5-dev \ + cmake \ + libusb-1.0-0-dev \ + libavahi-client-dev \ + libavahi-common-dev \ + libaio-dev + + +Step 3: Install a udev rule by creating a link into your radioconda installation. + +.. code-block:: bash + + sudo ln -s $CONDA_PREFIX/lib/udev/rules.d/90-libiio.rules /etc/udev/rules.d/90-radioconda-libiio.rules + sudo udevadm control --reload + sudo udevadm trigger + +Once you can talk to the hardware, you may want to perform the post-install steps detailed on the PlutoSDR documentation below. + +Step 4 (Optional): Building libiio or libad9361-iio from source. + +Only needed if you want the very latest version of the libraries not provided in Radioconda: + +.. code-block:: bash # Clone and build libiio cd ~ @@ -87,10 +108,8 @@ The PlutoSDR Python API can be installed via pip. To build and install the drive make -j"$(nproc)" sudo make install - # Install Python bindings - pip install pyadi-iio - Further information ------------------- - `PlutoSDR Documentation `_ +- `Radioconda Github Repository ` \ No newline at end of file diff --git a/docs/source/sdr_guides/rtl.rst b/docs/source/sdr_guides/rtl.rst deleted file mode 100644 index d11132a..0000000 --- a/docs/source/sdr_guides/rtl.rst +++ /dev/null @@ -1,40 +0,0 @@ -.. _rtl: - -RTL-SDR -======= - -RTL-SDR (RTL2832U Software Defined Radio) is a low-cost USB dongle originally designed for digital TV reception -that has been repurposed as a wideband software-defined radio. RTL-SDR devices are popular for hobbyist use due to -their affordability and wide range of applications. - -The RTL-SDR is based on the Realtek RTL2832U chipset, which features direct sampling and demodulation of RF -signals. These devices are commonly used for tasks such as listening to FM radio, monitoring aircraft traffic -(ADS-B), receiving weather satellite images, and more. - -Supported Models ----------------- - -- **Generic RTL-SDR Dongle:** The most common variant, usually featuring an R820T or R820T2 tuner. -- **RTL-SDR Blog V3:** An enhanced version with additional features like direct sampling mode and a bias tee for - powering external devices. - -Key Features ------------- - -- **Frequency Range:** Typically from 24 MHz to 1.7 GHz, depending on the tuner chip. -- **Bandwidth:** Limited to about 2.4 MHz, making it suitable for narrowband applications. -- **Connectivity:** USB 2.0 interface, plug-and-play on most platforms. -- **Software Support:** Compatible with SDR software like SDR#, GQRX, and GNU Radio. - -Limitations ------------ - -- Narrow bandwidth compared to more expensive SDRs, which may limit some applications. -- Sensitivity and performance can vary depending on the specific model and components. -- Requires external software for signal processing and analysis. - -Further Information -------------------- - -- `Official Website `_ -- `RTL-SDR Quick Start Guide `_ diff --git a/docs/source/sdr_guides/usrp.rst b/docs/source/sdr_guides/usrp.rst index b3f36a2..d88775b 100644 --- a/docs/source/sdr_guides/usrp.rst +++ b/docs/source/sdr_guides/usrp.rst @@ -41,40 +41,53 @@ Limitations - Compatibility with certain software tools may vary depending on the version of the UHD. - Price range can be a consideration, especially for high-end models. -Set up instructions (Linux) +Set up instructions (Linux, Radioconda) --------------------------- -1. Install the required system packages via APT: - -.. code-block:: bash - - sudo apt-get install libuhd-dev uhd-host python3-uhd - -2. Build and install UHD from source: +Step 1: Activate your Radioconda environment. .. code-block:: bash - sudo apt-get install git cmake libboost-all-dev libusb-1.0-0-dev python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools build-essential - cd ~ - git clone https://github.com/EttusResearch/uhd.git - cd uhd/host - mkdir build - cd build - cmake -DENABLE_TESTS=OFF -DENABLE_C_API=OFF -DENABLE_MANUAL=OFF .. - make -j8 - sudo make install - sudo ldconfig + conda activate - -3. Find your dist packages and add to `PYTHONPATH`. Example: +Step 2: Install UHD and Python Bindings. .. code-block:: bash - export PYTHONPATH='/usr/local/lib/python3.10/site-packages/' - export PYTHONPATH='/usr/local/lib/python3.10/dist-packages/:$PYTHONPATH' + conda install conda-forge::uhd + +Step 3: Download UHD images. + +.. code-block:: bash + + uhd_images_downloader + +Step 4: Verify Installation. + +To verify access to your device: + +.. code-block:: bash + + uhd_find_devices + +For USB devices only (e.g. B series), install a udev rule by creating a link into your radioconda installation. + +.. code-block:: bash + sudo ln -s $CONDA_PREFIX/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/radioconda-uhd-usrp.rules + sudo udevadm control --reload + sudo udevadm trigger + +Step 5: (optional): Update Firmware/FPGA images + +.. code-block:: bash + + uhd_usrp_probe + +This will ensure your device is running the latest firmware and FPGA versions. Further information ------------------- - `Official Website `_ - `USRP Documentation `_ +- `Radioconda Github Repository `_ diff --git a/src/ria_toolkit_oss/sdr/hackrf.py b/src/ria_toolkit_oss/sdr/hackrf.py index 349e4fc..91a84ef 100644 --- a/src/ria_toolkit_oss/sdr/hackrf.py +++ b/src/ria_toolkit_oss/sdr/hackrf.py @@ -135,6 +135,8 @@ class HackRF(SDR): samples = recording.data[0] samples = samples.astype(np.complex64, copy=False) + if np.max(np.abs(samples)) >= 1: + samples = samples / (np.max(np.abs(samples)) + 1e-12) print("HackRF Starting TX...") self.radio.start_tx(samples=samples, repeat=True) diff --git a/src/ria_toolkit_oss/sdr/pluto.py b/src/ria_toolkit_oss/sdr/pluto.py index 2735689..449505e 100644 --- a/src/ria_toolkit_oss/sdr/pluto.py +++ b/src/ria_toolkit_oss/sdr/pluto.py @@ -102,7 +102,7 @@ class Pluto(SDR): if channel == 0: print(f"Pluto gain = {self.radio.rx_hardwaregain_chan0}") elif channel == 1: - self.set_tx_gain(gain=abs_gain, channel=0) + self.set_rx_gain(gain=abs_gain, channel=0) print(f"Pluto gain = {self.radio.rx_hardwaregain_chan0}, {self.radio.rx_hardwaregain_chan1}") self.radio.rx_buffer_size = 1024 # TODO deal with this for zmq @@ -223,7 +223,7 @@ class Pluto(SDR): print("Pluto Starting RX...") samples = self.radio.rx() - if self.radio.tx_enabled_channels == [0]: + if self.radio.rx_enabled_channels == [0]: samples = self._convert_rx_samples(samples) samples = [samples] else: @@ -244,11 +244,11 @@ class Pluto(SDR): def _format_tx_data(self, recording: Recording | np.ndarray | list): if isinstance(recording, np.ndarray): - data = [self._convert_tx_samples(samples=recording)] + data = self._convert_tx_samples(samples=recording) elif isinstance(recording, Recording): if self.radio.tx_enabled_channels == [0]: samples = recording.data[0] - data = [self._convert_tx_samples(samples=samples)] + data = self._convert_tx_samples(samples=samples) if len(recording.data) > 1: warnings.warn("Recording object is multichannel, only channel 0 data was used for transmission")