- Great Scott Gadgets provides some commandline tools for interacting with HackRF.
- hackrf_info Read device information from HackRF such as serial number and firmware version.
- hackrf_transfer Send and receive signals using HackRF. Input/output files are 8-bit signed quadrature samples.
- hackrf_sweep, a command-line spectrum analyzer.
- hackrf_clock Read and write clock input and output configuration.
- hackrf_operacake Configure Opera Cake antenna switch connected to HackRF.
- hackrf_spiflash A tool to write new firmware to HackRF. See: Updating Firmware.
- hackrf_debug Read and write registers and other low-level configuration for debugging.
[-h] # this help [-d serial_number] # Serial number of desired HackRF [-a amp_enable] # RX RF amplifier 1=Enable, 0=Disable [-f freq_min:freq_max] # minimum and maximum frequencies in MHz [-p antenna_enable] # Antenna port power, 1=Enable, 0=Disable [-l gain_db] # RX LNA (IF) gain, 0-40dB, 8dB steps [-g gain_db] # RX VGA (baseband) gain, 0-62dB, 2dB steps [-w bin_width] # FFT bin width (frequency resolution) in Hz, 2445-5000000 [-1] # one shot mode [-N num_sweeps] # Number of sweeps to perform [-B] # binary output [-I] # binary inverse FFT output -r filename # output file
date, time, hz_low, hz_high, hz_bin_width, num_samples, dB, dB, ...
hackrf_sweep -f 2400:2490 gives the following example results:
|Date||Time||Hz Low||Hz High||Hz bin width||Num Samples||dB||dB||dB||dB||dB|
Each sweep across the entire specified frequency range is given a single time stamp.
The fifth column tells you the width in Hz (1 MHz in this case) of each frequency bin, which you can set with
-w. The sixth column is the number of samples analyzed to produce that row of data.
Each of the remaining columns shows the power detected in each of several frequency bins. In this case there are five bins, the first from 2400 to 2401 MHz, the second from 2401 to 2402 MHz, and so forth.