User Tools

Site Tools


from_gnuradio_to_cortxlab

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
from_gnuradio_to_cortxlab [2016/12/12 17:20] – [Submit the task] onicolasfrom_gnuradio_to_cortxlab [2018/01/29 14:31] (current) mimbert
Line 1: Line 1:
-# From GNU Radio to CorteXlab (Using USRPs)+# From A to Z: GNU Radio with CorteXlab using USRPs
  
-In the [[GNU Radio Benchmark example|first tutorial]] we introduced the way to construct a CorteXlab "task" given a ready-made GNU radio script. +In the [[GNU Radio Benchmark example|first tutorial]] we introduced the way to construct a CorteXlab "task" given a ready-made GNU Radio script. 
  
-This tutorial goes one step deeper, going through the process of executing an experiment on CorteXlab starting from an empty GNU Radio project on your computer.+This tutorial goes one step deeper, through the process of running an experiment on CorteXlab starting from an empty GNU Radio project on your computer.
  
-For practical purposes, we will use one GNU Radio example instead of starting from a clean sheet, but the procedure is exactly the same when you'll have your own project you want to run on CorteXlab.+For practical purposes, we will use a readily available GNU Radio example instead of starting from a clean sheet, but this will introduce the same procedure you'll use when you want to run your own project on CorteXlab.
  
 ##Setup ##Setup
Line 11: Line 11:
 The purpose of this tutorial is to execute an OFDM transmission between two USRP nodes. One node will be the transmitter and the other one will be the receiver. Instead of starting from an empty project, we are going to use the GNU Radio examples for an OFDM transmitter and receiver. The purpose of this tutorial is to execute an OFDM transmission between two USRP nodes. One node will be the transmitter and the other one will be the receiver. Instead of starting from an empty project, we are going to use the GNU Radio examples for an OFDM transmitter and receiver.
  
-Le us start by copying the files ''tx\_ofdm.grc'' and ''rx\_ofdm.grc'' located in ''$path/To/gnuradio/examples/digital/ofdm'' to a new folder of your choice. This folder will be your task folder.+Let us start by copying the files ''tx\_ofdm.grc'' and ''rx\_ofdm.grc'' located in ''<path\_to\_gnuradio>/examples/digital/ofdm'' to a new folder of your choice. This folder will be your task folder. //(Important note: <path\_to\_gnuradio> varies depending upon the way you are using GNURadio: If you have installed GNURadio on your workstation, you know where you choose to install it. If using the GNURadio instance which is part of CorteXlab toolchain on airlock, then the exact location is: ''/cortexlab/toolchains/current/share/gnuradio/examples/digital/ofdm/''
 +//
  
-As you can guess ''tx\_ofdm.grc'' will be used for the ofdm transmitter and ''rx\_ofdm.grc'' for the ofdm receiver.+As you can guess ''tx\_ofdm.grc'' will be used for the OFDM transmitter and ''rx\_ofdm.grc'' for the OFDM receiver.
  
 The file tree should look like that: The file tree should look like that:
Line 38: Line 39:
 The next thing to do is to replace the transmission and decoding parts to put an ''USRP Sink'' block instead. You can remove the ''throttle'', ''Channel Model'', ''OFDM Receiver'' and ''Tag Debug'' blocks. The ''Throttle'' is not needed anymore because the ''USRP Sink'' block will cadence our graph. In replacement for these blocks, put and connect an ''USRP Sink'' block. The next thing to do is to replace the transmission and decoding parts to put an ''USRP Sink'' block instead. You can remove the ''throttle'', ''Channel Model'', ''OFDM Receiver'' and ''Tag Debug'' blocks. The ''Throttle'' is not needed anymore because the ''USRP Sink'' block will cadence our graph. In replacement for these blocks, put and connect an ''USRP Sink'' block.
  
