SDR with HackRF + Opera Cake + OpenWebRX + RasPi4

The open source SDR device HackRF One , developed and produced at Great Scott Gadgets,is a great and universal lab device as a receiver or transmitter between 1 MHz and 6 GHz. However, confronting the dynamic range of the 8bit AD converters with the extreme signal levels at a real receiving antenna site can quickly lead to strange and sometimes frustrating reception results, as with many other SDR receivers. This becomes apparent when unexpected ghost signals are seen and heard in the receive spectrum. These are usually symptoms of overdrive or unwanted mixed signals from broadcast stations or other strong signals.

Due to my very limited antenna possibilities I could only mount a very small active broadband antenna “Boni Whip” on the roof. However, there, i.e. outside the electrical interference fog of my household , this antenna provides surprisingly good signal-to-noise ratios. It also delivers an unfiltered, very dynamic and wide signal spectrum to the input of the SDR. When equipped with a modified, but only slightly extended 35cm antenna whip, the Boni Whip works from below 100 kHz to now even the 440 MHz amateur radio band at my location without being overloaded by any antenna signals.

Potentially interfering signals can even be very far outside the desired reception frequency window! A restrained and well thought-out choice of the three gain values in front of the mixers and ADCs of the HackRF can be very effective. The block diagram of the HackRF helps to understand where too much gain hurts and no longer increases the signal-to-noise ratio, but only overloads the following stages. Usefull hints can be found at the HackRF documentation pages .

HackRF One Block Diagram

The diagram shows that at frequencies below 2150 MHz, there is actually only one low-pass filter (LPF U3) in the receive path. This leads to the conclusion, which has also been proven in practice, that additional narrowband RF bandpass filters at the input of the HackRF in particular can work wonders here, as unwanted signals are kept out of the signal path.

A variable preselector filter might be helpful, but usually has to be set or switched manually. Thus, one would prefer to be able to switch a suitable and necessary RF filter block into the signal path automatically and only depending on the current receiving frequency.

Now the expansion board “Opera Cake for HackRF One” comes into play. This board can be controlled by the USB host device or additionally independently by the processor of the HackRF. For this purpose, it is placed on the HackRF board. It has two primary SMA-RF-ports, each connected to any of eight secondary ports, and is optimized for use as a pair of 1×4 switches or as a single 1×8 switch.

Opera Cake for HackRF One

With the preinstalled 2021.03 firmware of my HackRF and the HackRF tools of the official release running at my RaspberryPi 4, I was at first only able to control the antenna switch manually by HackRF-tool command line statements.

# This connects A0 to A2 and B0 to B2 
hackrf_operacake -m manual -a A2 -b B2

But I could not set the Opera Cake to automatic frequency mode. After some helpful hints from the development team, I learned that there has not been an official release of the Opera cake software until now. I downloaded the latest HackRF code from the HackRF GitHub repository . After compiling them on a RaspberryPi 4 with an OpenWebRX installed, I exchanged the formerly installed libhackrf0.

Next stop: The firmware of the HackRF device now needed to be updated to match the pre-release version of the Opera Cake software. I got a matching compiled firmware version from the developers after a request in the Great Scott Gadgets Discord channel .

My install and update procedure for the HackRf tools and libraries on a RasPi4 with an OpenWebRX-image was this:

git clone
cd hackrf/host
mkdir build
cd build
cmake ..
sudo make install
sudo ldconfig

The Opera Cake software will be included in the next official HackRF release software by the Great Scott Gadgets team.

A single command line on the RasPi4 now activates the frequency-dependent automatic switching for the run time only . For my needs with three Filters and a bypass it was:

hackrf_operacake -m frequency -f A1:31:110 -f A2:1:30 -f A3:110:150 -f A4:150:6000

This makes the HackRF processor autonomously switch my single antenna to one of three filters or a bypass, just depended on the frequency, selected by whatever software that controls the HackRF via USB.

SDR-RX with HackRF + Opera Cake + RF-filters + RasPi4 + OpenWebRX

To complete this constellation to a simple but very effective receiver, I recommend using the SDR web server OpenWebRX on the RasPi4, for which there is a ready-made RaspberryPi SD card image. It is prepared to accept commonly used SDR-USB-devices – including HackRF One. OpenWebRX takes over the signal decoding locally and provides one or more WebClients with a convenient control interface and the decoded audio signal. A lot of digital operating modes of amateur radio are also displayed directly in the browser. The working parameters of the HackRF can be stored in quickly accessible and retrievable profiles, adapted to the respective frequency range and the purpose of use.

Please take an enlightening look at the OpenWebRX_documentation pages and this installation guide. And remember the mentioned three gain values when best selecting “Specify gain stages individually” in the profiles. LNA=16, AMP=0, VGA=16 is a good starter for the shortwave bands. 40,1,30 was best for the VHF/UHF bands with my antenna.

This is not a Flux Capacitor but my test setup 🙂

All these efforts were rewarded with an antenna switch that inserts a filter at the HackRF input that corresponds to the current frequency range. If there would be different Antennas – only an according B-port would be used to select one of them. All this happens in HackRF and Opera Cake completely independently of the actual SDR software used.

OpenWebRX screen
OpenWebSDR in a browser window displaying a decoded FT8 signal at 14.09MHz

In the web browser of an iPad, IPhone or a Windows notebook, I can now – even sitting on the sofa – use the SDR receiver with the switchable filters on all frequencies. After a few years of SWL abstinence, this ultimately led me again to search the amateur radio bands and other frequencies for interesting signals more frequently and much more comfortably. And don’t forget – the HackRF can be a transmitter as well and this constellation (without the active antenna) will do its work for that too.

%d bloggers like this: