Skip to content

PentHertz/gr-hydrasdr

Repository files navigation

gr-hydrasdr

A GNU Radio 3.10 out-of-tree module providing a full-API receive source for HydraSDR family devices (e.g. HydraSDR RFOne), built directly on libhydrasdr (v1.1.x).

Unlike the generic gr-osmosdr HydraSDR block (which only surfaces the common osmosdr control subset), gr::hydrasdr::hydrasdr_source exposes the entire libhydrasdr control surface.

The block: hydrasdr_source

  • Output: interleaved 32-bit float I/Q as gr_complex (HYDRASDR_SAMPLE_FLOAT32_IQ).
  • Usable from GRC, Python (from gnuradio import hydrasdr), and C++ (#include <gnuradio/hydrasdr/hydrasdr_source.h>, link gnuradio::gnuradio-hydrasdr).

API coverage

Group Controls
Device / caps get_devices, get_board_name, get_firmware_version, get_serial, get_capabilities, has_capability, get_temperature
Streaming stats get_buffers_received/processed/dropped, get_dropped_samples
Rate / DDC get_samplerates, set/get_sample_rate, set/get_decimation_mode, get_bandwidths, set/get_bandwidth
Frequency set/get_center_freq, set/get_freq_correction (ppm), get_freq_min/max
Gain set/get_gain_mode, set/get_lna_gain, set/get_mixer_gain, set/get_vga_gain, set/get_lna_agc, set/get_mixer_agc, set/get_linearity_gain, set/get_sensitivity_gain, unified set/get_gain(type,value), get_gain_range(type)
RF front-end set/get_bias_tee, set/get_rf_port, get_rf_port_count
Format set/get_packing, list_conversion_algorithms, set_conversion_algorithm, set_conversion_filter_float32
Peripherals gpio_write/read, gpio_set/get_direction, clockgen_write/read, rf_frontend_write/read, spiflash_read/write/erase_sector, reset

Gain writes route through the unified hydrasdr_set_gain() (which itself falls back to the legacy per-stage commands on older firmware), so the module never calls the deprecated hydrasdr_set_*_gain() entry points. Capability-guarded controls are silently skipped when the device lacks the feature, so a flowgraph stays portable across hardware variants.

Dependencies

  • GNU Radio >= 3.10 (gnuradio-dev)
  • libhydrasdr v1.1.x (from hydrasdr/rfone_host) — provides the CMake find module input libhydrasdr.pc.

Build

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j$(nproc)
sudo make install && sudo ldconfig

Use from Python

from gnuradio import hydrasdr
src = hydrasdr.hydrasdr_source(
    "", 3e6, 433.92e6,
    gain_mode=hydrasdr.hydrasdr_source.GAIN_MODE_LINEARITY,
    linearity_gain=12)
print(src.get_board_name(), src.get_capabilities())

See examples/hydrasdr_power_probe.py.

Use from C++

find_package(Gnuradio "3.10" REQUIRED COMPONENTS runtime blocks)
find_package(gnuradio-hydrasdr REQUIRED)
target_link_libraries(app gnuradio::gnuradio-hydrasdr gnuradio::gnuradio-runtime)
#include <gnuradio/hydrasdr/hydrasdr_source.h>
auto src = gr::hydrasdr::hydrasdr_source::make("", 3e6, 433.92e6);

About

GNURadio native OOT module for HydraSDR (beta)

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors