Orange Pi – Raspberry Pi
HackRF One is an SDR (Software Defined radio) working in transmission and reception in a wide frequency range. 1MHz to 6GHz. RTL-SDR is the cheapest and most well-known SDR working in reception only. Here we will discuss the connection of these 2 SDRs to an Orange Pi or a Raspberry PI and their operation with the GNU Radio software.
In console mode, update your system:
sudo apt-get update
sudo apt-get upgrade
Install the library for hackrf:
sudo apt-get install hackrf
Connect the hackrf to an USB port and check it:
If the installation is good, you will get a response “Found HackRF” etc … Sometimes with some USB cables that connect the HackRF, there is no response. Change the cable in this case.
Installation GNU Radio Companion
GNU Radio is a very powerful tool for modelling signal processing chains. GNU Radio Companion is a complementary tool allowing to build radio processing chains graphically without writing a line of code. So far for Debian Buster there is only version 3.7.13 which is considered stable.
sudo apt-get install gnuradio
Installation Osmocom SDR and RTL-SDR Drivers
sudo apt-get update
Installation of the USB library:
sudo apt-get install cmake build-essential libusb-1.0-0-dev
We clone Osmocom in the user’s Downloads folder for example:
sudo git clone https://github.com/osmocom/rtl-sdr.git
Go to the folder rtl-sdr: cd rtl-sdr
sudo mkdir build
sudo cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
At this point I sometimes got an error because the pkg-config package was not found. Make:
sudo apt-get install pkg-config
and relaunch the cmake from above.
sudo make install
Osmocom source module installation
sudo apt-get install gr-osmosdr
GNU Radio launch
You have to be in graphics mode to be able to use this superb signal processing design tool. Personally, I use my orange-pi or raspberry in remote mode. I connect to them by enabling VNC in setup and using the VNC extension in chrome on my PC. On a terminal in graphics mode type:
A message “RANDR” missing … is not important.
Error Xterm executable is missing
If you have when launching a model in gnuradio companion a message of the type Xterm executable is missing and if you are on Armbian or Raspbian (raspberry) go to the configuration folder.
sudo nano grc.conf
and add at the end of the file:
[grc] xterm_executable = /usr/bin/lxterminal
First of all, check that the terminal is installed on your machine. Otherwise installed it with:
sudo apt install lxterminal
To enter data from HackRF One or RTL-SDR, use the Osmocom source module in GNU-Radio.
It is not necessary to identify the SDR if only one is connected to the processing board. For the gains, it is necessary to make tests to find the good values according to the model of SDR.
Note On Hack RF Gains
HackRF One provides:
- RX : three different analog gain controls
- RF (“amp”, 0 or 14 dB),
- IF (“lna”, 0 to 40 dB in 8 dB steps),
- baseband (“vga”, 0 to 62 dB in 2 dB steps)
- TX : two gain controls
- RF (0 or 14 dB) ,
- IF (0 to 47 dB in 1 dB steps)
The RX and TX, RF amplifiers have two settings: on or off. In the off state, the amps are completely bypassed. They nominally provide 14 dB of gain when on, but the actual amount of gain varies by frequency. In general, expect less gain at higher frequencies.
Note on RTL-SDR Gains
Only the RF gain parameter acts on the RTL-SDR. You can get the available gain values provided that the RTL-SDR was not started by an application. In a terminal window type:
root@opi-onep-70:~# rtl_test Found 1 device(s): 0: Realtek, RTL2838UHIDIR, SN: 00000001 Using device 0: Generic RTL2832U OEM Detached kernel driver Found Rafael Micro R820T tuner Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 [R82XX] PLL not locked! Sampling at 2048000 S/s. Info: This tool will continuously read from the device, and report if samples get lost. If you observe no further output, everything is fine.
In the case of several SDRs connected to the processing card, they must be identified. For a hackrf type in a terminal hackrf_info and retrieve the serial number and put it in the ‘Device Arguments’ box. Ex:
For an RTL-SDR, type rtl_eeprom and put the serial number. Ex:
The difficulty with RTL-SDRs is that they all carry the serial number 1 when they are manufactured. You can reprogram this number by typing:
rtl_eeprom -s 'numéro de série'
With the rtl_eeprom -h command, we have the corresponding help.
The HackRF being developed in Open Source can be bought in China at Aliexpress for a hundred Euros. To use it, the Orange Pi solution is very interesting. We forget the Orange Pi Zero which, following the treatment defined in GNU-RADIO, quickly risks running out of power. We are going to move towards 64-bit 4-core processors like the H5 or the H6. I have successfully tested Orange Pi PC2 H5 and Orange PI One Plus H6 for SSB reception and SSB transmission.
The Orange PI PC2 has the following advantages:
- several USB2 if you want to connect different SDRs
- An audio output on headphone jack, useful for an HF receiver
The Orange PI One Plus has the following advantages:
- The minimum required to control a Hack RF or a RTL-SDR from the network (USB, Ethernet 1Gb / s)
- A very low price: less than 30 € with food and transport (Ebay or Aliexpress)
Posts on Remote-SDR
- Remote SDR v2 – Raspberry 4B image installation
- Remote SDR – Examples of realization
- Transmit over QO-100 satellite with a Smartphone
- Remote SDR V2 – Software Architecture
- Remote SDR v2 – Tips
- Remote SDR v2 – Orange Pi One Plus or Orange Pi Zero 2 image installation
- Remote SDR V2 – Manual installation
- Remote SDR V2
- Remote SDR V1- Purchase
- Remote SDR V1 – Setup
- HackRF – RTL-SDR – GNU RADIO Setup
- Remote SDR V1 – Man Machine Interface
- Remote SDR V1 – Signal Processing
- Remote SDR V1
- Web Client to GNU Radio
- GNU Radio to Web client
- Remote SSB Transmitter
- Remote SSB Receiver
- GPIO on Orange PI One Plus H6
- TCXO installation on HackRF
- Q0-100 Transceiver with 2 SDR – Remote SDR V1