GNU Radio Companion - HackRF/RTL-SDR Packet Radio Loop Back Test (BPSK)

Prepared by Dr. Aaron Scher
[email protected]
Oregon Institute of Technology

Back to Aaron's home page.
Back to My collection of GNU radio companion flow graphs.

(Last updated: Sep 2016)

Download file: HackRF_RTLSDR_loopback_test.grc.

Below is the basic setup. You see a HackRF One and an RTL-SDR dongle both connected to my laptop. With one GNU Radio Companion (GRC) flowgraph, I transmit data using the HackRF and receive using the RTL-SDR. For this loop back test I choose BPSK modulation and work in the 70 cm band. The data I transmit are simple text messages (such as "Hello World!") that I enter in using the QT GUI Message Edit Box. The recovered message is displayed using the Message Debug Print block. I like this example, because I can type in my text and see the recovered message all within GRC itself (i.e. I don't need to use TCP sources and sinks, etc.) With my laptop, there is definitely some delay between the moment I press enter to send the data and the the moment the recovered message displays on my screen. This example demonstrates the basics of packet radio transmission and detection in GNU Radio. This flowgraph employs some useful blocks specific for packet radio including Protocol Formatter, Burst Shaper, and Correlate Access Code - Tag Stream blocks. Another useful block here is the Polyphase Clock Sync which seems to work pretty well. My next goal is to modify the flowgraph for FSK modulation. I will be using the following link as a useful guide: Stack Exchange: FSK Demodulation With GNU Radio.

I am using GNU Radio Companion version 3.7.10.1.

HackRF/RTL-SDR loop back test setup

The loopback test uses only a single flowgraph. However, because the flowgraph is so large, I divided the flowgraph up below to make it easier to see. Click on any screenshot below to enlarge the image.

Variables, definitions, and parameters:

HackRF/RTL-SDR loop back variables, parameters, and definitions

Transmitter section of the flowgraph:

HackRF/RTL-SDR transmitter section of the flowgraph

Receiver section of the flowgraph:

HackRF/RTL-SDR transmitter section of the flowgraph

Flowgraph in action:

HackRF/RTL-SDR loopback in action!