======= Experimenting with the USRPs =======
===== Providing USRP programs =====
In CorteXlab, USRPs are programmed using the [[http://gnuradio.org|GNURadio]] toolchain. GNURadio is a free and open-source software development toolkit that provides signal processing blocks to implement software radios. In order to avoid arbitrary changes coming from the GNURadio development community, CorteXlab maintains a copy of the GNURadio repository, which contains the exact same version of GNURadio as the one installed on the CorteXlab nodes. This distribution can be downloaded [[https://github.com/CorteXlab/cxlb-build-toolchain|Here]] with some explanation [here](building_a_toolchain)
Programming a USRP with GNURadio is not an easy task, the user should be familiar with that, and should refer
to the [[http://gnuradio.org|GNURadio]] website if he is not. A CorteXlab program consists of a number of GNURadio python scripts, executed on the PCs connected to the USRPs (of course several USRPs can share the same GNURadio code).
For instance, in the ''ofdm\_p2p'' example present in your examples directory on your airlock home directory, the following script will be executed by the PC connected to the first USRP:
$ benchmark_tx.py --antenna="TX/RX" --tx-amplitude=0.2 -v -W 2M -f 2.49G
The script called as the entry point could be anything, it is up to the user to decide what, the parameters, etc. The only constraint is that it should be able to run with the GNURadio toolchain deployed on CorteXlab. If the user wants to add more packages or libraries, he should put the files in the task directory upon creation of the task.
For instance, in the ''ofdm\_p2p'' example, the ''benchmark\_tx.py'' script uses the ''transmit\_path'' class which is defined in the ''transmit\_path.py'' module, which is thus present in the ''ofdm\_p2p'' directory.
Again, using the ''ofdm\_p2p'' example, this example uses 2 USRPs (one transmitting, the other receiving), the script run on the PC connected to the second USRP is:
$ benchmark_rx.py --antenna="TX/RX" --rx-gain=25 -v -W 2M -f 2.49G