wiki:Tutorials/k0SDR/Tutorial01b

Version 15 (modified by nilanjan, 10 years ago) ( diff )

Simple radio example with GNURADIO benchmark scripts

Table of Contents

  1. SDR Tutorials
    1. Working with USRP2 - Universal Software Radio Peripheral
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Usage
      5. Capture waveform and record to file & add time-domain plot of waveform
      6. Troubleshooting
    1. Working with USRP X310
      1. Description
      2. Hardware / Software Resources Utilized
      3. Set Up
        1. Imaging
        2. Accessing the Nodes
        3. Configuring the Network Interface
        4. Setting up GNU Radio
      4. Building the GNU Radio Flowgraphs
        1. Transmitter
        2. Receiver
      5. Running the Experiment
      6. Troubleshooting
        1. xterm Executable Not Found
        2. FPGA Compatibility Mismatch
    1. Simple radio example with GNURADIO benchmark scripts
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Running GNU Radio benchmark scripts
      5. Outputs from transmitter and receiver
      6. Troubleshooting
    1. Simple radio example with GNURADIO benchmark scripts
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Running OEDL script and viewing results
      5. OEDL script
    1. OFDM radio example with GNURADIO benchmark scripts
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Running OEDL script
    1. Spectrum sensing with USRP2 and wiserd
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Generate signal source file using octave
      5. Set up transmitting node
      6. Set up receiving node(s)
    1. Spectrum sensing with USRP2 and wiserd (OEDL and OML)
      1. Description
      2. Hardware / Software Resources utilized
      3. Transmit predefined tone
      4. Record spectrum data to an OML file
      5. Performing the experiment using OEDL
    1. Transmitting wideband signals using USRP X310 and wiserd
      1. Description
      2. Transmitting a signal using wiserd
      3. Creating the signal
    1. Running DSC match script from the grid console
    1. Working with GNURadio and Nutaq ZeptoSDR
      1. Description
      2. Set up
      3. Run the GRC scripts
    1. Realtek 2832 EZCap - A Frugal SDR
      1. Prereqs
      2. A cheap spectrum analyzer
    1. MacSwitch (Obsolete)
      1. Prerequisites
      2. Start Mac Switch
    1. Zynq-based WISER platform - Start-up test
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Loading the Zedboard
      5. Running a start up test
    1. Zynq-based WISER platform - Spectrum Sensing
      1. Description
      2. Hardware / Software Resources utilized
      3. Set up
      4. Start spectrum sensing
    1. Zynq-based WISER platform - Spectrum sensing with multiple nodes (OEDL)
      1. Description
      2. Hardware / Software Resources utilized
      3. Spectrum sensing with an OEDL script
    1. Zynq-based WISER platform - Building the Firmware
      1. Description
      2. Getting the FPGA source code
      3. Building the FPGA design
      4. Building ARM core software
    1. Nutaq - PicoSDR start-up and configuration
      1. Description
      2. Set up
      3. Launch demo scripts
    1. Multi channel sample collection with x310
      1. Description
      2. Set up
      3. Collect samples
    1. Getting started with RFNoC X310
      1. Description
      2. Set up
      3. Find USRP X310s
      4. Program the FPGA
    1. Multi Channel Sample Processing & Visualization
      1. Hardware / software resources utilized
      2. Receive multi channel signal for processing and plotting
      3. Transmit a signal using a single usrp
    2. Plot the IQ Constellation of received signal
      1. Multi-channel Uhd STreamer (MUST)
      2. Description
      3. How it works (without going into the source-code :-D
      4. Source code & compilation
      5. Hardware interface application
      6. XML file
      7. Command server
      8. Usage Example
      9. Signal handler applications
      10. Tutorials
    1. Using two RFNoC streams simultaneously on a single USRP device
      1. Description
      2. Set Up
      3. Running the Simulation
    1. Using 2 transmit or 2 receive antennas simultaneously
      1. Description
      2. Set Up
      3. Running the Experiment
    1. Generate random transmissions emulating Primary Transmitters
      1. Description
      2. Set Up
      3. Running the Experiment
    1. RFNoC Spectrum Sensing
      1. Description
      2. Set Up
        1. Prepare Receive Node
        2. Prepare Receive USRPs
        3. Prepare Transmit Node
        4. Prepare Transmit USRP
        5. Set up SSH tunnel from your local port 5100 to grid.orbit-lab.org:5100
        6. Set up a web proxy for the receive node
      3. Run the experiment
    1. Full-Duplex Wireless using USRP N210
      1. Description
        1. Technical Report
        2. Updates
      2. Hardware / Software Resources Utilized
      3. Set Up
      4. Run the Experiments
      5. Example Experiment 1: A Real-Time Full-Duplex Radio with OFDM PHY (GNU …
      6. Example Experiment 2: A Simple Full-Duplex Radio Experiment (Terminal …
        1. In Terminal 1
          1. In Terminal 2 (SUB-20)
        2. A Secondary Transmitter Using Node13-8
        3. Acknowledgements
    1. LTE Traffic Trace Collection
      1. Description
      2. Setup OAI emulation framework
      3. Connecting UE to LTE network
      4. Connecting Multiple UEs
      5. Enabling OAI logging Module
      6. Application Design
      7. Running OAI using scripts
    1. Simple Radio Example with USRP X310 on ORBIT Sandbox 2
      1. Description
      2. Set Up
        1. Prepare the nodes
        2. Prepare network setup for USRP access
      3. Run the experiment
    1. Wideband Channel Sounding with USRP X310s
      1. Description
      2. Set Up
        1. Prepare Receive Node
        2. Prepare Receive USRPs
        3. Prepare Transmit Node
        4. Prepare Transmit USRP
        5. Set up SSH tunnel from your local port 5100 to grid.orbit-lab.org:5100
        6. Set up a web proxy for the receive node
      3. Run the experiment

Description

This example will utilize an OEDL experiment script to execute packet transfers over a radio link created using GNU Radio. This is will involve running a GNU Radio benchmark script two nodes each with a USRP2.

Hardware / Software Resources utilized

  1. Grid nodes with a USRP2 connect via Ethernet.
  2. baseline-12-04-gnu.ndz: disk image loaded onto nodes. This image has all the precompiled - software required to configure the USRP2s and all the required GNU Radio software libraries. The USRP2's interface with the node is already configured.
  3. GNU Radio - software library to create SDR. Click here for additional info.
  4. USRP2 - hardware platform for SDR. Click here for more info.

Set up

  • After logging into grid console, make sure all nodes are turned off
    nilanjan@console.grid:~$ omf tell -a offh -t system:topo:all
    
  • Verify state of node before continuing. Make sure all nodes are in the POWEROFF state.
    nilanjan@console.grid:~$ omf stat
    
  • Image nodes. Two (2) are required to run - check inventory status to find nodes with 2 similar USRP2s. In this examples we'll use node1-1 and node1-2.
    nilanjan@console.grid:~$ omf load -i baseline-12-04-gnu.ndz -t node1-1,node1-2
    
  • Turn nodes back on and verify they are in POWERON state
    nilanjan@console.grid:~$ omf tell -a on -t system:topo:imaged
    

Running OEDL script and viewing results

  • Run the experiment script using the following OMF command. The output is show as well.
    nilanjan@console.grid:~$ omf exec system:exp:gnu-benchmark
    
     INFO NodeHandler: OMF Experiment Controller 5.4 (git 3fb37b9)
     INFO NodeHandler: Reading configuration file /etc/omf-expctl-5.4/services.yaml
     INFO NodeHandler: Add domain http - http://internal1.orbit-lab.org:5054/
     INFO NodeHandler: Add domain http - http://repository1.orbit-lab.org:5054/
     INFO NodeHandler: Slice ID: default_slice (default)
     INFO NodeHandler: Experiment ID: default_slice-2014-07-17t14.20.09.457-04.00
     INFO NodeHandler: Message authentication is disabled
     INFO Experiment: load system:exp:stdlib
     INFO property.resetDelay: resetDelay = 230 (Fixnum)
     INFO property.resetTries: resetTries = 1 (Fixnum)
     INFO Experiment: load system:exp:eventlib
     INFO Experiment: load system:exp:winlib
     INFO Experiment: load system:exp:gnu-benchmark
     INFO property.rate: rate = ".250M" (String)
     INFO property.modulation: modulation = "bpsk" (String)
     INFO property.freq: freq = "2410000000" (String)
     INFO property.runtime: runtime = 10 (Fixnum)
     INFO Topology: Loaded topology '/tmp/pxe_slice-2014-07-17t13.52.30.457-04.00-topo-success'.
     INFO Topology: Loaded topology 'system:topo:imaged'.
    TX: node1-2.grid.orbit-lab.org
    RX: node1-1.grid.orbit-lab.org
     INFO ALL_UP_AND_INSTALLED: Event triggered. Starting the associated tasks.
     INFO exp: Request from Experiment Script: Wait for 2s....
     INFO exp: Start receiver app
     INFO exp: Request from Experiment Script: Wait for 2s....
     INFO exp: Start sending packets
     INFO exp: Request from Experiment Script: Wait for 10s....
     INFO exp: Stop transmitter and receiver
     INFO exp: Request from Experiment Script: Wait for 2s....
     INFO exp: done
     INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
     INFO NodeHandler:
     INFO NodeHandler: Shutting down experiment, please wait...
     INFO NodeHandler:
     INFO run: Experiment default_slice-2014-07-17t14.20.09.457-04.00 finished after 0:25
    
    nilanjan@console.grid:~$
    
  • Results from running the OEDL experiment can be found in a log file in /tmp directory. The name of the log file is the default_slice name found from the OEDL output appended with .log. A successful run will have several lines similar to the following. This is will show the packet number, number of packets received and the number of correctly formed packets as seen from the receiver.
    :
    :
    2014-07-21 10:51:07 DEBUG nodeHandler::AgentCommands: APP_EVENT STDOUT from: 'test:app:benchmark_rx#1' (node1-1.grid.orbit-lab.org) - msg: 'ok =  True  pktno =  140  n_rcvd =  140  n_right =  140'
    2014-07-21 10:51:07 DEBUG nodeHandler::AgentCommands: APP_EVENT STDOUT from: 'test:app:benchmark_rx#1' (node1-1.grid.orbit-lab.org) - msg: 'ok =  True  pktno =  141  n_rcvd =  141  n_right =  141'
    2014-07-21 10:51:07 DEBUG nodeHandler::AgentCommands: APP_EVENT STDOUT from: 'test:app:benchmark_rx#1' (node1-1.grid.orbit-lab.org) - msg: 'ok =  True  pktno =  142  n_rcvd =  142  n_right =  142'
    :
    :
    

The output from the transmitter will up as a series of periods '.' similar to the following:

2014-07-21 10:51:09 DEBUG nodeHandler::AgentCommands: APP_EVENT STDERR from: 'test:app:benchmark_tx#1' (node1-2.grid.orbit-lab.org) - msg: '.................................................................U............................................................................................................................................................................................................................'

OEDL script

defProperty('rate', '.250M', "Bitrate")
defProperty('modulation','bpsk',"Modulation")
defProperty('freq', '2410000000', "Center frequency")
defProperty('runtime', 10, "Run time (s)")


defApplication('test:app:benchmark_rx', 'benchmark_rx.py') { |a|
  a.version(2, 0, 4)
  a.shortDescription = ""
  a.description = ""
  a.path = "export LC_ALL=C;/root/gnuradio/gr-digital/examples/narrowband/benchmark_rx.py"
  a.defProperty('args', "Argument list", nil,
                {:dynamic => false, :type => :string})
  a.defProperty('freq', "center frequency in Hz", '-f',
                {:dynamic => false, :type => :string})
  a.defProperty('rx-gain', "receive gain in dB", '--rx-gain',
                {:dynamic => false, :type => :string})
  a.defProperty('bitrate', "specify bitrate", '-r',
                {:dynamic => false, :type => :string})
  a.defProperty('modulation', "modulation: psk, cpm, qpsk, dqpsk, gfsk,qam, dbpsk, bpsk, gmsk [default=psk]", '-m',
                {:dynamic => false, :type => :string})
  a.defProperty('constellation-points', "set constellation - power of two for psk, power of 4 for QAM [default=16]", '-p',
                {:dynamic => false, :type => :string})
}

defApplication('test:app:benchmark_tx', 'benchmark_tx.py') { |a|
  a.version(2, 0, 4)
  a.shortDescription = ""
  a.description = ""
  a.path = "export LC_ALL=C;/root/gnuradio/gr-digital/examples/narrowband/benchmark_tx.py"
  a.defProperty('args', "Argument list", nil,
                {:dynamic => false, :type => :string})
  a.defProperty('freq', "center frequency in Hz", '-f',
                {:dynamic => false, :type => :string})
  a.defProperty('tx-gain', "transmit gain in dB", '--tx-gain',
                {:dynamic => false, :type => :string})
  a.defProperty('tx-amplitude', "transmitter digital amplitude [0,1)  [default=0.25", '--tx-amplitude',
                {:dynamic => false, :type => :string})
  a.defProperty('bitrate', "specify bitrate", '-r',
                {:dynamic => false, :type => :string})
  a.defProperty('modulation', "modulation: psk, cpm, qpsk, dqpsk, gfsk,qam, dbpsk, bpsk, gmsk [default=psk]", '-m',
                {:dynamic => false, :type => :string})
  a.defProperty('constellation-points', "set constellation - power of two for psk, power of 4 for QAM [default=16]", '-p',
                {:dynamic => false, :type => :string})
}



defTopology('txnode') { |t|
  # Load the topology of imaged nodes
  # These nodes are from most recent omf load command
  baseTopo = Topology['system:topo:imaged']

  # Draw a random node from the pool of active ones
  aNode = baseTopo.getUniqueRandomNode

  # Add this random node to this 'senderTopo' topology
  t.addNode(aNode)
  puts "TX: #{t.getNodeByIndex(0).to_s}"
}

defTopology('rxnode') { |t|
  # Load the topology of imaged nodes
  # These nodes are from most recent omf load command
  baseTopo = Topology['system:topo:imaged']

  # Draw a random node from the pool of active ones
  aNode = baseTopo.getUniqueRandomNode

  # Add this random node to this 'senderTopo' topology
  t.addNode(aNode)
  puts "RX: #{t.getNodeByIndex(0).to_s}"
}

defGroup('rx', 'rxnode') { |n|
 n.addApplication('test:app:benchmark_rx') { |app|
   app.setProperty('freq', property.freq)
   app.setProperty('modulation',property.modulation)
   app.setProperty('bitrate',property.rate)
   app.setProperty('rx-gain','30')
 }

}

defGroup('tx', 'txnode') { |n|
 n.addApplication('test:app:benchmark_tx') { |app|
   app.setProperty('freq', property.freq)
   app.setProperty('modulation',property.modulation)
   app.setProperty('bitrate',property.rate)
   app.setProperty('tx-gain','30')
   app.setProperty('tx-amplitude','0.5')
 }

}

onEvent(:ALL_UP_AND_INSTALLED) { |event|
  # Wait a couple of seconds before proceeding so processes can settle down
  wait 2

  # Start receiver application
  info "Start receiver app"
  group("rx").startApplications

  # Wait a couple of seconds for receiver application to become ready
  wait 2

  # Start transmitter application
  info "Start sending packets"
  group("tx").startApplications

  # Run for specified runtime
  wait property.runtime

  # Stop benchmark applications
  info "Stop transmitter and receiver"
  allGroups.stopApplications

  # As a precaution manually kill the benchmark applications on tx & rx node
  allGroups.exec("PID=$(ps -ef | awk '$8==\"python\" {print $2}') ; kill -9 $PID")
  wait 2

  info "done"
  Experiment.done
}
Note: See TracWiki for help on using the wiki.