Changes between Version 1 and Version 2 of Tutorials/k0SDR/Tutorial00b


Ignore:
Timestamp:
Jul 26, 2021, 6:51:39 AM (3 years ago)
Author:
mpk2138
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/k0SDR/Tutorial00b

    v1 v2  
    1717=== Set Up ===
    1818==== Imaging ====
    19 First, make sure you have Sandbox 2 reserved and are logged into the console over SSH.
     19First, 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)'''
    2020
    2121We should make sure that both of the nodes are turned off:
     
    3939Give the node about a minute to turn on and be ready, and then SSH into the first node:
    4040
    41 {{{mpk2138@console:~$ ssh root@node1-1}}}
     41{{{mpk2138@console:~$ ssh -X root@node1-1}}}
    4242
    4343Once 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:
    4444
    45 {{{mpk2138@console:~$ ssh root@node1-2}}}
     45{{{mpk2138@console:~$ ssh -X root@node1-2}}}
    4646
    4747At 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 ====
     52We 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
     54Start 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
     60Accept whatever prompts {{{sudo apt install}}} gives you.
     61
     62Then, reboot the node. First, exit it:
     63
     64{{{root@node1-2:~# exit}}}
     65
     66You 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
     70Wait a minute or so:
     71
     72{{{mpk2138@console:~$ omf tell -a on -t node1-2}}}
     73
     74After 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
     78Now, 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}}}
    4882
    4983==== Configuring the Network Interface ====
     
    75109Please ensure this works before proceeding.
    76110
    77 === Running the UHD example experiment ===
     111==== Setting up GNU Radio ====
     112To 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
     118Now 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 ===
    78125''See the troubleshooting section below for a common error and how to fix it.''
    79126
    80 Now, we can run the example UHD experiment to make sure that the radios are able to transmit and receive.
     127Start GNU Radio on {{{node1-1}}}:
    81128
    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}}}
    83130
    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 
     131The GNU Radio interface should show up on your local machine. The goal is to build a flowgraph that looks like this:
    88132
    89133=== Troubleshooting ===
     
    131175{{{root@node1-X:~# exit}}}
    132176
    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.
     177Once 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.
    142178
    143179The "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.