SDR Package #3

Merged
michael merged 22 commits from sdr into main 2025-10-03 13:34:25 -04:00
7 changed files with 130 additions and 115 deletions
Showing only changes of commit 37f3ce715f - Show all commits

View File

@ -40,10 +40,16 @@ Limitations
- USB 3.0 connectivity is required for optimal performance; using USB 2.0 will significantly limit data - USB 3.0 connectivity is required for optimal performance; using USB 2.0 will significantly limit data
transfer rates. 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 <your-env-name>
Step 2: Install the base dependencies and drivers ('Easy method')
.. code-block:: bash .. 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 libbladerf-dev
sudo apt-get install bladerf-fpga-hostedxa4 # Necessary for installation of bladeRF 2.0 Micro A4. sudo apt-get install bladerf-fpga-hostedxa4 # Necessary for installation of bladeRF 2.0 Micro A4.
Step 3: Install a udev rule by creating a link into your radioconda installation.
Step 2: Create and/or activate your virtual environment
.. code-block:: bash .. code-block:: bash
python3 -m venv venv sudo ln -s $CONDA_PREFIX/lib/udev/rules.d/88-nuand-bladerf1.rules /etc/udev/rules.d/88-radioconda-nuand-bladerf1.rules
pip install -r requirements.txt # If relevant sudo ln -s $CONDA_PREFIX/lib/udev/rules.d/88-nuand-bladerf2.rules /etc/udev/rules.d/88-radioconda-nuand-bladerf2.rules
source venv/bin/activate 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
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
Further Information Further Information
------------------- -------------------
- `Official Website <https://www.nuand.com/>`_ - `Official Website <https://www.nuand.com/>`_
- `BladeRF Documentation <https://www.nuand.com/documentation/>`_ - `BladeRF GitHub Repository <https://github.com/Nuand/bladeRF>`_
- `GitHub Repository <https://github.com/Nuand/bladeRF>`_ - `Radioconda Github Repository <https://github.com/radioconda/radioconda-installer?tab=readme-ov-file#bladerf>`

View File

@ -39,18 +39,47 @@ Limitations
- Bandwidth is limited to 20 MHz. - Bandwidth is limited to 20 MHz.
- USB 2.0 connectivity might limit data transfer rates compared to USB 3.0 or Ethernet-based SDRs. - 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 <your-env-name>
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 <user>
You may have to restart for this change to take effect.
--------------------------- ---------------------------
`HackRF Software Installation Guide <https://hackrf.readthedocs.io/en/latest/installing_hackrf_software.html>`_ `HackRF Software Installation Guide <https://hackrf.readthedocs.io/en/latest/installing_hackrf_software.html>`_
.. todo::
Addition HackRF installation instructions
Further information Further information
------------------- -------------------
- `Official Website <https://greatscottgadgets.com/hackrf/>`_ - `Official Website <https://greatscottgadgets.com/hackrf/>`_
- `Project Documentation <https://hackrf.readthedocs.io/en/latest/>`_ - `Project Documentation <https://hackrf.readthedocs.io/en/latest/>`_
- `GitHub Repository <https://github.com/greatscottgadgets/hackrf>`_ - `HackRF GitHub Repository <https://github.com/greatscottgadgets/hackrf>`_
- `Radioconda Github Repository <https://github.com/radioconda/radioconda-installer?tab=readme-ov-file#hackrf>`

View File

@ -43,14 +43,19 @@ Limitations
affect stability. affect stability.
- USB 2.0 connectivity might limit data transfer rates compared to USB 3.0 or Ethernet-based SDRs. - 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
conda activate <your-env-name>
Step 2: Install system dependancies.
.. code-block:: bash .. code-block:: bash
# Install required packages
sudo apt-get update sudo apt-get update
sudo apt-get install -y \ sudo apt-get install -y \
build-essential \ build-essential \
@ -60,12 +65,28 @@ The PlutoSDR Python API can be installed via pip. To build and install the drive
flex \ flex \
libcdk5-dev \ libcdk5-dev \
cmake \ cmake \
python3-pip \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
libavahi-client-dev \ libavahi-client-dev \
libavahi-common-dev \ libavahi-common-dev \
libaio-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 # Clone and build libiio
cd ~ cd ~
git clone --branch v0.23 https://github.com/analogdevicesinc/libiio.git git clone --branch v0.23 https://github.com/analogdevicesinc/libiio.git
@ -87,10 +108,8 @@ The PlutoSDR Python API can be installed via pip. To build and install the drive
make -j"$(nproc)" make -j"$(nproc)"
sudo make install sudo make install
# Install Python bindings
pip install pyadi-iio
Further information Further information
------------------- -------------------
- `PlutoSDR Documentation <https://wiki.analog.com/university/tools/pluto>`_ - `PlutoSDR Documentation <https://wiki.analog.com/university/tools/pluto>`_
- `Radioconda Github Repository <https://github.com/radioconda/radioconda-installer?tab=readme-ov-file#iio-pluto-sdr>`

