Quick Start
1. Download the GNU Radio Live SDR Environment found here.
This is an Ubuntu image that comes with the GNU Radio and other third party software pre-installed in order for quick and easy testing and experimentation with GNU Radio without having to fully install the image to your laptop or desktop.
Because you cannot permanently install this image, it is suggested to either:
a. Download and run GNU Radio as well as the other third-party software natively on your OS (compatibility varies). My first attempt was on Windows and was documented here.
b. Install Ubuntu/Debian and use the Linux packages that are provided to follow the rest of the lessons.
2. Create a bootable USB Drive/CD and boot to the GNU Radio Live SDR Environment.
3. Plug in the HackRF device (this may involve switching the module to HackRF Mode!)
4. Run the command:
hackrf_info
If your setup was unsuccessful, it will say
No HackRF boards found.
If your setup was successful it will give an output similar to this:
Found HackRF board 0:
USB descriptor string: 00000....75f
Board ID Number: 2 (HackRF One)
Firmware Version: 2017.02.1
Part ID Number: 0xa000cb3c 0x006d4363
Serial Number: 0x000....
5. Copy the code from here into a file called radio.py and run the code using the command python radio.py
A GUI should pop up displaying the FFT plot of the frequencies. Currently in the lab, one of the strongest signals occurs at 94.7M. Tune the radio to this frequency and you should easily hear the radio station play music.
Full Method
1. Install the full version of Ubuntu, do not use a virtual machine because the virtualization of the USB port is not fast enough for HackRF.
2. Run the command sudo apt-get install gqrx-sdr. This command installs the packages and dependencies that are needed to use GNURadio on Ubuntu.
3. Run the command sudo apt-get install hackrf. This command installs the packages and the dependencies that are needed to use the HackRF on Ubuntu. After installing this package, you can run the command hackrf_info to verify that the system detects the board.
4. Create a workspace and create the a file called dial_tone.py. We will attempt to create a simple dial tone that is the combination of two sinusoids at two different frequencies. The source code and detailed explanation of the code can be found here.
5. Run the program using the command python dial_tone.py. Your speakers should now be playing a dial tone.
6. We will now attempt to get the HackRF to transmit on a particular frequency. The instructions I will be following can be found here. In my opinion, the most intuitive way to generate this Python code is to use the GNU Radio Companion that can be accessed by running the command gnuradio-companion. We can construct our system in this companion and then export the Python code where we can then programmatically alter the code and variables as needed. To see me working with the GNU Radio Companion you can follow use this as a guide to create a flow.
7. The File Source block is found in [File Operators]. The Short to Float block is found in [Type Converters]. The Multiply Const block is found in [Math Operators]. The WBFM Transmit (Wide Band Frequency Modulation) block is found in [Modulators]. The osmocom Sink block is found in [Sinks]. The QT GUI Sink is found in [Instrumentation]. Construct the flow as I have layed out:
After pressing the play button without errors, it should generate the python file top_block.py. If you run the command python top_block.py it will execute this flow.
8. We want to generate an audio stream, to do so run the following commands in a separate terminal window in the same directory (best done in TMux).
mkfifo stream.fifo
mpg123 -r32000 -m -s http://maxxima.mine.nu:8000 > stream.fifo
9. Execute our flow and tune a radio (which can be found on my desk, it's red) and tune it to 108MHz. You should be able to hear the radio station that is streamed if you click the URL on the physical Red Radio.
10. You can find the tutorial on how to build an FM Receiver from my tutorial here, this was done in the Windows version of the GNU Radio Companion, however; the steps should remain the same.