== Basic usage == === Desciption === In this tutorial we'll demonstrate how to navigate from the COSMOS sandbox to a single SDR on a node and run an application to read samples from the SDR. === Set up === For this example we used the Krypton SDR on console.sb1.cosmos-lab.org. Follow the steps below to gain access to this console and set up your node with an appropriate image. 1. Sign up for a [https://cosmos-lab.org/portal-2/ COSMOS account] 2. [Documentation/Short/CreateRes Create a resource reservation on sandbox 1] 3. [Documentation/Short/Login Login into your reserved domain.] 4. Load baseline-uhd1.ndz on your resource. [Documentation/Short/LoadImage - this is done via OMF commands.] When opening a terminal into console.sb1.cosmos-lab.org set up a tunnel from localhost:5002 to sdr2-lg1.sb1.cosmos-lab.org:9002. This will be used by the web app to connect to a server running on the Krypton's host. === Configure and detect the radio === * Once your node is ready and turned on, ssh into the Krypton's host {{{ console:~$ ssh root@sdr2-lg1.sb1.cosmos-lab.org }}} * Configure and load the appropriate PCIe driver to access the Krypton's radio. Detailed steps for driver install and radio detection are on the [https://wiki.cosmos-lab.org/wiki/tutorials/krypton_usage Krypton usage page]. If the drivers are already pre-install on the image, just start the modules using ''niusrprio_pcie''. {{{ root@sdr2-lg1:~# /usr/local/bin/niusrprio_pcie start }}} Run ''uhd_find_devices' and check if the N310 is detected {{{ root@sdr2-lg1:~# uhd_find_devices --args="type=x300" [INFO] [UHD] linux; GNU C++ version 7.4.0; Boost_106501; UHD_3.14.0.HEAD-0-g6875d061 -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 31557B9 fpga: HG name: product: X310 resource: RIO0 type: x300 }}} The above output enumerates all the SDRs that were detected. Krypton has only one PCIe radio device of type=x300. Use the ''uhd_usrp_probe'' command to get more details on the x300. {{{ root@sdr2-lg1:~# uhd_usrp_probe --args="type=x300" [INFO] [UHD] linux; GNU C++ version 7.4.0; Boost_106501; UHD_3.14.0.HEAD-0-g6875d061 [INFO] [X300] X300 initialization sequence... [INFO] [X300] Connecting to niusrpriorpc at localhost:5444... [INFO] [X300] Using LVBITX bitfile /usr/local/share/uhd/images/usrp_x310_fpga_HG.lvbitx... [INFO] [X300] Radio 1x clock: 200 MHz [INFO] [GPS] Found an internal GPSDO: LC_XO, Firmware Rev 0.929a [INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000000) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1301 MB/s) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1303 MB/s) [INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000000001) [INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000000001) [INFO] [0/DDC_0] Initializing block control (NOC ID: 0xDDC0000000000000) [INFO] [0/DDC_1] Initializing block control (NOC ID: 0xDDC0000000000000) [INFO] [0/DUC_0] Initializing block control (NOC ID: 0xD0C0000000000000) [INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000000) _____________________________________________________ / | Device: X-Series Device | _____________________________________________________ | / | | Mboard: X310 | | revision: 12 | | revision_compat: 7 | | product: 30810 | | mac-addr0: 00:11:22:33:44:55 | | mac-addr1: 66:77:88:99:aa:bb | | gateway: 192.168.10.1 | | ip-addr0: 192.168.10.2 | | subnet0: 255.255.255.0 | | ip-addr1: 192.168.40.2 | | subnet1: 255.255.255.0 | | ip-addr2: 255.255.255.255 | | subnet2: 255.255.255.0 | | ip-addr3: 255.255.255.255 | | subnet3: 255.255.255.0 | | serial: 31557B9 | | FW Version: 6.0 | | FPGA Version: 35.1 | | FPGA git hash: 4c165a5 | | RFNoC capable: Yes | | | | Time sources: internal, external, gpsdo | | Clock sources: internal, external, gpsdo | | Sensors: gps_gpgga, gps_gprmc, gps_time, gps_locked, gps_servo, ref_locked | | _____________________________________________________ | | / | | | RX Dboard: A | | | ID: UBX-TDD (0x0203) | | | Serial: 31584CF | | | _____________________________________________________ | | | / | | | | RX Frontend: 0 | | | | Name: UBX RX | | | | Antennas: TX/RX, RX2, CAL | | | | Sensors: lo_locked | | | | Freq range: 10.000 to 6000.000 MHz | | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB | | | | Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | RX Codec: A | | | | Name: ads62p48 | | | | Gain range digital: 0.0 to 6.0 step 0.5 dB | | _____________________________________________________ | | / | | | RX Dboard: B | | | ID: UBX-TDD (0x0203) | | | Serial: 31584EE | | | _____________________________________________________ | | | / | | | | RX Frontend: 0 | | | | Name: UBX RX | | | | Antennas: TX/RX, RX2, CAL | | | | Sensors: lo_locked | | | | Freq range: 10.000 to 6000.000 MHz | | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB | | | | Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | RX Codec: B | | | | Name: ads62p48 | | | | Gain range digital: 0.0 to 6.0 step 0.5 dB | | _____________________________________________________ | | / | | | TX Dboard: A | | | ID: UBX-TDD (0x0202) | | | Serial: 31584CF | | | _____________________________________________________ | | | / | | | | TX Frontend: 0 | | | | Name: UBX TX | | | | Antennas: TX/RX, CAL | | | | Sensors: lo_locked | | | | Freq range: 10.000 to 6000.000 MHz | | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB | | | | Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz | | | | Connection Type: QI | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | TX Codec: A | | | | Name: ad9146 | | | | Gain Elements: None | | _____________________________________________________ | | / | | | TX Dboard: B | | | ID: UBX-TDD (0x0202) | | | Serial: 31584EE | | | _____________________________________________________ | | | / | | | | TX Frontend: 0 | | | | Name: UBX TX | | | | Antennas: TX/RX, CAL | | | | Sensors: lo_locked | | | | Freq range: 10.000 to 6000.000 MHz | | | | Gain range PGA0: 0.0 to 31.5 step 0.5 dB | | | | Bandwidth range: 160000000.0 to 160000000.0 step 0.0 Hz | | | | Connection Type: QI | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | TX Codec: B | | | | Name: ad9146 | | | | Gain Elements: None | | _____________________________________________________ | | / | | | RFNoC blocks on this device: | | | | | | * DmaFIFO_0 | | | * Radio_0 | | | * Radio_1 | | | * DDC_0 | | | * DDC_1 | | | * DUC_0 | | | * DUC_1 }}} === Run the application === From root/SPECTRUM_VIEW directory run the pre-compiled application that can read samples from the Krypton's radio. There are two channels inside the radio which are being read out but only the first channel is displayed. {{{ root@sdr2-lg1:~/SPECVIEW_VIEW# cd SPECTRUM_VIEW/ root@sdr2-lg1:~/SPECVIEW_VIEW# ./app_read_sdr_samples INFO 11:51:08.262 (main.cpp:623) - Starting command server at 5180 INFO 11:51:08.262 (main.cpp:175) - Starting websock server at 9002 ........... }}} In short the application runs a server listening for commands. Just to briefly demonstrate some functionality, open the spectrum_view.html file in a Chrome browser. When the viewer is first opened, the page display should be similar to the following || [[Image(basic_usage_spectrum_view_1.png, width=500px)]] || Ensure the localhost field is set to ''localhost:5002'' and the device type field is set to ''type=x300''. Click the ''connect'' button once and a "WebSocket Connection" statement should be output by the application. Now click on ''make'' to create a device handle. Finally click on ''submit'' to adjust the radio parameters and the ''Go'' button to display a short spectrum bandwidth. Keep the default values for RATE, FREQ, GAIN and click on the HALTED button. This should display the spectrum if all went well. || [[Image(basic_usage_spectrum_view_2.png, width=500px)]] || === Troubleshooting ===