-The last thing to do is to configure USRP parameters. Open the ''USRP Sink'' block. We have nothing to change in the General tab. We don't have to specify a device address because we only have one USRP per node so it can be discovered automatically by the system. The Samp Rate should be binded with the samp\_rate variable (We will change it later). Switch to the RF Options tab. Set the Center Freq at 2490000000 (2.49 GHz). We are going to use an absolute gain of 20 dB. The antenna to use is 'TX/RX' and the Bandwidth parameter should remain at 0. Finally, set the samp\_rate variable to 5000000 (5 MHz) using the corresponding variable block located at the top of the flow graph.+The last thing to do is to configure USRP parameters. Open the ''USRP Sink'' block. We have nothing to change in the General tab. We don't have to specify a device address because we only have one USRP per node so it can be discovered automatically by the system. The Samp Rate should be binded with the samp\_rate variable (We will change it later). Switch to the RF Options tab. The Center Freq value is of type float. You can set the Center Freq to 2.49e9 (2.49 GHz). We are going to use an absolute gain of 20 dB. The antenna to use is 'TX/RX' and the Bandwidth parameter should remain at 0. Finally, set the samp\_rate variable to 5000000 (5 MHz) using the corresponding variable block located at the top of the flow graph.
  
 In the end your graph should look like this : In the end your graph should look like this :
Line 54: Line 55:
 The next thing to do is to replace encoding and transmission parts to put an ''USRP Source'' block instead. You can remove the ''Random Source'', ''Stream to tagged stream'', ''OFDM Transmitter'' ''Channel Model'' and ''throttle'' blocks. The ''Throttle'' is not needed anymore because the ''USRP Source'' block will cadence our graph. Instead of these blocks, put and connect an ''USRP Source'' block. Also, it is highly recommended to add a filter in the ''Tag Debug'' block in order to avoid printing a huge amount of useless data. Open the ''tag debug'' block and add the key filter "packet_num". The next thing to do is to replace encoding and transmission parts to put an ''USRP Source'' block instead. You can remove the ''Random Source'', ''Stream to tagged stream'', ''OFDM Transmitter'' ''Channel Model'' and ''throttle'' blocks. The ''Throttle'' is not needed anymore because the ''USRP Source'' block will cadence our graph. Instead of these blocks, put and connect an ''USRP Source'' block. Also, it is highly recommended to add a filter in the ''Tag Debug'' block in order to avoid printing a huge amount of useless data. Open the ''tag debug'' block and add the key filter "packet_num".
  
-The last thing to do is to configure USRP parameters. Open the ''USRP Source'' block. We have nothing to change in the General tab. We don't have to specify a device address because we only have one USRP per node so it can be discovered automatically by the system. The Samp Rate should be binded with the samp\_rate variable (We will change it later). Switch to the RF Options tab. Set the Center Freq at 2490000000 (2.49 GHz). We are going to use an absolute gain of 20 dB. The antenna to use is 'TX/RX' ('RX2'  can't be used !) and the Bandwidth parameter should remain at 0. Finally, set the samp\_rate variable to 5000000 (5 MHz) using the corresponding variable block located in top of the flow graph.+The last thing to do is to configure USRP parameters. Open the ''USRP Source'' block. We have nothing to change in the General tab. We don't have to specify a device address because we only have one USRP per node so it can be discovered automatically by the system. The Samp Rate should be binded with the samp\_rate variable (We will change it later). Switch to the RF Options tab. Set the Center Freq at 2490000000 (2.49 GHz). We are going to use an absolute gain of 20 dB. The antenna to use is 'TX/RX' ('RX2'  can't be used !) and the Bandwidth parameter should remain at 0. Finally, set the samp\_rate variable to 5e6 (5 MHz) using the corresponding variable block located in top of the flow graph.
  
 In the end your graph should look like this : In the end your graph should look like this :
Line 68: Line 69:
 ## Create the scenario ## Create the scenario
  
-The experiment description file called `scenario.desc` will be looked for and read by the experiment scheduler to get which nodes and what software will be used during the experiment. It also gives the necessary startup scripts and parameters that the user provides for his experiment.+The experiment description file called `scenario.yaml` will be looked for and read by the experiment scheduler to get which nodes and what software will be used during the experiment. It also gives the necessary startup scripts and parameters that the user provides for his experiment.
  
-Here is a simple example of a `scenario.desc` file:+Here is a simple example of a `scenario.yaml` file:
 <code> <code>
 # Example scenario description file # Example scenario description file
