How to log raw IQ data from Raspberry Pi 4 over eth0 to PC?

Hi everyone,

I’m working with a KrakenSDR (5-channel RTL-SDR array) connected to a Raspberry Pi 4 running the standard firmware. I’d like to capture the raw IQ data (after FIR decimation and optional IQ calibration) and stream it over Ethernet (eth0) directly to my PC for further offline processing.

Could you help me with:

  1. The proper way to redirect IQ data (complex float32) to the Ethernet interface from the Pi?
  2. What configuration files or blocks (in daq_chain_config.ini or otherwise) I need to modify?
  3. How do I receive and log this data on the PC? (e.g., netcat, Python socket, etc.)

I saw mentions of the IQ Server block and shared memory, but not sure how to access the streamed data remotely.

Any advice, script examples, or best practices would be greatly appreciated. Thanks!

Hi, the best way would be look at how it’s done on our gr-krakensdr GNU Radio block.

Basically the steps are:

  1. Set heimdall_daq data_interface out_data_iface_type = eth;
  2. In your custom PC software, set up a TCP socket connection and receive the data into a buffer.
  3. Process the received data frames, splitting them up into the individual channels and header metadata. (As shown in the GNU Radio code)

When logging IQ data with Heimdall IQ recorder, which antenna channel(s) does the recorded data represent in the 5-antenna array?

They should correspond to the physical labels on the device.

I’m also trying to do the following on my windows PC through WSL. In summary I have cloned the heimdall_daq_fr repo in WSL and built it. For some reason I just cannot get the IQ data to stream on the TCP server.

I have done the following on my WSL terminal:

Ensured WSL has access to the RTL devices.

update & pick packages used by the Kraken install scripts

sudo apt update && sudo apt -y upgrade

essential build and runtime deps

sudo apt install -y build-essential git cmake libusb-1.0-0-dev pkg-config
lsof libzmq3-dev clang python3-dev python3-venv python3-pip wget

usbip client helpers for WSL

sudo apt install -y linux-tools-virtual hwdata

create a usable usbip command (sometimes the path includes kernel version)

sudo update-alternatives --install /usr/local/bin/usbip usbip $(command -v /usr/lib/linux-tools/*/usbip | tail -n1) 20 || true

cd ~ mkdir -p ~/krakensdr && cd ~/krakensdr

cloned the following repos:
krakenrf/librtlsdr.git
krakenrf/heimdall_daq_fw.git
krakenrf/gr-krakensdr.git

cd ~/krakensdr/librtlsdr

copy udev rules (ensures device permissions)

sudo cp rtl-sdr.rules /etc/udev/rules.d/rtl-sdr.rules

mkdir -p build && cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make -j$(nproc)
sudo make install
sudo ldconfig

copy the static librtlsdr archive and headers into the Heimdall daq core folder

cd ~/krakensdr/heimdall_daq_fw/Firmware/_daq_core

copy the created static lib + headers (path depends on librtlsdr build)

cp ~/krakensdr/librtlsdr/build/src/librtlsdr.a .
cp ~/krakensdr/librtlsdr/include/rtl-sdr.h .
cp ~/krakensdr/librtlsdr/include/rtl-sdr_export.h .

build Heimdall’s DAQ core

make -j$(nproc)

nano ~/krakensdr/heimdall_daq_fw/Firmware/daq_chain_config.ini
[data_interface]

default might be shmem — change to eth so Heimdall writes IQ to a TCP socket

out_data_iface_type = eth

copy into your krakensdr root (where Heimdall lives)

cp ~/krakensdr/gr-krakensdr/heimdall_only_start.sh ~/krakensdr/
cd ~/krakensdr
chmod +x heimdall_only_start.sh

start (runs Heimdall in IQ server mode; check logs)

./heimdall_only_start.sh

==============================================

confirm port 5000 is listening

ss -tuln | grep 5000

or

sudo lsof -i -P -n | grep 5000

I cannot see any info when running the following:

confirm port 5000 is listening

ss -tuln | grep 5000

or

sudo lsof -i -P -n | grep 5000

I do not believe the software is actually running which is why is see no status on the port.

Some useful info:
:~/krakensdr/heimdall_daq_fw/Firmware$ cd ~/krakensdr/heimdall_daq_fw/Firmware
./daq_start_sm.sh # runs the DAQ chain and IQ server (port 5000)
Config file check bypassed [ WARNING ]
kernel.sched_rt_runtime_us = -1
Desig FIR filter with the following parameters:
Decimation ratio: 1
Bandwidth: 1.00
Tap size: 1
Window function: hann
FIR filter ready
Transfer funcfion is exported to : logs/Decimator_filter_transfer.html
Coefficients are exported to: data_control/fir_coeffs.txt
Starting DAQ Subsystem
Output data interface: Shared memory
) (
( ) )
) ( (
)
.-'---------|
( |/////|
'-./////|
'
_’
‘-------’

Have a coffee watch radar

I would appreciate any help on this issue thank you. My main goal is to get acces to the coherent IQ data to do some custom processing.

Anything in the log files?

I’m not too familiar with WSL, but it might not work through WSL as I believe WSL does something funky to get the USB passthrough working, and that could totally mess up the USB packet timing.