| 34 | | |
| 35 | | == OEDL script overview == |
| 36 | | * The OEDL script for this experiment is shown below. |
| 37 | | {{{ |
| 38 | | defProperty('rate', '.250M', "Bitrate") |
| 39 | | defProperty('modulation','bpsk',"Modulation") |
| 40 | | defProperty('freq', '2410000000', "Center frequency") |
| 41 | | defProperty('runtime', 10, "Run time (s)") |
| 42 | | |
| 43 | | |
| 44 | | defApplication('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 | | |
| 63 | | defApplication('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 | | |
| 86 | | defTopology('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 | | |
| 99 | | defTopology('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 | | |
| 112 | | defGroup('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 | | |
| 122 | | defGroup('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 | | |
| 133 | | onEvent(: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... ? |
| | 94 | |
| | 95 | |
| | 96 | == OEDL script overview == |
| | 97 | * The OEDL script for this experiment is shown below. |
| | 98 | {{{ |
| | 99 | defProperty('rate', '.250M', "Bitrate") |
| | 100 | defProperty('modulation','bpsk',"Modulation") |
| | 101 | defProperty('freq', '2410000000', "Center frequency") |
| | 102 | defProperty('runtime', 10, "Run time (s)") |
| | 103 | |
| | 104 | |
| | 105 | defApplication('test:app:benchmark_rx', 'benchmark_rx.py') { |a| |
| | 106 | a.version(2, 0, 4) |
| | 107 | a.shortDescription = "" |
| | 108 | a.description = "" |
| | 109 | a.path = "export LC_ALL=C;/root/gnuradio/gr-digital/examples/narrowband/benchmark_rx.py" |
| | 110 | a.defProperty('args', "Argument list", nil, |
| | 111 | {:dynamic => false, :type => :string}) |
| | 112 | a.defProperty('freq', "center frequency in Hz", '-f', |
| | 113 | {:dynamic => false, :type => :string}) |
| | 114 | a.defProperty('rx-gain', "receive gain in dB", '--rx-gain', |
| | 115 | {:dynamic => false, :type => :string}) |
| | 116 | a.defProperty('bitrate', "specify bitrate", '-r', |
| | 117 | {:dynamic => false, :type => :string}) |
| | 118 | a.defProperty('modulation', "modulation: psk, cpm, qpsk, dqpsk, gfsk,qam, dbpsk, bpsk, gmsk [default=psk]", '-m', |
| | 119 | {:dynamic => false, :type => :string}) |
| | 120 | a.defProperty('constellation-points', "set constellation - power of two for psk, power of 4 for QAM [default=16]", '-p', |
| | 121 | {:dynamic => false, :type => :string}) |
| | 122 | } |
| | 123 | |
| | 124 | defApplication('test:app:benchmark_tx', 'benchmark_tx.py') { |a| |
| | 125 | a.version(2, 0, 4) |
| | 126 | a.shortDescription = "" |
| | 127 | a.description = "" |
| | 128 | a.path = "export LC_ALL=C;/root/gnuradio/gr-digital/examples/narrowband/benchmark_tx.py" |
| | 129 | a.defProperty('args', "Argument list", nil, |
| | 130 | {:dynamic => false, :type => :string}) |
| | 131 | a.defProperty('freq', "center frequency in Hz", '-f', |
| | 132 | {:dynamic => false, :type => :string}) |
| | 133 | a.defProperty('tx-gain', "transmit gain in dB", '--tx-gain', |
| | 134 | {:dynamic => false, :type => :string}) |
| | 135 | a.defProperty('tx-amplitude', "transmitter digital amplitude [0,1) [default=0.25", '--tx-amplitude', |
| | 136 | {:dynamic => false, :type => :string}) |
| | 137 | a.defProperty('bitrate', "specify bitrate", '-r', |
| | 138 | {:dynamic => false, :type => :string}) |
| | 139 | a.defProperty('modulation', "modulation: psk, cpm, qpsk, dqpsk, gfsk,qam, dbpsk, bpsk, gmsk [default=psk]", '-m', |
| | 140 | {:dynamic => false, :type => :string}) |
| | 141 | a.defProperty('constellation-points', "set constellation - power of two for psk, power of 4 for QAM [default=16]", '-p', |
| | 142 | {:dynamic => false, :type => :string}) |
| | 143 | } |
| | 144 | |
| | 145 | |
| | 146 | |
| | 147 | defTopology('txnode') { |t| |
| | 148 | # Load the topology of imaged nodes |
| | 149 | # These nodes are from most recent omf load command |
| | 150 | baseTopo = Topology['system:topo:imaged'] |
| | 151 | |
| | 152 | # Draw a random node from the pool of active ones |
| | 153 | aNode = baseTopo.getUniqueRandomNode |
| | 154 | |
| | 155 | # Add this random node to this 'senderTopo' topology |
| | 156 | t.addNode(aNode) |
| | 157 | puts "TX: #{t.getNodeByIndex(0).to_s}" |
| | 158 | } |
| | 159 | |
| | 160 | defTopology('rxnode') { |t| |
| | 161 | # Load the topology of imaged nodes |
| | 162 | # These nodes are from most recent omf load command |
| | 163 | baseTopo = Topology['system:topo:imaged'] |
| | 164 | |
| | 165 | # Draw a random node from the pool of active ones |
| | 166 | aNode = baseTopo.getUniqueRandomNode |
| | 167 | |
| | 168 | # Add this random node to this 'senderTopo' topology |
| | 169 | t.addNode(aNode) |
| | 170 | puts "RX: #{t.getNodeByIndex(0).to_s}" |
| | 171 | } |
| | 172 | |
| | 173 | defGroup('rx', 'rxnode') { |n| |
| | 174 | n.addApplication('test:app:benchmark_rx') { |app| |
| | 175 | app.setProperty('freq', property.freq) |
| | 176 | app.setProperty('modulation',property.modulation) |
| | 177 | app.setProperty('bitrate',property.rate) |
| | 178 | app.setProperty('rx-gain','30') |
| | 179 | } |
| | 180 | |
| | 181 | } |
| | 182 | |
| | 183 | defGroup('tx', 'txnode') { |n| |
| | 184 | n.addApplication('test:app:benchmark_tx') { |app| |
| | 185 | app.setProperty('freq', property.freq) |
| | 186 | app.setProperty('modulation',property.modulation) |
| | 187 | app.setProperty('bitrate',property.rate) |
| | 188 | app.setProperty('tx-gain','30') |
| | 189 | app.setProperty('tx-amplitude','0.5') |
| | 190 | } |
| | 191 | |
| | 192 | } |
| | 193 | |
| | 194 | onEvent(:ALL_UP_AND_INSTALLED) { |event| |
| | 195 | # Wait a couple of seconds before proceeding so processes can settle down |
| | 196 | wait 2 |
| | 197 | |
| | 198 | # Start receiver application |
| | 199 | info "Start receiver app" |
| | 200 | group("rx").startApplications |
| | 201 | |
| | 202 | # Wait a couple of seconds for receiver application to become ready |
| | 203 | wait 2 |
| | 204 | |
| | 205 | # Start transmitter application |
| | 206 | info "Start sending packets" |
| | 207 | group("tx").startApplications |
| | 208 | |
| | 209 | # Run for specified runtime |
| | 210 | wait property.runtime |
| | 211 | |
| | 212 | # Stop benchmark applications |
| | 213 | info "Stop transmitter and receiver" |
| | 214 | allGroups.stopApplications |
| | 215 | |
| | 216 | # As a precaution manually kill the benchmark applications on tx & rx node |
| | 217 | allGroups.exec("PID=$(ps -ef | awk '$8==\"python\" {print $2}') ; kill -9 $PID") |
| | 218 | wait 2 |
| | 219 | |
| | 220 | info "done" |
| | 221 | Experiment.done |
| | 222 | } |
| | 223 | }}} |