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


Ignore:
Timestamp:
Jun 3, 2020, 11:51:01 PM (4 years ago)
Author:
nilanjan
Comment:

Legend:

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

    v1 v1  
     1== Outdoor spectrum usage and allocation ==
     2
     3=== Description ===
     4Demonstrate outdoor spectrum usage and record measurements to Influx DB.
     5
     6This example is split into two parts.
     7First part will focus on outdoor spectrum usage and running a simple sdr application for data transfer on shared / non-federal frequency band.
     8Second part will show how to record measured data  and visualize statistics using Influx database and Graffinni.
     9
     10=== Prerequisites  ===
     11
     12In order to access the test bed, create a reservation and have it approved by the reservation service. Access to the resources is granted after the reservation is confirmed. Please follow the process shown on the COSMOS [wiki:GettingStarted getting started] page to get started.
     13
     14=== Resources utilized ===
     15* This example will use two x310 SDR on bed.cosmos-lab.org
     16 * sdr2-s3-lg1.bed.cosmos-lab.org as the transmitting SDR
     17 * sdr2-s2-lg1.bed.cosmos-lab.org as the receiving SDR
     18* ''baseline-uhd.ndz'' : operating system to load onto above resources.
     19
     20* [RF control service] to configure the [RF front end's TX chain] on the transmitting SDR.
     21
     22* [https://www.influxdata.com/products/influxdb-overview/ Influx database] - time series database supporting SQL-like queries.
     23* [https://grafana.com/docs/grafana/latest/ Grafana] - a front end visualization and analytic tool for Influx database.
     24
     25
     26=== Steps ===
     27 1. Sign up for a [https://cosmos-lab.org/portal-2/ COSMOS account]
     28 2. [UserGuide/CreateRes Create a resource reservation on bed.cosmos-lab.org]
     29 3. [UserGuide/RemoteAccess/Console Login to your reserved domain.]
     30 4. Load baseline-uhd.ndz on your resource. [UserGuide/OmfQuickStart  - this is done via OMF]
     31 
     32 First make sure the resources are turned off
     33{{{#!shell-session
     34user@console:~$ omf tell -a offh -t sdr2-s2-lg1.bed.cosmos-lab.org,sdr2-s3-lg1.bed.cosmos-lab.org
     35}}}
     36       
     37 Load the resources with the image
     38{{{#!shell-session
     39user@console:~$ omf load -i baseline-uhd.ndz -t sdr2-s2-lg1.bed.cosmos-lab.org,sdr2-s3-lg1.bed.cosmos-lab.org
     40}}}
     41
     42 Turn on the resources
     43{{{#!shell-session
     44user@console:~$ omf tell -a on -t sdr2-s2-lg1.bed.cosmos-lab.org,sdr2-s3-lg1.bed.cosmos-lab.org
     45}}}
     46         
     47         
     48 5. Download the application source code from the attachment section below.
     49{{{#!shell-session
     50user@console:~$ UPDATE wget https://wiki.cosmos-lab.org/raw-attachment/wiki/tutorials/basic_usage/spectrum_view.tar.gz
     51user@console:~$ UPDATE tar -zxvf spectrum_view.tar.gz
     52user@console:~$ UPDATE cd SPECTRUM_VIEW
     53}}}
     54
     55
     56==== Configure transmitter and receive SDRs ====
     57Most 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]]
     60 Open a terminal and equate the enviroment variable (NODE) to specify the transmitting SDR.
     61{{{#!shell-session
     62user@console:~$ export NODE=sdr2-s3-lg1.bed.cosmos-lab.org
     63}}}
     64
     65 Next the following make commands are run on the above NODE. This should install all the dependencies to make the sdr application: ''sdrapp''
     66{{{#!shell-session
     67user@console:~$ make remote-install-deps
     68user@console:~$ make remote-install-websocket
     69user@console:~$ make remote-make
     70}}}
     71
     72
     73 Now ssh into the NODE and run sdrapp
     74{{{#!shell-session
     75user@console:~$ ssh root@$NODE
     76root@sdr2-s3-lg1:~# cd SDRAPP/build/
     77root@sdr2-s3-lg1:~/SDRAPP/build# ./sdrapp --cmd "make resource=rio0"
     78}}}
     79
     80
     81 7. Set up the receiving side.[[BR]]
     82 This is exactly the same as the above step but the environment variable NODE points to a different resource.
     83       
     84 Open a terminal again and equate the environment variable (NODE) to specify the receiving SDR.
     85{{{#!shell-session
     86user@console:~$ export NODE=sdr2-s2-lg1.bed.cosmos-lab.org
     87}}}
     88
     89 Next the following make commands are run on the above NODE. This should install all the dependencies to make the sdr application: ''sdrapp''
     90{{{#!shell-session
     91user@console:~$ make remote-install-deps
     92user@console:~$ make remote-install-websocket
     93user@console:~$ make remote-make
     94}}}
     95
     96 Now ssh into the NODE and run sdrapp
     97{{{#!shell-session
     98user@console:~$ ssh root@$NODE
     99root@sdr2-s3-lg1:~# cd SDRAPP/build/
     100root@sdr2-s3-lg1:~/SDRAPP/build# ./sdrapp --cmd "make resource=rio0"
     101}}}
     102
     103 '''Note: Keep track of these two terminals.'''
     104
     105 8. Configure the transmit antenna using the RF Control service. Please check [wiki:Resources#RFControl here] for more details on the service.
     106       
     107 Open another terminal - this is the 3rd terminal. First we'll configure the TX path, power amplifier and frequency ranges for the transmitting side.
     108
     109 Get current configuration
     110{{{#!shell-session
     111user@console:~$ curl "am1.cosmos-lab.org:5054/rf_control/get_tx_path?node=sdr2-s3-lg1.bed.cosmos-lab.org"
     112
     113<response status="OK">
     114  <nodes>
     115    <node name="sdr2-s3-lg1.bed.cosmos-lab.org">
     116      <rf_port number="0" antenna="1" connected="true" power_amp="OFF" f_lower="2350" f_upper="2800"/>
     117      <rf_port number="1" antenna="3" connected="true" power_amp="OFF" f_lower="2350" f_upper="2800"/>
     118    </node>
     119  </nodes>
     120</response>
     121}}}
     122
     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.
     124{{{#!shell-session
     125user@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}}}
     127
     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
     133user@console:~$ cat run_data_script.sh
     134}}}
     135
     136{{{#!shell-session
     137user@console:~$ sh run_data_script.sh
     138}}}
     139
     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
     142On the transmit side the output should have rows of ''INFO'' statements similar to the following.
     143{{{
     144:
     145[INFO] [tx_data_link_0]   [sent]   seq_num: 62  pkt_len: 29
     146[INFO] [tx_data_link_0]   [sent]   seq_num: 63  pkt_len: 8
     147[INFO] [tx_data_link_0]   [sent]   seq_num: 64  pkt_len: 49
     148[INFO] [tx_data_link_0]   [sent]   seq_num: 65  pkt_len: 42
     149[INFO] [tx_data_link_0]   [sent]   seq_num: 66  pkt_len: 63
     150[INFO] [tx_data_link_0]   [sent]   seq_num: 67  pkt_len: 34
     151[INFO] [tx_data_link_0]   [sent]   seq_num: 68  pkt_len: 2
     152:
     153[INFO] [tx_data_link_0] Transmit complete - summary:
     154[INFO] [tx_data_link_0] --raw packets:   80 / 21760 bytes
     155[INFO] [tx_data_link_0] Exitting
     156:
     157}}}
     158       
     159On the receive side a similar output is expected
     160{{{
     161:
     162[INFO] [rx_data_link_0]   [rcvd]  pkt: OK  seq_num: 55  pkt_len: 18  corr_strength: 18131.3
     163[INFO] [rx_data_link_0]   [rcvd]  pkt: OK  seq_num: 56  pkt_len: 15  corr_strength: 18124.4
     164[INFO] [rx_data_link_0]   [rcvd]  pkt: OK  seq_num: 57  pkt_len: 3  corr_strength: 18132.9
     165[INFO] [rx_data_link_0]   [rcvd]  pkt: OK  seq_num: 58  pkt_len: 53  corr_strength: 18148.1
     166[INFO] [rx_data_link_0]   [rcvd]  pkt: OK  seq_num: 59  pkt_len: 2  corr_strength: 18128.3
     167[INFO] [rx_data_link_0]   [rcvd]  pkt: OK  seq_num: 60  pkt_len: 34  corr_strength: 18161.1
     168[INFO] [rx_data_link_0]   [rcvd]  pkt: OK  seq_num: 61  pkt_len: 62  corr_strength: 18135.7
     169[INFO] [rx_data_link_0]   [rcvd]  pkt: OK  seq_num: 62  pkt_len: 29  corr_strength: 18164.7
     170:
     171[INFO] [rx_data_link_0] Receive complete - summary:
     172[INFO] [rx_data_link_0] --raw packets:   79 / 21488 bytes
     173[INFO] [rx_data_link_0] Avg correlation threshold of successful detections: 18148.4
     174[INFO] [rx_data_link_0] Exitting
     175:
     176}}}
     177       
     178
     179 10. Lastly turn off the RF frontend with the following command.
     180{{{#!shell-session
     181user@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}}}
     183
     184 11. Execute the run script again and verify that no packets are being received.
     185
     186
     187In the [next part of this tutorial] we'll add onto the receiving sdr application and recording measured data into InfluxDb.
     188