Changes between Version 3 and Version 4 of Tutorials/k0SDR/Tutorial27


Ignore:
Timestamp:
Oct 4, 2019, 6:10:07 PM (5 years ago)
Author:
prasanthi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/k0SDR/Tutorial27

    v3 v4  
    1818
    1919==== Prepare network setup for USRP access ====
     20Each X310 on SB2 is connected to its respective node through a 10G interface adapter installed in Port 0 of the USRP. In this configuration, the X310 will have a default IP address of 192.168.40.2 (see ​X310 User Manual). To setup network connectivity, make sure eth2 is configured with an address in the 192.168.40.0/24 subnet .
     21{{{
     22root@node1-1:~# ifconfig eth2 192.168.40.1 netmask 255.255.255.0 mtu 9000
     23root@node1-1:~# ifconfig -a
     24eth0      Link encap:Ethernet  HWaddr 70:8b:cd:bc:84:4b
     25          BROADCAST MULTICAST  MTU:1500  Metric:1
     26          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
     27          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
     28          collisions:0 txqueuelen:1000
     29          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
     30
     31eth1      Link encap:Ethernet  HWaddr 70:8b:cd:bc:84:4a
     32          inet addr:10.12.1.1  Bcast:10.12.255.255  Mask:255.255.0.0
     33          inet6 addr: fe80::728b:cdff:febc:844a/64 Scope:Link
     34          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     35          RX packets:166714 errors:0 dropped:0 overruns:0 frame:0
     36          TX packets:79009 errors:0 dropped:0 overruns:0 carrier:0
     37          collisions:0 txqueuelen:1000
     38          RX bytes:246154097 (246.1 MB)  TX bytes:6546168 (6.5 MB)
     39          Interrupt:20 Memory:f7d00000-f7d20000
     40
     41eth2      Link encap:Ethernet  HWaddr f4:52:14:83:b7:20
     42          inet addr:192.168.40.1  Bcast:192.168.40.255  Mask:255.255.255.0
     43          inet6 addr: fe80::f652:14ff:fe83:b720/64 Scope:Link
     44          UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1
     45          RX packets:5263 errors:0 dropped:0 overruns:0 frame:0
     46          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
     47          collisions:0 txqueuelen:1000
     48          RX bytes:315780 (315.7 KB)  TX bytes:3365 (3.3 KB)
     49
     50lo        Link encap:Local Loopback
     51          inet addr:127.0.0.1  Mask:255.0.0.0
     52          inet6 addr: ::1/128 Scope:Host
     53          UP LOOPBACK RUNNING  MTU:65536  Metric:1
     54          RX packets:325 errors:0 dropped:0 overruns:0 frame:0
     55          TX packets:325 errors:0 dropped:0 overruns:0 carrier:0
     56          collisions:0 txqueuelen:1
     57          RX bytes:25308 (25.3 KB)  TX bytes:25308 (25.3 KB)
     58
     59}}}
     60With 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.
     61{{{
     62root@node1-1:~# uhd_find_devices
     63[INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.13.0.HEAD-0-g5b236772
     64--------------------------------------------------
     65-- UHD Device 0
     66--------------------------------------------------
     67Device Address:
     68    serial: 30F110A
     69    addr: 192.168.40.2
     70    fpga: HG
     71    name:
     72    product: X310
     73    type: x300
    2074
    2175
     76root@node1-1:~# uhd_usrp_probe
     77[INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.13.0.HEAD-0-g5b236772
     78[INFO] [X300] X300 initialization sequence...
     79[INFO] [X300] Maximum frame size: 8000 bytes.
     80[INFO] [X300] Radio 1x clock: 200 MHz
     81[INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000000)
     82[ERROR] [0/DmaFIFO_0] Major compat number mismatch for noc_shell: Expecting 2, got 5.
     83Error: RuntimeError: FPGA component `noc_shell' is revision 5 and UHD supports revision 2. Please either upgrade UHD  (recommended) or downgrade the FPGA image.
     84
     85}}}
     86If 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.
     87{{{
     88root@node1-1:/usr/local/share/uhd# uhd_image_loader --args="type=x300,fpga=HG"
     89[INFO] [UHD] linux; GNU C++ version 5.4.0 20160609; Boost_105800; UHD_3.13.0.HEAD-0-g5b236772
     90Unit: USRP X310 (30F110A, 192.168.40.2)
     91FPGA Image: /usr/local/share/uhd/images/usrp_x310_fpga_HG.bit
     92-- Initializing FPGA loading...successful.
     93-- Loading HG FPGA image: 100% (121/121 sectors)
     94-- Finalizing image load...successful.
     95Power-cycle the USRP X310 to use the new image.
     96}}}
     97Power cycle the USRP - exit the node and use omf commands to power-cycle the node, which in turn power-cycles the USRP.
     98Turn the nodes off.
     99{{{
     100prasanthi@console.sb2:~$ omf tell -a offh -t node1-1,node1-2
     101}}}
     102Once the off command is complete, wait for a minute and turn them back on.
     103{{{
     104prasanthi@console.sb2:~$ omf tell -a on -t node1-1,node1-2
     105}}}
     106Log on to the nodes, setup networking as described above and test USRP access
     107{{{
     108root@node1-1:~# ifconfig eth2 192.168.40.1 mtu 9000
     109root@node1-1:~# uhd_usrp_probe
     110.
     111.
     112.
     113|   |    /
     114|   |   |       RFNoC blocks on this device:
     115|   |   |
     116|   |   |   * DmaFIFO_0
     117|   |   |   * Radio_0
     118|   |   |   * Radio_1
     119|   |   |   * DDC_0
     120|   |   |   * DDC_1
     121|   |   |   * DUC_0
     122|   |   |   * DUC_1
     123
     124}}}
     125 
    22126
    23127=== Run the experiment ===
    24 * Run rfnoc_spec_sense_display on the receive node. The command below starts the application to receive spectrum sensing samples from 4 USRP X310s at 100MSPS.
     128Once both the USRPs are ready and accessible, run the experiment.
     129* Send a waveform from the TX node, node1-1
    25130{{{
    26 root@node1-19:~/uhd/host/build/examples# ./rfnoc_spec_sense_display --args="addr0=10.10.23.11,addr1=10.10.23.12,addr2=10.10.23.13,addr3=10.10.23.14,skip_ddc,skip_duc" --freq 5e9 --gain 15 --ddc-args="input_rate=200000000.0,output_rate=100000000.0" --num-usrp 4 --spec-sense-args="avg_size=256"
     131root@node1-1:~/uhd/host/build/examples# ./tx_waveforms --freq 2e9 --rate 10e6 --wave-type SINE --wave-freq 1e6 --gain 0
    27132}}}
    28 * Run rfnoc_spreader on the transmit node. The command below starts the application to send a 50MHz wide PN signal on node23-17.
     133* Run a spectrum analyzer application on the RX node, node1-2, to view the waveform
    29134{{{
    30 root@node1-20:~/uhd/host/build/examples# ./rfnoc_spreader --args="addr=10.10.23.17,skip_ddc,skip_duc" --freq 5e9 --gain 15 --duc-args="input_rate=50000000.0,output_rate=200000000.0"
     135root@node1-2:~/uhd/host/build/examples# ./rx_ascii_art_dft --freq 2e9 --rate 10e6 --gain 0 --ref-lvl -40
    31136}}}
    32 * Download spec_sense_display.html and open it in your browser. Once you click the Start button, you should see power spectrum display as shown below.
    33137
    34     || [[Image(spec_sense_display.jpg)]]||
     138    || [[Image(SB2_ascii_art_sinewave.jpg)]]||
    35139