Changes between Version 1 and Version 2 of Tutorials/Wireless/Outdoor Spectrum Usage
- Timestamp:
- Jun 4, 2020, 4:21:25 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorials/Wireless/Outdoor Spectrum Usage
v1 v2 6 6 This example is split into two parts. 7 7 First part will focus on outdoor spectrum usage and running a simple sdr application for data transfer on shared / non-federal frequency band. 8 Second part will show how to record measured data and visualize statistics using Influx database and Graf finni.8 Second part will show how to record measured data and visualize statistics using Influx database and Grafana. 9 9 10 10 === Prerequisites === … … 54 54 55 55 56 === = Configure transmitter and receive SDRs ====57 Most of this part is scripted via the Makefile. This is to simplify the download and installation of the required libraries onto the resources so we don't have to go back and forth between the console and the resource node.58 59 6. Set up the transmit side.[[BR]]56 === Configure transmitter and receive SDRs === 57 Most of this part is scripted via the Makefile. This is to simplify the download and installation of the required libraries onto the resources so we don't have to go back and forth between the console and the resource node. 58 59 6. Build the transmit side sdr application.[[BR]] 60 60 Open a terminal and equate the enviroment variable (NODE) to specify the transmitting SDR. 61 61 {{{#!shell-session … … 79 79 80 80 81 7. Set up the receiving side.[[BR]]81 7. Build the receiving side sdr application.[[BR]] 82 82 This is exactly the same as the above step but the environment variable NODE points to a different resource. 83 83 … … 101 101 }}} 102 102 103 '''Note: Keep track of these two terminals.''' 103 Keep track of these two terminals. The sdr application will output text as it detected the radios on both transmitter and receiver. When both radios are ready, output similar to the following is shown 104 {{{ 105 : 106 Number mboards = 1 107 Number of rx channels = 2 108 Number of tx channels = 2 109 Setting device timestamp to 0... 110 Device storage: TX 111 channels: 2 112 buffers / channel 80 113 samples / buffer 256 114 bytes / sample 8 115 shared memory 0 116 Device storage: RX 117 channels: 2 118 buffers / channel 78125 119 samples / buffer 256 120 bytes / sample 8 121 shared memory 0 122 [INFO] [main.cpp] Rsp: make resource=rio0 123 124 [INFO] [main.cpp] Starting data server at 6180 125 [INFO] [main.cpp] Starting command server at 5180 126 [INFO] [main.cpp] Starting websock server at 9002 127 128 129 }}} 130 131 132 === Turn on the transmitter's power amplifier === 104 133 105 134 8. Configure the transmit antenna using the RF Control service. Please check [wiki:Resources#RFControl here] for more details on the service. … … 121 150 }}} 122 151 123 Turn on the power amplifier and set frequency appropriately. Check the [wiki:PoliciesCompliance#OutdoorRadioFrequencyAllocation Outdoor frequency allocation table] for acceptable frequency bands. In this example a center frequency of 2600MHz is used. 152 Turn on the power amplifier and set frequency appropriately. Check the [wiki:PoliciesCompliance#OutdoorRadioFrequencyAllocation Outdoor frequency allocation table] for acceptable frequency bands. 153 In this example a center frequency of 2600MHz is used. 124 154 {{{#!shell-session 125 155 user@console:~$ curl "am1.cosmos-lab.org:5054/rf_control/set_tx_path?node=sdr2-s3-lg1.bed.cosmos-lab.org&rf_port=0&power_amp=on&f_lower=2500&f_upper=2680" 126 156 }}} 127 157 128 129 9. Execute the run script to configure and stream both SDRs for receiving and transmitting bursts of packet data. 130 131 View the run_data_script.sh script 132 {{{#!shell-session 133 user@console:~$ cat run_data_script.sh 134 }}} 135 158 === Transmit and receive over the air === 159 9. Execute the run script to configure and stream both SDRs for receiving and transmitting bursts of packet data. The details in this script are shown below. 136 160 {{{#!shell-session 137 161 user@console:~$ sh run_data_script.sh 138 162 }}} 139 163 140 The script configures sdr application with radio parame nters and begins streaming packets for a few seconds. As long as everything is working fine the script will exit out but the sdr applications will continue to stream packets for a few seconds.141 142 On the transmit side the output should have rows of ''INFO'' statements similar to the following.164 The script configures sdr application with radio parameters and begins streaming packets for a few seconds. As long as everything is working fine the script will exit out but the sdr applications will continue to stream packets for a few seconds. 165 166 On the transmit side the output should have rows of ''INFO'' statements similar to the following. 143 167 {{{ 144 168 : … … 157 181 }}} 158 182 159 On the receive side a similar output is expected183 On the receive side a similar output is expected 160 184 {{{ 161 185 : … … 175 199 : 176 200 }}} 177 178 179 10. Lastly turn off the RF front end with the following command.201 202 203 10. Lastly turn off the RF front end with the following command. 180 204 {{{#!shell-session 181 205 user@console:~$ curl "am1.cosmos-lab.org:5054/rf_control/set_tx_path?node=sdr2-s3-lg1.bed.cosmos-lab.org&rf_port=0&power_amp=off" 182 206 }}} 183 207 184 11. Execute the run script again and verify that no packets are being received. 208 11. Execute the run script again and verify that no packets are received. The transmitters output will show the radio trying to send packets but since the power amplifier is turned on nothing is actually sent over the air. On the receiving end, the radio will still listen for packets however the summary should show 0 packets received. 209 {{{ 210 : 211 [INFO] [rx_data_link_0] Receive complete - summary: 212 [INFO] [rx_data_link_0] --raw packets: 0 / 0 bytes 213 [INFO] [rx_data_link_0] Avg correlation threshold of successful detections: nan 214 [INFO] [rx_data_link_0] Exitting 215 : 216 }}} 217 218 219 ==== Run script details ==== 220 View the run_data_script.sh file. A python script is used to remotely configure the sdr application on both the receiving and transmitting side from the console. 221 {{{#!shell-session 222 user@console:~$ cat run_data_script.sh 223 }}} 224 225 The ''CONFIGURABLES'' section must have the target node variables pointing at the appropriate devices: 226 {{{ 227 ## CONFIGURABLES 228 export TXNODE=sdr2-s3-lg1.bed.cosmos-lab.org 229 export RXNODE=sdr2-s2-lg1.bed.cosmos-lab.org 230 }}} 231 232 The radio parameters are set up with the following lines. 233 {{{ 234 ## SET UP RADIO PORTION HERE 235 ## Script is set up for x310 which has 2 daughter cards hence 2 channels: {0,1} 236 ## Both channels must be set to the same sampling rate otherwise HW will barf! 237 238 239 ## Set up transmit / receive chain 240 ## txconfig <ch> <freq> <rate> <gain> 241 ## rxconfig <ch> <freq> <rate> <gain> 242 243 python rc.py $TXNODE 5180 "txconfig 0 2600e6 10e6 25" 244 python rc.py $TXNODE 5180 "rxconfig 0 2400e6 10e6 5" 245 python rc.py $TXNODE 5180 "txconfig 1 2000e6 10e6 0" 246 python rc.py $TXNODE 5180 "rxconfig 1 2050e6 10e6 5" 247 248 python rc.py $RXNODE 5180 "rxconfig 0 2600e6 10e6 5" 249 python rc.py $RXNODE 5180 "txconfig 0 2400e6 10e6 25" 250 python rc.py $RXNODE 5180 "rxconfig 1 2000e6 10e6 5" 251 python rc.py $RXNODE 5180 "txconfig 1 2050e6 10e6 0" 252 253 }}} 254 255 After the set up is done, the sdr applications begin streaming data. The receiving end is started first with the specified runtime of 20 seconds. At the same time the transmitting end starts sending packets for 20 seconds at intervals of 250 milliseconds. 256 {{{ 257 ## BEGIN data transfer 258 ## Invoke receive handler 259 ## rxsig_data <runtime_in_milliseconds> <correlation threshold> 260 python rc.py $RXNODE 5180 "rxsig_data 20000 10000" 261 262 263 ## Invoke transmit handler 264 ## txsig_data <runtime_in_milliseconds> <delay_between_burst_in_msec> 265 python rc.py $TXNODE 5180 "txsig_data 20000 250" 266 267 }}} 185 268 186 269