Changes between Version 1 and Version 2 of Tutorials/Wireless/Outdoor Spectrum Usage


Ignore:
Timestamp:
Jun 4, 2020, 4:21:25 PM (4 years ago)
Author:
nilanjan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/Wireless/Outdoor Spectrum Usage

    v1 v2  
    66This example is split into two parts.
    77First 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 Graffinni.
     8Second part will show how to record measured data  and visualize statistics using Influx database and Grafana.
    99
    1010=== Prerequisites  ===
     
    5454
    5555
    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]]
    6060 Open a terminal and equate the enviroment variable (NODE) to specify the transmitting SDR.
    6161{{{#!shell-session
     
    7979
    8080
    81  7. Set up the receiving side.[[BR]]
     81 7. Build the receiving side sdr application.[[BR]]
    8282 This is exactly the same as the above step but the environment variable NODE points to a different resource.
    8383       
     
    101101}}}
    102102
    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:
     106Number mboards        = 1
     107Number of rx channels = 2
     108Number of tx channels = 2
     109Setting device timestamp to 0...
     110Device storage: TX
     111 channels:          2
     112 buffers  / channel 80
     113 samples / buffer   256
     114 bytes / sample     8
     115 shared memory      0
     116Device 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 ===
    104133
    105134 8. Configure the transmit antenna using the RF Control service. Please check [wiki:Resources#RFControl here] for more details on the service.
     
    121150}}}
    122151
    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. 
    124154{{{#!shell-session
    125155user@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"
    126156}}}
    127157
    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.
    136160{{{#!shell-session
    137161user@console:~$ sh run_data_script.sh
    138162}}}
    139163
    140  The script configures sdr application with radio paramenters 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.
    143167{{{
    144168:
     
    157181}}}
    158182       
    159 On the receive side a similar output is expected
     183 On the receive side a similar output is expected
    160184{{{
    161185:
     
    175199:
    176200}}}
    177        
    178 
    179  10. Lastly turn off the RF frontend with the following command.
     201
     202
     203 10. Lastly turn off the RF front end with the following command.
    180204{{{#!shell-session
    181205user@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"
    182206}}}
    183207
    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
     222user@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
     228export TXNODE=sdr2-s3-lg1.bed.cosmos-lab.org
     229export 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
     243python rc.py $TXNODE 5180 "txconfig 0 2600e6 10e6 25"
     244python rc.py $TXNODE 5180 "rxconfig 0 2400e6 10e6 5"
     245python rc.py $TXNODE 5180 "txconfig 1 2000e6 10e6 0"
     246python rc.py $TXNODE 5180 "rxconfig 1 2050e6 10e6 5"
     247
     248python rc.py $RXNODE 5180 "rxconfig 0 2600e6 10e6 5"
     249python rc.py $RXNODE 5180 "txconfig 0 2400e6 10e6 25"
     250python rc.py $RXNODE 5180 "rxconfig 1 2000e6 10e6 5"
     251python 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>
     260python 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>
     265python rc.py $TXNODE 5180 "txsig_data 20000 250"
     266
     267}}}
    185268
    186269