Modern digital communications: a hands-on approach

COM-430

Installing the Support Package for USRP® Radio (Python)

This page is part of the content downloaded from Installing the Support Package for USRP® Radio (Python) on Wednesday, 25 December 2024, 17:28. Note that some content and any files larger than 50 MB are not downloaded.

Page content

Using the USRP boards with Python requires the installation of several libraries and dependencies. However, the installation process is very OS (Operating System)-specific and also depends on the particular configuration of your OS.  In order to keep everyone on the same page, we have created a Virtual Machine (VM) which you can use to interact with the USRP hardware.

Although the installation instructions might seem a bit lengthy, the whole procedure takes about 10 minutes (plus the download time).

Note that the user interfaces might slightly differ depending on your particular OS. If in doubt with any of the steps detailed below, please check with us.

If you are using Ubutu, you can simply use the commands bellow in order to install the needed libraries (tested for releases 20.04, 22.04 and 24.04):

$ sudo add-apt-repository -y ppa:ettusresearch/uhd
$ sudo apt update
$ sudo apt install -y libusb-1.0-0 udev libuhd-dev uhd-host soapysdr-module-uhd python3-soapysdr
$ sudo uhd_images_downloader

If all the above worked fine, there is no need to install a VM. Otherwise, please check with us, we can try to find a solution before installing the VM.

For all the other operating systems, you need to install a VM as follows:

1. Install VirtualBox: please refer to VirtualBox download page.

2. Create a new VM:

  • Download the image file we have prepared for you from this link. Make sure you have enough space on your computer (the image file is about 18 GB).
  • Open VirtualBox (Mac users need to launch VirtualBox from a terminal with "sudo virtualbox")
  • Click on the "New" button in VirtualBox
  • Name: MDC-USRP; Folder: the MDC-USRP-VM folder which you dowloaded above; Type: Linux; Version: Ubuntu (64 bit). (Click "Next")
  • Assign 2048 MB for the memory and 2 CPU cores. (Click "Next")
  • Select "Use an existing Virtual Hard Disk File" and select the .vdi file provided in the MDC-USRP-VM folder.
  • Click "Finish"

3. Shared Folder:

Set up a shared folder in order to be able to access the files within it from both your host machine and the newly installed VM. Note that in this shared folder you will find the code needed to run the USRP transceiver (available on Moodle as well). Since this folder is shared with your host computer, you can edit the code on the host machine with an editor of your choice. You will need the VM just to run the code.

Click "Settings" --> "Shared Folders" --> "Add new shared folder" (Click on the button with the blue folder and green "+" sign). Choose the "Shared" folder from MDC-USRP-VM. Specify the mount path to be: /home/mdc/shared

Check "Auto-mount" and "Make Permanent".

4. (Optional) Shared Clipboard:

In order to be able to copy-paste between the host machine  and the VM, you need to enable the shared clipboard. First, you need to install the VM VirtualBox Extension Pack. Then you can enable the shared clipboard by clicking on "Settings" --> "General" --> "Advanced" --> "Shared Clipboard" and choose "Biderectional". Note: we have noticed that the shared clipboard does not really work on MacOS.

5. Video Memory:

Allocate more video memory by choosing "Settings" --> "Display". Choose 64 MB.

6. USB ports access:

In order to access the USRP over the USB, you need to make the USB ports available to the VM.

  • Plug in the USRP via USB
  • Click "Settings" --> "USB"
  • Select "USB 3.0"
  • Press "Add USB" (Button: USB with green "+" sign). Choose "Cypress WestBridge"
  • Launch the VM, open a terminal and type "lsusb" in order to verify that the "Ettus Research LLC USRP" device is present.
  • Note: you might find that the display resolution of the VM is not quite satisfactory. You can change that by clicking the blue icon in the upper-left corner and then "Settings" --> "Display", to choose a resolution of your choice and then click "Apply". However, by changing the display resolution, you might experience a very intense load on the processors of your machine. So if you can live with the default installed resolution, then it might be better not to change it.
  • In the terminal, run "sudo uhd_images_downloader"
  • Still in the terminal, run "/usr/lib/uhd/utils/b2xx_fx3_utils". Even if this results in an error, proceed with the next step.
  • Click on "Devices" --> "USB" --> "Ettus Research LLC USRP" 
  • Verify that the board is working using "uhd_usrp_probe" in the terminal
  • Power off the VM
  • Click on "Settings" --> "USB" --> "Add USB" (USB icon with green "+" sign). With the USRP connected to the host machine, choose the "Ettus Research LLC USRP" device.
  • Note: each time the USRP board is disconnected, you will need to run in a terminal the command "/usr/lib/uhd/utils/b2xx_fx3_utils" or "uhd_usrp_probe".

That's all, folks! Enjoy the VM and the USRP transceiver! ;-)