DSP Algorithms for RF Systems

Buy the Book!

DSP for Beginners: Simple Explanations for Complex Numbers! The second edition includes a new chapter on complex sinusoids.

Installing GNU Radio and B200 mini SDR
November 1, 2023

Table of Contents

Introduction

This blog demonstrates a quick way to install GNU Radio via apt and how to properly configure your system to load the firmware for the Ettus Research B200 mini SDR hardware.

More blogs!

Ubuntu 22.04 LTS

The first step is downloading and installing Ubuntu 22.04 LTS. There are ways to install on other operating systems on the GNU Radio Wiki but I will focus on running in Ubuntu in this blog post.

If this is your first time installing GNU Radio I highly suggest doing so in a virtual machine, VirtualBox and VMware are two ways to do this. The following commands will update and install packages that could change dependencies and break some existing installs. A virtual machine will protect your host system from any changes needed to install GNU Radio.

Installing GNU Radio & Other Tools

I prefer to install the default GNU Radio version as provided by apt, which is version v3.10 at the time of writing this blog. You install GNU Radio via apt by:

$ sudo apt-get install -y gnuradio

I also recommend installing a package from Ettus Research who makes the B200-mini radio used later:

$ sudo apt-get install -y uhd-host

You will also need the locate tool later in the tutorial, which you can install by:

$ sudo apt-get install locate

Starting to Load the Firmware with uhd_find_devices

The B200-mini has volatile memory, meaning once the power is disconnected it loses it’s current configuration and needs to be reloaded once it’s powered on again.

Connect the B200-mini to your computer via USB cable and then run the following command to ensure the device is connected:

$ uhd_find_devices

UHD is the software interface developed and maintained by Ettus Research to communicate and configure their software radios. The command may present you with a similar message as follows:

$ uhd_find_devices
[INFO] [UHD] linux; GNU C++ version 11.2.0; Boost_107400; UHD_4.1.0.5-3
[WARNING] [B200] EnvironmentError: IOError: Could not find path for image: usrp_b200_fw.hex
Using images directory: <no images directory located>
Set the environment variable 'UHD_IMAGES_DIR' appropriately or follow the below instructions to download the images package.
Please run:
"/lib/x86_64-linux-gnu/uhd/utils/uhd_images_downloader.py"
No UHD Devices Found

The firmware for the B200-mini is not currently stored on my system, but the uhd_images_downloader.py script will perform the download.

Running the command,

$ /lib/x86_64-linux-gnu/uhd/utils/uhd_images_downloader.py

gives the following error:

bash: /lib/x86_64-linux-gnu/uhd/utils/uhd_images_downloader.py: No such file or directory

A frustrating error! The script is available, it just needs to be found.

Finding and Running uhd_images_downloader.py

The locate command can be used to find files across your entire filesystem, but it needs to be updated first:

$ sudo updatedb

Then find the location of uhd_find_devices.py by:

$ locate uhd_images_downloader.py

Running the command printed the following path on my system:

/usr/lib/uhd/utils/uhd_images_downloader.py

The firmware can then be downloaded with the command:

$ sudo /usr/lib/uhd/utils/uhd_images_downloader.py

It will take a couple of minutes to download all of the files. The following is the text that was displayed when I ran the command:

[INFO] Using base URL: https://files.ettus.com/binaries/cache/
[INFO] Images destination: /usr/share/uhd/images
[INFO] No inventory file found at /usr/share/uhd/images/inventory.json. Creating an empty one.
09146 kB / 09146 kB (100%) x4xx_x410_fpga_default-g26793b8.zip
21085 kB / 21085 kB (100%) x3xx_x310_fpga_default-g26793b8.zip
19610 kB / 19610 kB (100%) x3xx_x300_fpga_default-g26793b8.zip
01153 kB / 01153 kB (100%) e3xx_e310_sg1_fpga_default-g26793b8.zip
01138 kB / 01138 kB (100%) e3xx_e310_sg3_fpga_default-g26793b8.zip
10156 kB / 10156 kB (100%) e3xx_e320_fpga_default-g26793b8.zip
20731 kB / 20731 kB (100%) n3xx_n310_fpga_default-g26793b8.zip
14323 kB / 14323 kB (100%) n3xx_n300_fpga_default-g26793b8.zip
27221 kB / 27221 kB (100%) n3xx_n320_fpga_default-g26793b8.zip
00481 kB / 00481 kB (100%) b2xx_b200_fpga_default-g26793b8.zip
00463 kB / 00463 kB (100%) b2xx_b200mini_fpga_default-g26793b8.zip
00882 kB / 00882 kB (100%) b2xx_b210_fpga_default-g26793b8.zip
00511 kB / 00511 kB (100%) b2xx_b205mini_fpga_default-g26793b8.zip
00167 kB / 00167 kB (100%) b2xx_common_fw_default-g7f7d016.zip
00007 kB / 00007 kB (100%) usrp2_usrp2_fw_default-g6bea23d.zip
00450 kB / 00450 kB (100%) usrp2_usrp2_fpga_default-g6bea23d.zip
02415 kB / 02415 kB (100%) usrp2_n200_fpga_default-g6bea23d.zip
00009 kB / 00009 kB (100%) usrp2_n200_fw_default-g6bea23d.zip
02757 kB / 02757 kB (100%) usrp2_n210_fpga_default-g6bea23d.zip
00009 kB / 00009 kB (100%) usrp2_n210_fw_default-g6bea23d.zip
02123 kB / 02123 kB (100%) n230_n230_fpga_default-ge57dfe0.zip
00319 kB / 00319 kB (100%) usrp1_usrp1_fpga_default-g6bea23d.zip
00522 kB / 00522 kB (100%) usrp1_b100_fpga_default-g6bea23d.zip
00006 kB / 00006 kB (100%) usrp1_b100_fw_default-g6bea23d.zip
00017 kB / 00017 kB (100%) octoclock_octoclock_fw_default-g14000041.zip
04839 kB / 04839 kB (100%) usb_common_windrv_default-g14000041.zip
[INFO] Images download complete.

