User Tools

Site Tools


cortexlab102

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
cortexlab102 [2018/03/23 13:45] – [Lauching test_fft_web] trissetcortexlab102 [2018/11/19 19:59] (current) – [Sending the task to airlock] ooubejja
Line 38: Line 38:
 </code> </code>
  
-Some of these files as ''benchmark\_tx.py'' are already known to you. Some other are new, the only one that we will use is  ''usrp\_fft.py''. This script is used to configure the ''fft\_web'' bloc with all the necessary parameter: on which frequency it should listen, on which UDP port it should send its spectrum etc. +Some of these files as ''benchmark\_tx.py'' are already known to you. Some other are new, the only one that we will use is  ''usrp\_fft.py''. This script is used to configure the ''fft\_web'' GNU radio block with all the necessary parameter: on which frequency it should listen, on which UDP port it should send its spectrum etc. 
  
 The command line in the scenario.yaml file lists all these parameters, see below, and do not forget to change the number of the nodes corresponding to your tutorial. On can see below that the UDP port used here is 6663, please change it with the one associated with your tuto in the table above. The command line in the scenario.yaml file lists all these parameters, see below, and do not forget to change the number of the nodes corresponding to your tutorial. On can see below that the UDP port used here is 6663, please change it with the one associated with your tuto in the table above.
Line 68: Line 68:
 The task is now running, come back is the virtual machine an launch a Firefox browser ''internet -> Firefox ESR''. Actually you can use any browser present on your machine. The task is now running, come back is the virtual machine an launch a Firefox browser ''internet -> Firefox ESR''. Actually you can use any browser present on your machine.
  
-go to the following URL: ''http://xp.cortexlab.fr/fft/'', set the UDP port on which the transmission should occur and click on ''New graph'', you should your signal' spectrum, something like that: +go to the following URL: [[http://xp.cortexlab.fr/fft]], set the UDP port on which the transmission should occur and click on ''New graph'', you should your signal' spectrum, something like that: 
 {{:fftweb.png?800|}} {{:fftweb.png?800|}}
  
 ## Creating a flow graph on your PC ## Creating a flow graph on your PC
  
-As it is not very convenient to work on CorteXlab server, we will explain here how to create flow graphs and with GNUradio on your machine and export them to CorteXlab. We are going to create a new flowgraph called ''spectrum_analyzer.grc''.+As it is not very convenient to work on CorteXlab server, we will explain here how to create flow graphs with GNUradio on your machine and export them to CorteXlab. We are going to create a new flowgraph called ''spectrum_analyzer.grc''. 
 + 
 +### Cloning the example task 
 + 
 +An example task is provided in the FIT/CorteXlab GitHub repositories. It is kept up-to-date and well prepared to run. First let us prepare to clone the example task. 
 + 
 +Let us start by erasing any previous (and possibly outdated) version of the example task already present in your home dir: 
 + 
 +<code> 
 +cxlbusr@debian-jessie-cortexlab:~$ rm -rf examples 
 +</code> 
 + 
 +Now let us retrieve the examples repository on GitHub : 
 + 
 +<code> 
 +cxlbusr@debian-jessie-cortexlab:~$ git clone https://github.com/CorteXlab/examples.git 
 +cxlbusr@debian-jessie-cortexlab:~$ cd examples 
 +cxlbusr@debian-jessie-cortexlab:~/examples$ cd my_task 
 +</code> 
 + 
 +### Creating our flow graph
  
 Launch, on your virtual machine, the ''gnuradio-companion'' tool Launch, on your virtual machine, the ''gnuradio-companion'' tool
Line 80: Line 100:
 </code> </code>
  
- * Click on the “create a new flow graph” button ofgnuradio-companion+ * Click on the “create a new flow graph” button of gnuradio-companion
  * Change the parameters of this new flowgraph (double click on the “Options” block):   * Change the parameters of this new flowgraph (double click on the “Options” block): 
    * ID -> spectrum\_analyser    * ID -> spectrum\_analyser
Line 88: Line 108:
    * Run Options -> run to completion    * Run Options -> run to completion
  
 +
 + * Change the sample rate fot this flowgraph (double click on the “samp\_rate” variable block):
 +    set value to 2e6 (2Mhz) 
  
 Now we are going to add two blocks to the flowgraph: Now we are going to add two blocks to the flowgraph:
- * USRP Source (under UHD ) +  * USRP Source (under UHD ) 
- * fft web (Under CorteXlab)+  * fft web (Under CorteXlab)
  
  
 Connect the “out” connector of the UHD:USRP Source to the “in” connector of the fft web block. Connect the “out” connector of the UHD:USRP Source to the “in” connector of the fft web block.
  
-Here are the parameter to changed for  the two new blocs that we have added+Here are the parameter to change for  the two new blocs that we have added:
   * for USRP Source:    * for USRP Source: 
     * Sample rate -> samp\_rate (variable)     * Sample rate -> samp\_rate (variable)
-    * Center frequency -> 2.49e9+    * Center frequency -> your frequency! (for example: 2.49e9)
     * Gain -> 20 dB     * Gain -> 20 dB
     * Antenna -> TX/RX     * Antenna -> TX/RX
Line 105: Line 128:
     * fft size -> 256     * fft size -> 256
     * power max -> -50     * power max -> -50
-    * power min -> -10 +    * power min -> -100 
-    * port -> your port!+    * port -> your port! (for example: 6663)
     * frame rate -> 5     * frame rate -> 5
     * sample rate -> samp_rate (variable)     * sample rate -> samp_rate (variable)
Line 116: Line 139:
  
 Generate the flowgraph, a spectrum_analyzer.py should have appeared in the directory.  Generate the flowgraph, a spectrum_analyzer.py should have appeared in the directory. 
- 
- 
  
  
  
 ## Sending the task to airlock  ## Sending the task to airlock 
 +Copy the whole new directory to CorteXlab's server:
 <code> <code>
 cxlbusr@debian-jessie-cortexlab:~/my_fft_web$ cd .. cxlbusr@debian-jessie-cortexlab:~/my_fft_web$ cd ..
-cxlbusr@debian-jessie-cortexlab:~/$ scp -P 2269 -r my_fft_web/ tuto#@gw.cortexlab.fr:~+cxlbusr@debian-jessie-cortexlab:~/$ scp -P 22 -r my_fft_web/ tuto#@gw.cortexlab.fr:~
 </code> </code>
  
-Log on the testbed create a folder for your new task:+Log on the testbed and add the necessary files to your  your new task:
  
 <code> <code>
-you@srvairlock:~/examples/spectrum_analyzer$ cp ../my_task/benchmark_tx.py ./ +you@srvairlock:~/my_fft_web$ cp ~/examples/test_fft_web/benchmark_tx.py ./ 
-you@srvairlock:~/examples/spectrum_analyzer$ cp ../my_task/uhd_interface.py ./ +you@srvairlock:~/my_fft_web$ cp ~/examples/test_fft_web/uhd_interface.py ./ 
-you@srvairlock:~/examples/spectrum_analyzer$ cp ../my_task/transmit_path.py ./+you@srvairlock:~/my_fft_web$ cp ~/examples/test_fft_web/transmit_path.py ./ 
 +you@srvairlock:~/my_fft_web$ cp ~/examples/test_fft_web/scenario.yaml ./
 </code> </code>
  
Line 152: Line 174:
  
   node3:   node3:
-    command: ./spectrum_analyzer +    command: ./spectrum_analyzer.py
     passive: true     passive: true
 </code> </code>
cortexlab102.1521809105.txt.gz · Last modified: 2018/03/23 13:45 by trisset

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki