| 1 | defProperty('rxnode', 'node1-1.grid.orbit-lab.org', "Receive node")
|
|---|
| 2 | defProperty('txnode', 'node20-20.grid.orbit-lab.org', "Transmit node")
|
|---|
| 3 | defProperty('rate', '1.25M', "Bitrate")
|
|---|
| 4 | defProperty('modulation','bpsk',"Modulation")
|
|---|
| 5 | defProperty('freq', '1900000000', "Center frequency")
|
|---|
| 6 | defProperty('runtime', 100, "Run time (s)")
|
|---|
| 7 |
|
|---|
| 8 | defApplication('test:app:benchmark_rx3', 'benchmark_rx3.py') { |a|
|
|---|
| 9 | a.version(2, 0, 4)
|
|---|
| 10 | a.shortDescription = ""
|
|---|
| 11 | a.description = ""
|
|---|
| 12 | a.path = "export LC_ALL=C;/root/gnuradio/gr-digital/examples/narrowband/benchmark_rx3.py"
|
|---|
| 13 | a.defProperty('args', "Argument list", nil,
|
|---|
| 14 | {:dynamic => false, :type => :string})
|
|---|
| 15 | a.defProperty('freq', "center frequency in Hz", '-f',
|
|---|
| 16 | {:dynamic => false, :type => :string})
|
|---|
| 17 | a.defProperty('rx-gain', "receive gain in dB", '--rx-gain',
|
|---|
| 18 | {:dynamic => false, :type => :string})
|
|---|
| 19 | a.defProperty('bitrate', "specify bitrate", '-r',
|
|---|
| 20 | {:dynamic => false, :type => :string})
|
|---|
| 21 | a.defProperty('modulation', "modulation: psk, cpm, qpsk, dqpsk, gfsk,qam, dbpsk, bpsk, gmsk [default=psk]", '-m',
|
|---|
| 22 | {:dynamic => false, :type => :string})
|
|---|
| 23 | a.defProperty('constellation-points', "set constellation - power of two for psk, power of 4 for QAM [default=16]", '-p',
|
|---|
| 24 | {:dynamic => false, :type => :string})
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | defApplication('test:app:benchmark_tx3', 'benchmark_tx3.py') { |a|
|
|---|
| 28 | a.version(2, 0, 4)
|
|---|
| 29 | a.shortDescription = ""
|
|---|
| 30 | a.description = ""
|
|---|
| 31 | a.path = "export LC_ALL=C;/root/gnuradio/gr-digital/examples/narrowband/benchmark_tx3.py"
|
|---|
| 32 | a.defProperty('args', "Argument list", nil,
|
|---|
| 33 | {:dynamic => false, :type => :string})
|
|---|
| 34 | a.defProperty('freq', "center frequency in Hz", '-f',
|
|---|
| 35 | {:dynamic => false, :type => :string})
|
|---|
| 36 | a.defProperty('tx-gain', "transmit gain in dB", '--tx-gain',
|
|---|
| 37 | {:dynamic => false, :type => :string})
|
|---|
| 38 | a.defProperty('tx-amplitude', "transmitter digital amplitude [0,1) [default=0.25", '--tx-amplitude',
|
|---|
| 39 | {:dynamic => false, :type => :string})
|
|---|
| 40 | a.defProperty('bitrate', "specify bitrate", '-r',
|
|---|
| 41 | {:dynamic => false, :type => :string})
|
|---|
| 42 | a.defProperty('modulation', "modulation: psk, cpm, qpsk, dqpsk, gfsk,qam, dbpsk, bpsk, gmsk [default=psk]", '-m',
|
|---|
| 43 | {:dynamic => false, :type => :string})
|
|---|
| 44 | a.defProperty('constellation-points', "set constellation - power of two for psk, power of 4 for QAM [default=16]", '-p',
|
|---|
| 45 | {:dynamic => false, :type => :string})
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | defGroup('rx_node', property.rxnode) { |n|
|
|---|
| 49 | n.addApplication('test:app:benchmark_rx3') { |app|
|
|---|
| 50 | app.setProperty('freq', property.freq)
|
|---|
| 51 | app.setProperty('modulation',property.modulation)
|
|---|
| 52 | app.setProperty('bitrate',property.rate)
|
|---|
| 53 | app.setProperty('rx-gain','30')
|
|---|
| 54 | }
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
| 57 | defGroup('tx_node', property.txnode) { |n|
|
|---|
| 58 | n.addApplication('test:app:benchmark_tx3') { |app|
|
|---|
| 59 | app.setProperty('freq', property.freq)
|
|---|
| 60 | app.setProperty('modulation',property.modulation)
|
|---|
| 61 | app.setProperty('bitrate',property.rate)
|
|---|
| 62 | app.setProperty('tx-gain','30')
|
|---|
| 63 | app.setProperty('tx-amplitude','0.5')
|
|---|
| 64 | }
|
|---|
| 65 | }
|
|---|
| 66 |
|
|---|
| 67 | onEvent(:ALL_UP_AND_INSTALLED) { |event|
|
|---|
| 68 | info "Give machines some time to warm up :-)"
|
|---|
| 69 | wait 2
|
|---|
| 70 | info "Starting the packet server"
|
|---|
| 71 | consoleExec("/usr/local/bin/pkt_server --oml-exp-id #{Experiment.ID} --duration #{property.runtime} &")
|
|---|
| 72 | info "Configuring interference"
|
|---|
| 73 | consoleHttp("http://instrument1.orbit-lab.org:5054/interference/initialize")
|
|---|
| 74 | consoleHttp("http://instrument1.orbit-lab.org:5054/interference/set?frequency=#{property.freq}&power=-40")
|
|---|
| 75 | consoleHttp("http://instrument1.orbit-lab.org:5054/interference/train?bandwidth=2.5&duration=#{property.runtime}")
|
|---|
| 76 | info "Starting interference"
|
|---|
| 77 | consoleHttp("http://instrument1.orbit-lab.org:5054/interference/start")
|
|---|
| 78 | info "Starting benchmark_rx"
|
|---|
| 79 | group("rx_node").startApplications
|
|---|
| 80 | info "Starting benchmark_tx"
|
|---|
| 81 | group("tx_node").startApplications
|
|---|
| 82 | info "Runing for #{property.runtime} seconds..."
|
|---|
| 83 | wait property.runtime
|
|---|
| 84 | info "Done! Stop eveything"
|
|---|
| 85 | allGroups.stopApplications
|
|---|
| 86 | consoleHttp("http://instrument1.orbit-lab.org:5054/interference/stop")
|
|---|
| 87 | wait 5
|
|---|
| 88 | consoleExec("pkill pkt_server")
|
|---|
| 89 | Experiment.done
|
|---|
| 90 | }
|
|---|