== Simple Radio Example with USRP X310 on ORBIT Sandbox 2 == === Description === This tutorial shows a simple radio example - transmit a sine wave using an USRP X310 on ORBIT SB2, view it on another X310. === Set Up === Make a reservation on the [https://www.orbit-lab.org/schedule/ Orbit Scheduler] for using SB2. ==== Prepare the nodes ==== * Load baseline-sdr.ndz on nodes 1-1 and 1-2. {{{ root@console.sb2:~$ omf load -i baseline-sdr.ndz -t node1-1,node1-2 }}} * Once imaging is done, turn the nodes on and log in {{{ root@console.sb2:~$ omf tell -a on -t node1-1,node1-2 root@console.sb2:~$ ssh root@node1-1 root@console.sb2:~$ ssh root@node1-2 }}} ==== Prepare network setup for USRP access ==== Each X310 on SB2 is connected to its respective node through a 10G interface adapter installed in Port 1 of the USRP. In this configuration, the X310 will have a default IP address of 192.168.40.2 (see [http://files.ettus.com/manual/page_usrp_x3x0.html#x3x0_setup_network_host_interface X310 User Manual]). To setup network connectivity, make sure DATA2 interface is configured with an address in the 192.168.40.0/24 subnet. {{{ root@node1-1:~# ifconfig DATA2 192.168.40.1 netmask 255.255.255.0 mtu 9000 root@node1-1:~# ifconfig -a CTRL: flags=4163 mtu 1500 inet 10.12.1.1 netmask 255.255.0.0 broadcast 10.12.255.255 inet6 fe80::728b:cdff:febc:844a prefixlen 64 scopeid 0x20 ether 70:8b:cd:bc:84:4a txqueuelen 1000 (Ethernet) RX packets 1048 bytes 91762 (91.7 KB) RX errors 0 dropped 559 overruns 0 frame 0 TX packets 335 bytes 38105 (38.1 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 20 memory 0xf7d00000-f7d20000 DATA1: flags=4163 mtu 1500 inet6 fe80::728b:cdff:febc:844b prefixlen 64 scopeid 0x20 ether 70:8b:cd:bc:84:4b txqueuelen 1000 (Ethernet) RX packets 625 bytes 56232 (56.2 KB) RX errors 0 dropped 559 overruns 0 frame 0 TX packets 38 bytes 9320 (9.3 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 DATA2: flags=4163 mtu 9000 inet 192.168.40.1 netmask 255.255.0.0 broadcast 192.168.255.255 inet6 fe80::f652:14ff:fe83:b720 prefixlen 64 scopeid 0x20 ether f4:52:14:83:b7:20 txqueuelen 1000 (Ethernet) RX packets 75 bytes 4500 (4.5 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 43 bytes 10530 (10.5 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 210 bytes 17093 (17.0 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 210 bytes 17093 (17.0 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 }}} With this setup, each node should be able to access the X310 connected to it. Check USRP access with uhd_find_devices and uhd_usrp_probe commands. {{{ root@node1-1:~# uhd_find_devices [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.0-release -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 31B8F3F addr: 192.168.40.2 fpga: XG name: sdr1-1 product: X310 type: x300 root@node1-1:~# uhd_usrp_probe [INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.13.0.HEAD-0-g5b236772 [INFO] [X300] X300 initialization sequence... [INFO] [X300] Maximum frame size: 8000 bytes. [INFO] [X300] Radio 1x clock: 200 MHz [INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000000) [ERROR] [0/DmaFIFO_0] Major compat number mismatch for noc_shell: Expecting 2, got 5. Error: RuntimeError: FPGA component `noc_shell' is revision 5 and UHD supports revision 2. Please either upgrade UHD (recommended) or downgrade the FPGA image. }}} If uhd_usrp_probe reports firmware incompatibility, please run uhd_images_downloader to make sure compatible firmware images are available, and then load a new image on to the USRP. {{{ root@node1-1:/usr/local/share/uhd# uhd_image_loader --args="type=x300,fpga=HG" [INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.13.0.HEAD-0-g5b236772 Unit: USRP X310 (30F110A, 192.168.40.2) FPGA Image: /usr/local/share/uhd/images/usrp_x310_fpga_HG.bit -- Initializing FPGA loading...successful. -- Loading HG FPGA image: 100% (121/121 sectors) -- Finalizing image load...successful. Power-cycle the USRP X310 to use the new image. }}} Power cycle the USRP - exit the node and use omf commands to power-cycle the node, which in turn power-cycles the USRP. Turn the nodes off. {{{ prasanthi@console.sb2:~$ omf tell -a offh -t node1-1,node1-2 }}} Once the off command is complete, wait for a minute and turn them back on. {{{ prasanthi@console.sb2:~$ omf tell -a on -t node1-1,node1-2 }}} Log on to the nodes, setup networking as described above and test USRP access {{{ root@node1-1:~# ifconfig eth2 192.168.40.1 mtu 9000 root@node1-1:~# uhd_usrp_probe . . . | | / | | | RFNoC blocks on this device: | | | | | | * DmaFIFO_0 | | | * Radio_0 | | | * Radio_1 | | | * DDC_0 | | | * DDC_1 | | | * DUC_0 | | | * DUC_1 }}} === Run the experiment === Once both the USRPs are ready and accessible, run the experiment. * Send a waveform from the TX node, node1-1 {{{ root@node1-1:~/uhd/host/build/examples# ./tx_waveforms --freq 2e9 --rate 10e6 --wave-type SINE --wave-freq 1e6 --gain 0 }}} * Run a spectrum analyzer application on the RX node, node1-2, to view the waveform {{{ root@node1-2:~/uhd/host/build/examples# ./rx_ascii_art_dft --freq 2e9 --rate 10e6 --gain 0 --ref-lvl -40 }}} || [[Image(SB2_ascii_art_sinewave.jpg)]]||