[[Include(WikiToC)]] == GNURadio OFDM tutorial == === Description === This tutorial illustrates the use of GNURadio OFDM blocks for data transfer between a pair of USRPs. The GNURadio flowgraphs used here were obtained from the workshop material provided for [https://gitlab.flux.utah.edu/powderrenewpublic/mww2019 POWDER-RENEW Mobile and Wireless Week 2019]. They are mainly based on the GRC examples available in the [https://github.com/gnuradio/gnuradio/tree/main/gr-digital/examples/ofdm GNURadio repository]. For a good understanding of the flowgraphs and the blocks, please refer to OFDM pages on GNURadio Wiki such as [https://wiki.gnuradio.org/index.php/Basic_OFDM_Tutorial OFDM Basics] and [https://wiki.gnuradio.org/index.php/Schmidl_%26_Cox_OFDM_synch. OFDM Synchronization] === Prerequisites === In 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. === Resources required === A pair of USRPs in COSMOS or ORBIT testbed. - 2 USRP X310s (connected to node1-1,node1-2) in sb2.orbit-lab.org or - 2 USRP 2974s (sdr2-s1-lg1,sdr1-md1) in sb1.cosmos-lab.org === Tutorial Setup === Follow the steps below to gain access to the [wiki:/hardware/Domains/sb1 sandbox 1 console] and set up nodes with appropriate images. 1. If you don't have one already, sign up for a [https://www.cosmos-lab.org/portal-2/ COSMOS account] 1. [wiki:/GettingStarted#MakeaReservation Create a resource reservation] on sandbox 1 1. [wiki:/GettingStarted#LogintoyourReservation Login] into sandbox 1 console (console.sb1.cosmos-lab.org) with an SSH session. SSH session for COSMOS SB1 with MobaXterm can be setup as shown, with remote host = console.sb1.cosmos-lab.org, and username = your COSMOS username. X11 forwarding is enabled to access GUI. [[Image(mobaxterm_sb1_session.JPG, width=600px)]] 1. Make sure all the nodes and devices used in the experiment are turned off: {{{#!shell omf tell -a offh -t system:topo:all }}} 1. Load gnuradio_ofdm.ndz on both the nodes {{{#!shell omf load -i gnuradio_ofdm.ndz -t node1-1,node1-2 }}} 1. Turn the nodes on and check the status {{{#!shell omf tell -a on -t node1-1,node1-2 }}} {{{#!shell omf stat -t all }}} 1. Open 2 terminal sessions and ssh into the nodes with -Y for X11 forwarding {{{#!shell ssh root@node1-1 -Y ssh root@node1-2 -Y }}} === Experiment Execution === ==== Find the USRPs ==== 1. As mentioned in the [https://orbit-lab.org/wiki/Hardware/bDomains/cSandboxes/bSB2 sb2.orbit] page, the X310s have their port 1 directly connected to their respective nodes, and the IP addresses hardcoded to 192.168.40.2 as given in the [https://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_setup_network X310 manual]. To access the X310s Run eth_config_sb2_orbit.sh on both the nodes. It sets a static IP address 192.168.40.1 on eno2 interface. {{{#!shell }}} 2. Run uhd_find_devices and uhd_usrp_probe to detect the X310s and to make sure they have a compatible firmware installed. {{{#!shell }}} 3. In case of firmware mismatch, follow the directions displayed in the error message and use uhd_image_loader to update the firmware. {{{#!shell }}} ==== Run the GRC application ==== 1. Start the OFDM receiver on node1-2 {{{#!shell gnuradio-companion }}} {{{#!shell root@sdr2-s1-lg1:~# gnuradio-companion /root/gr-ettus/examples/rfnoc/rfnoc_fosphor.grc <<< Welcome to GNU Radio Companion 3.7.14.0 >>> Block paths: /usr/local/share/gnuradio/grc/blocks Loading: "/root/gr-ettus/examples/rfnoc/rfnoc_fosphor.grc" >>> Done }}} With X11 forwarding enabled, GRC should show up as below. [[Image(TX_OFDM_grc.png, width=800px)]] 2. Run the OFDM transmitter on node1-1 {{{#!shell }}} [[Image(TX_OFDM_grc.png, width=800px)]] 3. Make sure the device arguments on both nodes are correctly set as shown below. Check the center frequencies and sample rates, and make sure they match. TX_OFDM.grc has a "File Source" block which reads the text file to be transmitted. RX_OFDM.grc stores the received data in a local file that is specified in the "File Sink" block. [[Image(TX_OFDM_grc.png, width=800px)]] 4. Run the receive flowgraph followed by the transmit flowgraph.