wiki:Tutorials/Wireless/BasicUsage

Site Navigation

  1. COSMOS Testbed Overview
    1. Concepts
    1. Testbed Workflow
    1. Availability and Resource Status
    1. Events and Conferences
  2. Getting Started
    1. Make an Account
    2. Create and Configure SSH Keys
    3. Make a Reservation
    4. Log in to your Reservation
    5. Control Resources with OMF
    6. Run a Hello World Experiment
    7. Get Help and Support
  3. COSMOS/ORBIT User Guide
    1. The COSMOS Portal
    2. Connecting to the Testbed
    3. Running Experiments
    4. Policies and Support
    5. Quick Links
    1. Policies
    1. Account Creation
    1. Camera Streaming
    1. Scheduling and Reservations
    1. Disk Images
    1. Frequently Asked Questions
    1. Resource Control with OMF
  4. COSMOS Portal
    1. Your First Visit
    2. Setting Up Your Account
    3. Reserving Testbed Time
    4. Monitoring Your Experiment
    5. Connecting via SSH
    6. Managing Disk Images
    7. Joining the Community
    8. Browsing Users and Groups
    9. Tips
  5. Account Management
    1. Edit Profile
    2. Change Password
    3. SSH Keys
  6. Portal Dashboard
    1. Profile Card
    2. Usage Statistics
    3. Community Forum
  7. Directory
    1. Users
    2. Groups
    3. Privacy Note
  8. Disk Images
    1. Browsing Images
    2. Image Details
    3. Searching and Sorting
    4. Managing Your Images
    5. Baseline Images
    6. Saving Custom Images
    7. Storage and Retention
  9. Community Forum
    1. Accessing the Forum
    2. Forum Categories
    3. How to Use the Forum
    4. Forum Etiquette
    5. Privacy and Access
  10. Getting Started with the COSMOS Portal
    1. Creating an Account
    2. Logging In
    3. What to Do After Logging In
  11. SSH Access to Testbed Nodes
    1. Access Model
    2. Console Servers
    3. Basic Connection
    4. SSH Config File
    5. SSH Tunneling
    6. File Transfer
    7. Troubleshooting
  12. Scheduler
    1. Calendar View
    2. Reservation Colors
    3. Creating a Reservation
    4. Competing for a Slot
    5. Modifying or Canceling Reservations
    6. My Reservations
    7. Resource Information
  13. Testbed Status
    1. Node Status Grid
    2. RF Matrix Control (SB4)
    3. Understanding Node States During Experiments
    1. Remote Access
    1. Chrome Remote Desktop Setup Page
  14. Installing Chrome Remote Desktop (CRD) on a Custom Image
    1. Measurement & Result Collection
    1. Storage
    1. Support
    1. Contributing to the Wiki
  15. Tutorials
    1. SDR and Wireless
    2. Wireless Digital Twins
    3. Optical Networking
    4. Wired Networking
    5. Edge Computing
    6. 4G/5G Systems
    7. Orchestration Platforms
  16. Architecture
    1. Data Flow
    1. Deployment Map
    1. Domains
    1. Naming Convention
    1. Networks
    1. Optical
  17. Resources, Services and APIs
    1. RF Control
    2. SDR Control
    3. Compute Control
    4. Network Control
    5. Optical Control
  18. Datasets
  19. Hardware Info
    1. Cameras
    1. Compute
    1. FR3 SDRs
    1. Network
    1. Nodes
    1. Optical
    1. RF Subsystems
    1. Antennas
    1. Full-Duplex Radio
    1. RF Front End
    1. Software Defined Radios (SDR)
  20. RF Policies & Compliance
    1. Outdoor Radio Frequency Allocation
    2. Program Experiment License
    3. Spectrum Monitoring
    4. Emergency Stop Procedures
    5. Network and Platform Security

Basic usage

Description

In this tutorial we'll demonstrate how to navigate from the COSMOS sandbox to a single SDR on a node and run an application to read samples from the SDR.

Prerequisites

In order to access the test bed, create a reservation and have it approved by the reservation service. Access to the resources are granted after the reservation is confirmed. Please follow the process shown on the COSMOS work flow page to get started.

Resources required

For this example we used one USRP 2974 SDR on sandbox 1.

Tutorial Setup

Follow the steps below to gain access to this console and set up your node with an appropriate image.

  1. Sign up for a COSMOS account.
  2. Create a resource reservation for sandbox 1.
  3. Once reservation is approved, login into the console.
  4. Use OMF commands to load baseline-sdr.ndz image on your resource.
    omf load -i baseline-sdr.ndz -t sdr2-s1-lg1
    
  5. Once the node is successfully imaged, turn it on and check the status
    omf tell -a on -t sdr2-s1-lg1
    
    omf stat -t sdr2-s1-lg1
    
  6. After giving it some time to power up and boot, ssh to the node
    ssh root@sdr2-s1-lg1
    

When opening a terminal into console.sb1.cosmos-lab.org set up a tunnel from localhost:5002 to sdr2-s1-lg1.sb1.cosmos-lab.org:9002. This will be used by the web app to connect to a server running on the USRP 2974(Krypton)'s host.

