== 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 }}} Resize the send and receive buffers to support UHD applications {{{ root@node1-1:~# sysctl -w net.core.wmem_max=24862979 net.core.wmem_max = 24862979 root@node1-1:~# sysctl -w net.core.rmem_max=24862979 net.core.rmem_max = 24862979 }}} 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 7.5.0; Boost_106501; UHD_3.15.0.0-release [INFO] [X300] X300 initialization sequence... . .| | | RFNoC blocks on this device: | | | | | | * DmaFIFO_0 | | | * Radio_0 | | | * Radio_1 | | | * DDC_0 | | | * DDC_1 | | | * DUC_0 | | | * DUC_1 }}} 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 onto the USRP. Power cycle the USRP (by power cycling the node using the omf 'offh' and 'on' commands) for the new image to take effect. === 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:~# /usr/lib/uhd/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:~# /usr/lib/uhd/examples/rx_ascii_art_dft --freq 2e9 --rate 10e6 --gain 0 --ref-lvl -40 }}} || [[Image(SB2_ascii_art_sinewave.jpg)]]||