Now run uhd_find_devices again:

$ uhd_find_devices

If you see your device, congratulations! You can then skip to the “Starting GNU Radio Companion” section of the tutorial. Otherwise, yo may see an error like the following:

$ uhd_find_devices
[INFO] [UHD] linux; GNU C++ version 11.2.0; Boost_107400; UHD_4.1.0.5-3
[ERROR] [USB] USB open failed: insufficient permissions.
See the application notes for your device.

No UHD Devices Found

Now you’ll need to install the proper rules.d file.

Installing uhd-usrp.rules into /etc/udev/rules.d/

A udev file allows non-root users to access USB devices. Ettus Research provides a uhd-usrp.rules file to give the proper permissions for accessing their USB-based software radios. Using the locate command, you can find the location of that file:

$ locate uhd-usrp.rules

For my system, it displayed the path:

/usr/lib/uhd/utils/uhd-usrp.rules

The file need to be copied into the rules.d/ directory:

$ sudo cp /usr/lib/uhd/utils/uhd-usrp.rules /etc/udev/rules.d/

The udev rules need to be reloaded:

$ sudo udevadm control --reload-rules
$ sudo udevadm trigger

Running uhd_find_devices should now load the firmware and display details about your software radio:

$ uhd_find_devices
[INFO] [UHD] linux; GNU C++ version 11.2.0; Boost_107400; UHD_4.1.0.5-3
[INFO] [B200] Loading firmware image: /usr/share/uhd/images/usrp_b200_fw.hex...
--------------------------------------------------
-- UHD Device 0
--------------------------------------------------
Device Address:
serial: XXXXXXXX
name: B200mini
product: B200mini
type: b200

Starting GNU Radio Companion

GNU Radio and the supporting libraries and tools for the B200-mini software radio has been installed! You can now confirm that GNU Radio has been installed properly by starting GNU Radio Companion:

$ gnuradio-companion &

You should now see a window display that looks like the following:

Starting GNU Radio Companion
Starting GNU Radio Companion

Conclusion

The blog described how to install GNU Radio via apt and the tools necessary to configure and load the B200 mini SDR hardware. Solutions to incorrect paths were resolved using the locate command for the uhd_find_devices and uhd_images_downloader.py tools.

More blogs!

Leave a Reply

For everything there is a season, and a time for every matter under heaven. A time to cast away stones, and a time to gather stones together. A time to embrace, and a time to refrain from embracing. Ecclesiastes 3:1,5
The earth was without form and void, and darkness was over the face of the deep. And the Spirit of God was hovering over the face of the waters. Genesis 1:2
Behold, I am toward God as you are; I too was pinched off from a piece of clay. Job 33:6
Enter His gates with thanksgiving, and His courts with praise! Give thanks to Him; bless His name! Psalm 100:4
Lift up your hands to the holy place and bless the Lord! Psalm 134:2
Blessed is the man who trusts in the Lord, whose trust is the Lord. He is like a tree planted by water, that sends out its roots by the stream, and does not fear when heat comes, for its leaves remain green, and is not anxious in the year of drought, for it does not cease to bear fruit. Jeremiah 17:7-8
He said to him, “You shall love the Lord your God with all your heart and with all your soul and with all your mind. This is the great and first commandment. And a second is like it: You shall love your neighbor as yourself. On these two commandments depend all the Law and the Prophets.” Matthew 22:37-39
Then He said to me, “Prophesy over these bones, and say to them, O dry bones, hear the word of the Lord. Thus says the Lord God to these bones: Behold, I will cause breath to enter you, and you shall live." Ezekiel 37:4-5
Riches do not profit in the day of wrath, but righteousness delivers from death. Proverbs 11:4
The angel of the Lord appeared to him in a flame of fire out of the midst of a bush. He looked, and behold, the bush was burning, yet it was not consumed. And Moses said, “I will turn aside to see this great sight, why the bush is not burned.” When the Lord saw that he turned aside to see, God called to him out of the bush, “Moses, Moses!” And he said, “Here I am.” Exodus 3:2-3
Daniel answered and said: “Blessed be the name of God forever and ever, to whom belong wisdom and might. He changes times and seasons; He removes kings and sets up kings; He gives wisdom to the wise and knowledge to those who have understanding." Daniel 2:20-21
Now the Lord is the Spirit, and where the Spirit of the Lord is, there is freedom. 2 Corinthians 3:17
Previous slide
Next slide

This website participates in the Amazon Associates program. As an Amazon Associate I earn from qualifying purchases.

© 2021-2024 Wave Walker DSP