Line 79: Line 80:
 # Scenario textual description # Scenario textual description
 #   simple string (a one liner) #   simple string (a one liner)
-desc OFDM tx-rx example scenario for CorteXlab+description: OFDM tx-rx example scenario for CorteXlab
  
 # Experiment maximum duration # Experiment maximum duration
 #   Time after which the experiment is forced to stop #   Time after which the experiment is forced to stop
-#   integer (minutes+#   integer (seconds
-durat 2+duration: 60
  
 # Node list # Node list
Line 90: Line 91:
 #   format: #   format:
 # #
-#   (machine): +#   nodes: 
-  entry (entry point script relative to the task root+#     (machine): 
-#   exit (exit point script relative to the task root. Use "none" for none)+      command: (entry point script relative to the task root)
  
-node4: +nodes: 
-   entry rx_ofdm.py +  node4: 
-   params dummy-but-needed +    command: ./rx_ofdm.py 
- +    passive: true 
-node6: +  node6: 
-   entry tx_ofdm.py +    command: ./tx_ofdm.py
-   params dummy-but-needed+
 </code> </code>
  
-This file uses its own syntax and is self-documented. Here the params line is mandatory even if it is not used (This will be changed in a future version). Adapt this example to suit your needs.+This file uses the yaml syntax and is self-documented. Adapt this example to suit your needs.
  
  
Line 114: Line 114:
 │   ├── tx_ofdm.py │   ├── tx_ofdm.py
 │   ├── rx_ofdm.py │   ├── rx_ofdm.py
-│   ├── scenario.desc+│   ├── scenario.yaml
 │   ├── tx_ofdm.grc │   ├── tx_ofdm.grc
 │   └── rx_ofdm.grc │   └── rx_ofdm.grc
Line 177: Line 177:
 <code> <code>
 you@srvairlock:~$ minus testbed status you@srvairlock:~$ minus testbed status
-Testbed status+num total tasks  2540 
-ID count so far6 +num tasks waiting0 
-Number of awaiting jobs: 0 +num tasks running: 0 
-ID of the running jobNone (None means server is idle)+tasks currently running: 
 +  (none)
 </code> </code>
  
Line 186: Line 187:
  
  
-Once it's finished (we have set the duration to 2 minutes), Minus will take care of copying the results and output messages back to your home folder in srvairlock, such that you can analyse it.+Once it's finished (we have set the duration to 2 minutes), Minus will take care of copying the results and output messages back to your home folder in srvairlock, so that you can analyze it.
  
 All results are stored by task number in the results folder, inside your home folder. All results are stored by task number in the results folder, inside your home folder.
Line 208: Line 209:
 you@srvairlock:~/results/task_15$ cd node4 you@srvairlock:~/results/task_15$ cd node4
 you@srvairlock:~/results/task_15/node4$ ls you@srvairlock:~/results/task_15/node4$ ls
-rx_ofdm.grc  scenario.desc  stdout.txt   tx_ofdm.py+rx_ofdm.grc  scenario.yaml  stdout.txt   tx_ofdm.py
 rx_ofdm.py   stderr.txt     tx_ofdm.grc rx_ofdm.py   stderr.txt     tx_ofdm.grc
 </code> </code>
Line 214: Line 215:
 We see that all of the files we used to create the task are inside. The other two are: We see that all of the files we used to create the task are inside. The other two are:
  
-  * ''stdout.txt'': all output messages from your GNU Radio python script are written here. These include GNU Radio messages as well as all "print"s you include in your code. Seeing the contents of this file is useful to assert its correct operation.+  * ''stdout.txt'': all output messages from your GNU Radio python script are written here. These include GNU Radio messages as well as all "print"s you include in your code. Seeing the contents of this file is useful to assert correct operation.
   * ''stderr.txt'': all error messages are printed here. If you see strange things on the ''stdout.txt'' or nothing at all, it might be interesting to take a look at the ''stderr.txt'' to debug your code.   * ''stderr.txt'': all error messages are printed here. If you see strange things on the ''stdout.txt'' or nothing at all, it might be interesting to take a look at the ''stderr.txt'' to debug your code.
  
from_gnuradio_to_cortxlab.txt · Last modified: 2018/01/29 14:31 by mimbert

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki