Changes between Version 1 and Version 2 of Tutorials/k0SDR/Tutorial00b
- Timestamp:
- Jul 26, 2021, 6:51:39 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Tutorials/k0SDR/Tutorial00b
v1 v2 17 17 === Set Up === 18 18 ==== Imaging ==== 19 First, make sure you have Sandbox 2 reserved and are logged into the console over SSH. 19 First, make sure you have Sandbox 2 reserved and are logged into the console over SSH. '''Please enable X11 forwarding, by using the -X flag (-Y if on Mac OS)''' 20 20 21 21 We should make sure that both of the nodes are turned off: … … 39 39 Give the node about a minute to turn on and be ready, and then SSH into the first node: 40 40 41 {{{mpk2138@console:~$ ssh root@node1-1}}}41 {{{mpk2138@console:~$ ssh -X root@node1-1}}} 42 42 43 43 Once you have SSH'd into {{{node1-1}}}, open a second SSH session and login to the Sandbox 2 console as before. On that new SSH session, SSH into the other node: 44 44 45 {{{mpk2138@console:~$ ssh root@node1-2}}}45 {{{mpk2138@console:~$ ssh -X root@node1-2}}} 46 46 47 47 At this stage, you should have two SSH windows open, each logged into one of the two nodes. 48 49 {{{ 50 #!comment 51 ==== Install Octave on node1-2 ==== 52 We will need Octave (the GNU version of MATLAB) to process the data from our experiment. We only need to install it on {{{node1-2}}}. To do so, use the following commands: 53 54 Start by installing the new Ubuntu package manager, Snap: 55 56 {{{root@node1-2:~# sudo apt update}}} 57 58 {{{root@node1-2:~# sudo apt install snapd}}} 59 60 Accept whatever prompts {{{sudo apt install}}} gives you. 61 62 Then, reboot the node. First, exit it: 63 64 {{{root@node1-2:~# exit}}} 65 66 You will end up back in the Sandbox 2 console. Now, reboot the node: 67 68 {{{mpk2138@console:~$ omf tell -a offh -t node1-2}}} 69 70 Wait a minute or so: 71 72 {{{mpk2138@console:~$ omf tell -a on -t node1-2}}} 73 74 After another minute, you should now be able to log back into {{{node1-2}}}. Once you can, run the following command to install Octave: 75 76 {{{root@node1-2:~# sudo snap install octave}}} 77 78 Now, we need to setup a symbolic file link so Octave can find the correct X11 authentication file: 79 80 {{{root@node1-2:~# ln -s ~/.Xauthority ~/snap/octave/current/.Xauthority}}} 81 }}} 48 82 49 83 ==== Configuring the Network Interface ==== … … 75 109 Please ensure this works before proceeding. 76 110 77 === Running the UHD example experiment === 111 ==== Setting up GNU Radio ==== 112 To make sure GNU Radio can start, please run the following two commands on each node to point GNU Radio to the correct Python installation directories: 113 114 {{{root@node1-X:~# export PYTHONPATH=/usr/local/lib/python3/dist-packages/:$PYTHONPATH}}} 115 116 {{{root@node1-X:~# export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH}}} 117 118 Now we set the network card read and write buffer size to the maximum size possible: 119 120 {{{root@node1-X:~# sudo sysctl -w net.core.wmem_max=24862979}}} 121 122 {{{root@node1-X:~# sudo sysctl -w net.core.rmem_max=24862979}}} 123 124 === Building the GNU Radio Flowgraph === 78 125 ''See the troubleshooting section below for a common error and how to fix it.'' 79 126 80 Now, we can run the example UHD experiment to make sure that the radios are able to transmit and receive. 127 Start GNU Radio on {{{node1-1}}}: 81 128 82 Set up the USRP X310 on {{{node1-1}}} to transmit a 1 MHz sine wave sampled at 10 MHz, with 2GHz carrier frequency: 129 {{{root@node1-1:~# gnuradio-companion}}} 83 130 84 {{{root@node1-1:~# cd /usr/local/lib/uhd/examples/}}} 85 86 {{{root@node1-1:/usr/local/lib/uhd/examples/# ./tx_waveforms --freq 2e9 --rate 10e6 --wave-type SINE --wave-freq 1e6 --gain 0}}} 87 131 The GNU Radio interface should show up on your local machine. The goal is to build a flowgraph that looks like this: 88 132 89 133 === Troubleshooting === … … 131 175 {{{root@node1-X:~# exit}}} 132 176 133 Once back in the console, power cycle the node: 134 135 {{{mpk2138@console:~$ omf tell -a offh -t node1-X}}} 136 137 Wait a minute or so: 138 139 {{{mpk2138@console:~$ omf tell -a on -t node1-X}}} 140 141 You can now log back into the node over SSH and continue running the example experiment. 177 Once back in the console, power cycle the node using OMF. You can now log back into the node over SSH and continue on by setting up the network interface again. 142 178 143 179 The "imaging" outlined here is a very different procedure to "imaging" the node with a {{{.ndz}}} file. When imaging a node with a {{{.ndz}}} file, we are basically overwriting the hard drive with a backup. Imaging an FPGA on a USRP (or any FPGA in general) is the process of loading a new digital circuit configuration onto the FPGA's EEPROM - a much more delicate process which is why it must complete without disturbance.