| 60 | |
| 61 | === Performing the experiment using OEDL === |
| 62 | |
| 63 | OEDL can be used to automatically perform the experiment. The OEDL code for the experiment is shown below. |
| 64 | |
| 65 | {{{ |
| 66 | defProperty('rx_freq', "800e6", "") |
| 67 | defProperty('rx_rate', "5e6", "") |
| 68 | defProperty('rx_gain', "20", "") |
| 69 | defProperty('recv_oml_output_type', "vector", "") |
| 70 | defProperty('recv_oml_servername', "file", "") |
| 71 | defProperty('tx_freq', "798e6", "") |
| 72 | defProperty('tx_rate', "5e6", "") |
| 73 | defProperty('tx_gain', "20", "") |
| 74 | defProperty('tx_module', "foo", "") # using a random name for an unexisting module |
| 75 | defProperty('rx_module', "foo", "") # so that no module is started, but it can be added later by setting this property |
| 76 | defProperty('del_rx_module', "foo", "") |
| 77 | |
| 78 | require './wiserd.rb' |
| 79 | |
| 80 | defGroup('sender', "node1-1") do |node| |
| 81 | node.addApplication("test:app:wiserd") do |app| |
| 82 | app.setProperty('--uhd_tx_freq', property.tx_freq) |
| 83 | app.setProperty('--uhd_tx_rate', property.tx_rate) |
| 84 | app.setProperty('--uhd_tx_gain', property.tx_gain) |
| 85 | app.setProperty('--addmodule', property.tx_module) |
| 86 | end |
| 87 | end |
| 88 | |
| 89 | defGroup('receiver', "node1-2") do |node| |
| 90 | node.addApplication("test:app:wiserd") do |app| |
| 91 | app.setProperty('--uhd_rx_freq', property.rx_freq) |
| 92 | app.setProperty('--uhd_rx_rate', property.rx_rate) |
| 93 | app.setProperty('--uhd_rx_gain', property.rx_gain) |
| 94 | app.setProperty('--recv_oml_output_type', property.recv_oml_output_type) |
| 95 | app.setProperty('--recv_oml_servername', property.recv_oml_servername) |
| 96 | app.setProperty('--addmodule', property.rx_module) |
| 97 | app.setProperty('--delmodule', property.del_rx_module) |
| 98 | end |
| 99 | end |
| 100 | |
| 101 | onEvent(:ALL_UP_AND_INSTALLED) do |event| |
| 102 | wait 10 |
| 103 | info "Starting the Receiver" |
| 104 | group("receiver").startApplications |
| 105 | info "Starting the Sender" |
| 106 | group("sender").startApplications |
| 107 | wait 8 |
| 108 | property.tx_module = "waveform" |
| 109 | property.rx_module = "fftmovingavgoml" |
| 110 | for i in 798..802 |
| 111 | property.tx_freq = "#{i}e6" |
| 112 | wait 1 |
| 113 | end |
| 114 | property.del_rx_module = "fftmovingavgoml" |
| 115 | group("sender").stopApplications |
| 116 | group("receiver").stopApplications |
| 117 | Experiment.done |
| 118 | end |
| 119 | }}} |
| 120 | |
| 121 | This experiment consists of a receiver centered at 800 MHz, with the bandwidth of 5 MHz, and the transmitter that runs for 5 seconds, transmitting a SINE waveform centered at frequencies of 798, 799, 800, 801 and 802 MHz for 1 second each. The code needs to be saved in a file named ''experiment.rb''. It's assumed that the Wiserd application definition for OEDL is available in the file named ''wiserd.rb''. After imaging the nodes and making sure they are turned on, the experiment can be run using the command |
| 122 | |
| 123 | {{{ |
| 124 | omf exec experiment.rb |
| 125 | }}} |