Experiment Execution

Configure and detect the radio

  • The USRP 2974 requires a PCIe driver to control the FPGA with the embedded PC. In the provided images, this will load automatically on boot. If it has issues, you can run it manually via systemctl restart niusrprio.service.

Detailed steps for driver installation and radio detection are on the Krypton usage page. There is also a trouble shooting section at the bottom on that page to update the Krypton's internal firmware if necessary.

  • Run uhd_find_devices' and check if the X310 is detected
    root@sdr2-s1-lg1:~# uhd_find_devices --args="type=x300"
    [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.HEAD-0-gaea0e2de
    --------------------------------------------------
    -- UHD Device 0
    --------------------------------------------------
    Device Address:
        serial: 3171336
        fpga: HG
        name:
        product: X310
        resource: RIO0
        type: x300
    
    

The output enumerates all the SDRs that were detected. Krypton has only one PCIe radio device of type=x300.

  • Use the uhd_usrp_probe command to get more details on the x300. Specifying resource=rio0 ensures only the directly connected radio is probed, instead of the radios on the network.
    root@sdr2-s1-lg1:~# uhd_usrp_probe --args="resource=rio0,type=x300"
    [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.HEAD-0-gaea0e2de
    [INFO] [X300] X300 initialization sequence...
    [INFO] [X300] Connecting to niusrpriorpc at localhost:5444...
    [INFO] [X300] Using LVBITX bitfile /usr/local/share/uhd/images/usrp_x310_fpga_HG.lvbitx
    [INFO] [X300] Radio 1x clock: 200 MHz
    [INFO] [GPS] Found an internal GPSDO: LC_XO, Firmware Rev 0.929b
    [INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000000)
    [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1311 MB/s)
    [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1303 MB/s)
    [INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000000001)
    [INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000000001)
    [INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000)
    [INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000)
    [INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000000)
    [INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000000)
      _____________________________________________________
     /
    |       Device: X-Series Device
    |     _____________________________________________________
    |    /
    |   |       Mboard: NI-2974
    |   |   revision: 12
    |   |   revision_compat: 7
    |   |   product: 31131
    |   |   mac-addr0: 00:80:2f:26:08:92
    |   |   mac-addr1: 00:80:2f:26:08:93
    |   |   gateway: 192.168.10.1
    |   |   ip-addr0: 192.168.10.2
    |   |   subnet0: 255.255.255.0
    |   |   ip-addr1: 192.168.20.2
    |   |   subnet1: 255.255.255.0
    |   |   ip-addr2: 192.168.30.2
    |   |   subnet2: 255.255.255.0
    |   |   ip-addr3: 192.168.40.2
    |   |   subnet3: 255.255.255.0
    |   |   serial: 3171336
    |   |   FW Version: 6.0
    |   |   FPGA Version: 36.0
    |   |   FPGA git hash: fde2a94
    |   |   RFNoC capable: Yes
    |   |
    |   |   Time sources:  internal, external, gpsdo
    |   |   Clock sources: internal, external, gpsdo
    |   |   Sensors: gps_gpgga, gps_gprmc, gps_time, gps_locked, gps_servo, ref_locked
    |   |     _____________________________________________________
    |   |    /
    |   |   |       RX Dboard: A
    |   |   |   ID: UBX-TDD (0x0203)
    |   |   |   Serial: 318D9DE
    |   |   |     _____________________________________________________
    |   |   |    /
    |   |   |   |       RX Frontend: 0
    |   |   |   |   Name: UBX RX
    |   |   |   |   Antennas: TX/RX, RX2, CAL
    |   |   |   |   Sensors: lo_locked
    |   |   |   |   Freq range: 10.000 to 6000.000 MHz
    |   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB
    |   |   |   |   Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz
    |   |   |   |   Connection Type: IQ
    |   |   |   |   Uses LO offset: No
    |   |   |     _____________________________________________________
    |   |   |    /
    |   |   |   |       RX Codec: A
    |   |   |   |   Name: ads62p48
    |   |   |   |   Gain range digital: 0.0 to 6.0 step 0.5 dB
    |   |     _____________________________________________________
    |   |    /
    |   |   |       RX Dboard: B
    |   |   |   ID: UBX-TDD (0x0203)
    |   |   |   Serial: 318D9EF
    |   |   |     _____________________________________________________
    |   |   |    /
    |   |   |   |       RX Frontend: 0
    |   |   |   |   Name: UBX RX
    |   |   |   |   Antennas: TX/RX, RX2, CAL
    |   |   |   |   Sensors: lo_locked
    |   |   |   |   Freq range: 10.000 to 6000.000 MHz
    |   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB
    |   |   |   |   Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz
    |   |   |   |   Connection Type: IQ
    |   |   |   |   Uses LO offset: No
    |   |   |     _____________________________________________________
    |   |   |    /
    |   |   |   |       RX Codec: B
    |   |   |   |   Name: ads62p48
    |   |   |   |   Gain range digital: 0.0 to 6.0 step 0.5 dB
    |   |     _____________________________________________________
    |   |    /
    |   |   |       TX Dboard: A
    |   |   |   ID: UBX-TDD (0x0202)
    |   |   |   Serial: 318D9DE
    |   |   |     _____________________________________________________
    |   |   |    /
    |   |   |   |       TX Frontend: 0
    |   |   |   |   Name: UBX TX
    |   |   |   |   Antennas: TX/RX, CAL
    |   |   |   |   Sensors: lo_locked
    |   |   |   |   Freq range: 10.000 to 6000.000 MHz
    |   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB
    |   |   |   |   Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz
    |   |   |   |   Connection Type: QI
    |   |   |   |   Uses LO offset: No
    |   |   |     _____________________________________________________
    |   |   |    /
    |   |   |   |       TX Codec: A
    |   |   |   |   Name: ad9146
    |   |   |   |   Gain Elements: None
    |   |     _____________________________________________________
    |   |    /
    |   |   |       TX Dboard: B
    |   |   |   ID: UBX-TDD (0x0202)
    |   |   |   Serial: 318D9EF
    |   |   |     _____________________________________________________
    |   |   |    /
    |   |   |   |       TX Frontend: 0
    |   |   |   |   Name: UBX TX
    |   |   |   |   Antennas: TX/RX, CAL
    |   |   |   |   Sensors: lo_locked
    |   |   |   |   Freq range: 10.000 to 6000.000 MHz
    |   |   |   |   Gain range PGA0: 0.0 to 31.5 step 0.5 dB
    |   |   |   |   Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz
    |   |   |   |   Connection Type: QI
    |   |   |   |   Uses LO offset: No
    |   |   |     _____________________________________________________
    |   |   |    /
    |   |   |   |       TX Codec: B
    |   |   |   |   Name: ad9146
    |   |   |   |   Gain Elements: None
    |   |     _____________________________________________________
    |   |    /
    |   |   |       RFNoC blocks on this device:
    |   |   |
    |   |   |   * DmaFIFO_0
    |   |   |   * Radio_0
    |   |   |   * Radio_1
    |   |   |   * DDC_0
    |   |   |   * DDC_1
    |   |   |   * DUC_0
    |   |   |   * DUC_1
    
    

Configure and run the application

  • Go back to SandBox1 console, download the application source code from the attachment section below and copy it to the SDR.
    username@console:~$ wget https://wiki.cosmos-lab.org/raw-attachment/wiki/Tutorials/Wireless/BasicUsage/spectrum_view.tar.gz
    username@console:~$ scp spectrum_view.tar.gz root@sdr2-s1-lg1:~/
    
  • Untar the source code.
    root@sdr2-s1-lg1:~# tar -zxvf spectrum_view.tar.gz
    root@sdr2-s1-lg1:~# cd SPECTRUM_VIEW
    
  • Please refer to the README file in SPECTRUM_VIEW directory for instructions on compiling and running the application. Before compiling install a few required libraries.
    root@sdr2-s1-lg1:~/SPECTRUM_VIEW# apt update
    root@sdr2-s1-lg1:~/SPECTRUM_VIEW# apt-get -y install libboost-program-options-dev libboost-system-dev libboost-thread-dev libboost-filesystem-dev libboost-regex-dev liblog4cxx-dev cmake libfftw3-dev libxml2-dev libpopt-dev libsqlite3-dev pkg-config libxml2-utils gnulib
    
  • Now compile and make the websocket library.
    root@sdr2-s1-lg1:~/SPECTRUM_VIEW# make websock
    
  • Lastly compile the application - this will generate the executable app_read_sdr_samples that reads samples from the SDR.
    root@sdr2-s1-lg1:~/SPECTRUM_VIEW# make
    
  • Run the application - this will start a server that listens for commands to configure the radio and stream received spectrum samples.
    root@sdr2-s1-lg1:~/SPECTRUM_VIEW# ./app_read_sdr_samples
    . INFO  21:17:51.808 (main.cpp:649) - Starting command server at 5180
     INFO  21:17:51.808 (main.cpp:171) - Starting websock server at 9002
    .....
    

Visualize spectrum samples

  • Download the spectrum visualizer web client to your desktop. It is all in another zip file - spectrum_view.zip. Unzip this folder and open spectrum_view.html in a Chrome browser.

When the viewer is first opened, the page display should be similar to the following

  • Set the localhost field to localhost:5002. (Recall from the set up section to create a tunnel from localhost:5002 to sdr2-s1-lg1.sb1.cosmos-lab.org:9002 since the app_read_sdr_samples application has a websock server listening on that address:port.)

Set the device type field to type=x300.

Click the connect button once and a "Websocket Connection" statement should be output by the application.

Now click on make to create a device handle.

The RF radio parameters are already populated with default values for 2.4 GHz WIFI band. To view other active spectrum bands change the RATE, FREQ, GAIN fields.

RF Parameter value description
RATE 25e6 Sampling rate
FREQ 2400e6 Center frequency
GAIN 30 Receive gain

Then click on Submit to update the SDR.

Click on the Halted button to begin streaming samples from the radio to the browser. This should display the spectrum if all went well.

Troubleshooting

Last modified 3 years ago Last modified on Oct 21, 2022, 2:54:59 PM

Attachments (7)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.