View File

@ -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 <https://www.rtl-sdr.com/>`_
- `RTL-SDR Quick Start Guide <https://www.rtl-sdr.com/rtl-sdr-quick-start-guide/>`_

View File

@ -41,40 +41,53 @@ Limitations
- Compatibility with certain software tools may vary depending on the version of the UHD. - 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. - 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: Step 1: Activate your Radioconda environment.
.. code-block:: bash .. code-block:: bash
sudo apt-get install libuhd-dev uhd-host python3-uhd conda activate <your-env-name>
2. Build and install UHD from source: Step 2: Install UHD and Python Bindings.
.. code-block:: bash .. 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 conda install conda-forge::uhd
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
Step 3: Download UHD images.
3. Find your dist packages and add to `PYTHONPATH`. Example:
.. code-block:: bash .. code-block:: bash
export PYTHONPATH='/usr/local/lib/python3.10/site-packages/' uhd_images_downloader
export PYTHONPATH='/usr/local/lib/python3.10/dist-packages/:$PYTHONPATH'
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 Further information
------------------- -------------------
- `Official Website <https://www.ettus.com/>`_ - `Official Website <https://www.ettus.com/>`_
- `USRP Documentation <https://kb.ettus.com/USRP_Hardware_Driver_and_Interfaces>`_ - `USRP Documentation <https://kb.ettus.com/USRP_Hardware_Driver_and_Interfaces>`_
- `Radioconda Github Repository <https://github.com/radioconda/radioconda-installer?tab=readme-ov-file#uhd-ettus-usrp>`_

View File

@ -135,6 +135,8 @@ class HackRF(SDR):
samples = recording.data[0] samples = recording.data[0]
samples = samples.astype(np.complex64, copy=False) 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...") print("HackRF Starting TX...")
self.radio.start_tx(samples=samples, repeat=True) self.radio.start_tx(samples=samples, repeat=True)

View File

@ -102,7 +102,7 @@ class Pluto(SDR):
if channel == 0: if channel == 0:
print(f"Pluto gain = {self.radio.rx_hardwaregain_chan0}") print(f"Pluto gain = {self.radio.rx_hardwaregain_chan0}")
elif channel == 1: 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}") 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 self.radio.rx_buffer_size = 1024 # TODO deal with this for zmq
@ -223,7 +223,7 @@ class Pluto(SDR):
print("Pluto Starting RX...") print("Pluto Starting RX...")
samples = self.radio.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 = self._convert_rx_samples(samples)
samples = [samples] samples = [samples]
else: else:
@ -244,11 +244,11 @@ class Pluto(SDR):
def _format_tx_data(self, recording: Recording | np.ndarray | list): def _format_tx_data(self, recording: Recording | np.ndarray | list):
if isinstance(recording, np.ndarray): if isinstance(recording, np.ndarray):
data = [self._convert_tx_samples(samples=recording)] data = self._convert_tx_samples(samples=recording)
elif isinstance(recording, Recording): elif isinstance(recording, Recording):
if self.radio.tx_enabled_channels == [0]: if self.radio.tx_enabled_channels == [0]:
samples = recording.data[0] samples = recording.data[0]
data = [self._convert_tx_samples(samples=samples)] data = self._convert_tx_samples(samples=samples)
if len(recording.data) > 1: if len(recording.data) > 1:
warnings.warn("Recording object is multichannel, only channel 0 data was used for transmission") warnings.warn("Recording object is multichannel, only channel 0 data was used for transmission")