Changes between Version 10 and Version 11 of Tutorials/k0SDR/Tutorial01b


Ignore:
Timestamp:
Jul 21, 2014, 5:26:20 PM (10 years ago)
Author:
nilanjan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/k0SDR/Tutorial01b

    v10 v11  
    3434
    3535== OEDL script overview ==
    36 blah blah and ?
    37 
     36 * The OEDL script for this experiment is shown below.
     37{{{
     38defProperty('rate', '.250M', "Bitrate")
     39defProperty('modulation','bpsk',"Modulation")
     40defProperty('freq', '2410000000', "Center frequency")
     41defProperty('runtime', 10, "Run time (s)")
     42
     43
     44defApplication('test:app:benchmark_rx', 'benchmark_rx.py') { |a|
     45  a.version(2, 0, 4)
     46  a.shortDescription = ""
     47  a.description = ""
     48  a.path = "export LC_ALL=C;/root/gnuradio/gr-digital/examples/narrowband/benchmark_rx.py"
     49  a.defProperty('args', "Argument list", nil,
     50                {:dynamic => false, :type => :string})
     51  a.defProperty('freq', "center frequency in Hz", '-f',
     52                {:dynamic => false, :type => :string})
     53  a.defProperty('rx-gain', "receive gain in dB", '--rx-gain',
     54                {:dynamic => false, :type => :string})
     55  a.defProperty('bitrate', "specify bitrate", '-r',
     56                {:dynamic => false, :type => :string})
     57  a.defProperty('modulation', "modulation: psk, cpm, qpsk, dqpsk, gfsk,qam, dbpsk, bpsk, gmsk [default=psk]", '-m',
     58                {:dynamic => false, :type => :string})
     59  a.defProperty('constellation-points', "set constellation - power of two for psk, power of 4 for QAM [default=16]", '-p',
     60                {:dynamic => false, :type => :string})
     61}
     62
     63defApplication('test:app:benchmark_tx', 'benchmark_tx.py') { |a|
     64  a.version(2, 0, 4)
     65  a.shortDescription = ""
     66  a.description = ""
     67  a.path = "export LC_ALL=C;/root/gnuradio/gr-digital/examples/narrowband/benchmark_tx.py"
     68  a.defProperty('args', "Argument list", nil,
     69                {:dynamic => false, :type => :string})
     70  a.defProperty('freq', "center frequency in Hz", '-f',
     71                {:dynamic => false, :type => :string})
     72  a.defProperty('tx-gain', "transmit gain in dB", '--tx-gain',
     73                {:dynamic => false, :type => :string})
     74  a.defProperty('tx-amplitude', "transmitter digital amplitude [0,1)  [default=0.25", '--tx-amplitude',
     75                {:dynamic => false, :type => :string})
     76  a.defProperty('bitrate', "specify bitrate", '-r',
     77                {:dynamic => false, :type => :string})
     78  a.defProperty('modulation', "modulation: psk, cpm, qpsk, dqpsk, gfsk,qam, dbpsk, bpsk, gmsk [default=psk]", '-m',
     79                {:dynamic => false, :type => :string})
     80  a.defProperty('constellation-points', "set constellation - power of two for psk, power of 4 for QAM [default=16]", '-p',
     81                {:dynamic => false, :type => :string})
     82}
     83
     84
     85
     86defTopology('txnode') { |t|
     87  # Load the topology of imaged nodes
     88  # These nodes are from most recent omf load command
     89  baseTopo = Topology['system:topo:imaged']
     90
     91  # Draw a random node from the pool of active ones
     92  aNode = baseTopo.getUniqueRandomNode
     93
     94  # Add this random node to this 'senderTopo' topology
     95  t.addNode(aNode)
     96  puts "TX: #{t.getNodeByIndex(0).to_s}"
     97}
     98
     99defTopology('rxnode') { |t|
     100  # Load the topology of imaged nodes
     101  # These nodes are from most recent omf load command
     102  baseTopo = Topology['system:topo:imaged']
     103
     104  # Draw a random node from the pool of active ones
     105  aNode = baseTopo.getUniqueRandomNode
     106
     107  # Add this random node to this 'senderTopo' topology
     108  t.addNode(aNode)
     109  puts "RX: #{t.getNodeByIndex(0).to_s}"
     110}
     111
     112defGroup('rx', 'rxnode') { |n|
     113 n.addApplication('test:app:benchmark_rx') { |app|
     114   app.setProperty('freq', property.freq)
     115   app.setProperty('modulation',property.modulation)
     116   app.setProperty('bitrate',property.rate)
     117   app.setProperty('rx-gain','30')
     118 }
     119
     120}
     121
     122defGroup('tx', 'txnode') { |n|
     123 n.addApplication('test:app:benchmark_tx') { |app|
     124   app.setProperty('freq', property.freq)
     125   app.setProperty('modulation',property.modulation)
     126   app.setProperty('bitrate',property.rate)
     127   app.setProperty('tx-gain','30')
     128   app.setProperty('tx-amplitude','0.5')
     129 }
     130
     131}
     132
     133onEvent(:ALL_UP_AND_INSTALLED) { |event|
     134  # Wait a couple of seconds before proceeding so processes can settle down
     135  wait 2
     136
     137  # Start receiver application
     138  info "Start receiver app"
     139  group("rx").startApplications
     140
     141  # Wait a couple of seconds for receiver application to become ready
     142  wait 2
     143
     144  # Start transmitter application
     145  info "Start sending packets"
     146  group("tx").startApplications
     147
     148  # Run for specified runtime
     149  wait property.runtime
     150
     151  # Stop benchmark applications
     152  info "Stop transmitter and receiver"
     153  allGroups.stopApplications
     154
     155  # As a precaution manually kill the benchmark applications on tx & rx node
     156  allGroups.exec("PID=$(ps -ef | awk '$8==\"python\" {print $2}') ; kill -9 $PID")
     157  wait 2
     158
     159  info "done"
     160  Experiment.done
     161}
     162}}}
     163
     164 * Description... ?
    38165
    39166== Running OEDL script and viewing results ==