== 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. === Prerequisites === Before getting started you'll need the following: 1. sign up for a [https://cosmos-lab.org/portal-2/ COSMOS account] 2. create a reservation for sandbox 1 using the [https://wiki.cosmos-lab.org/cPanel/controlPanel/start scheduler]. 3. some minimal knowledge or interest of Linux === Set up === * After your reservation request has been approved, you'll receive access to the sandbox1 console. Open a terminal into console.sb1.cosmos-lab.org with a tunnel set up from localhost:5000 to srv1-lg1.sb1.cosmos-lab.org:9002 {{{ Welcome to _____ ____ _____ __ __ ____ _____ _ ____ / ____/ __ \ / ____| \/ |/ __ \ / ____| | | /\ | _ \ | | | | | | (___ | \ / | | | | (___ _____| | / \ | |_) | ___ _ __ __ _ | | | | | |\___ \| |\/| | | | |\___ \_____| | / /\ \ | _ < / _ \| '__/ _` | | |___| |__| |____) | | | | |__| |____) | | |____ / ____ \| |_) | (_) | | | (_| | \_____\____/|_____/|_| |_|\____/|_____/ |______/_/ \_\____(_)___/|_| \__, | __/ | |___/ Hostname : console.sb1.cosmos-lab.org Operating system : Ubuntu 16.04.5 LTS; Kernel: 4.15.0-45-generic; Arch: x86_64; CPU : 6 x Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz 1 socket(s) with 6 core(s) per socket and 1 thread(s) per core Memory : 3.9G Uptime : up 4 days, 14 hours, 15 minutes Users logged in : 0 Last login: Tue Feb 26 19:06:09 2019 from 165.230.132.125 }}} * We can see the available nodes under this sandbox using the ''omf stat -t all'' command. The nodes list below should coinside with the [https://wiki.cosmos-lab.org/cPanel/controlPanel/start Inventory/Status page]. {{{ nilanjan@console:~$ omf stat -t all ----------------------------------------------- Node: srv1-lg1.sb1.cosmos-lab.org State: POWEROFF Node: srv2-lg1.sb1.cosmos-lab.org State: POWEROFF ----------------------------------------------- }}} * For this example we'll use the node ''srv1-lg1.sb1.cosmos-lab.org'' and load the ''baseline-sdr.ndz'' image onto it. This image already has the applications pre-compiled and drivers installed. {{{ console:~$ omf load -i baseline-sdr.ndz -t srv1-lg1.sb1.cosmos-lab.org }}} After the image is successfully loaded turn on the node, give it some time to boot and then ssh into it. {{{ console:~$ omf tell -a on -t srv1-lg1.sb1.cosmos-lab.org console:~$ ssh native@srv1-lg1.sb1.cosmos-lab.org }}} * Once you're in ''srv1-lg1.sb1.cosmos-lab.org'' configure the network interface so it can talk to the N310's data interface. {{{ sudo ifconfig enp1s0 10.115.1.1 netmask 255.255.0.0 mtu 8000 }}} Run ''uhd_find_devices' and check if the N310 is detected {{{ native@localhost:~$ uhd_find_devices [INFO] [UHD] linux; GNU C++ version 7.3.0; Boost_106501; UHD_3.13.1.0-0-unknown -------------------------------------------------- -- UHD Device 0 -------------------------------------------------- Device Address: serial: 315A35A addr: 10.115.2.1 claimed: False mgmt_addr: 10.113.2.1 mgmt_addr: 10.115.2.1 product: n310 type: n3xx }}} We can also use ''uhd_usrp_probe'' to get more details. {{{ native@localhost:~$ uhd_usrp_probe --args="mgmt_addr=10.113.2.1,addr=10.115.2.1" [INFO] [UHD] linux; GNU C++ version 7.3.0; Boost_106501; UHD_3.13.1.0-0-unknown [INFO] [MPMD] Initializing 1 device(s) in parallel with args: mgmt_addr=10.113.2.1,type=n3xx,product=n310,serial=315A35A,claimed=False,addr=10.115.2.1 [INFO] [0/DmaFIFO_0] Initializing block control (NOC ID: 0xF1F0D00000000004) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1346 MB/s) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1356 MB/s) [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1347 MB/s) [INFO] [MPM.PeriphManager] init() called with device args `time_source=internal,clock_source=internal,product=n310,mgmt_addr=10.113.2.1'. [INFO] [0/DmaFIFO_0] BIST passed (Throughput: 1355 MB/s) [INFO] [0/Radio_0] Initializing block control (NOC ID: 0x12AD100000011312) [INFO] [0/Radio_1] Initializing block control (NOC ID: 0x12AD100000011312) [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: 0xD0C0000000000002) [INFO] [0/DUC_1] Initializing block control (NOC ID: 0xD0C0000000000002) _____________________________________________________ / | Device: N300-Series Device | _____________________________________________________ | / | | Mboard: ni-n3xx-315A35A | | eeprom_version: 1 | | mpm_version: 3.13.1.0-gbbce3e45 | | pid: 16962 | | product: n310 | | rev: 5 | | rpc_connection: remote | | serial: 315A35A | | type: n3xx | | MPM Version: 1.2 | | FPGA Version: 5.2 | | FPGA git hash: d0360f7.clean | | RFNoC capable: Yes | | | | Time sources: internal, external, gpsdo, sfp0 | | Clock sources: external, internal, gpsdo | | Sensors: gps_locked, gps_tpv, ref_locked, fan, gps_sky, gps_time, temp | | _____________________________________________________ | | / | | | RX Dboard: A | | | _____________________________________________________ | | | / | | | | RX Frontend: 0 | | | | Name: Magnesium | | | | Antennas: TX/RX, RX2, CAL, LOCAL | | | | Sensors: lo_locked, lowband_lo_locked, ad9371_lo_locked | | | | Freq range: 1.000 to 6000.000 MHz | | | | Gain range all: 0.0 to 75.0 step 0.5 dB | | | | Gain range rfic: 0.0 to 0.0 step 0.0 dB | | | | Gain range dsa: 0.0 to 0.0 step 0.0 dB | | | | Gain range amp: 0.0 to 0.0 step 0.0 dB | | | | Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | RX Frontend: 1 | | | | Name: Magnesium | | | | Antennas: TX/RX, RX2, CAL, LOCAL | | | | Sensors: lo_locked, lowband_lo_locked, ad9371_lo_locked | | | | Freq range: 1.000 to 6000.000 MHz | | | | Gain range all: 0.0 to 75.0 step 0.5 dB | | | | Gain range rfic: 0.0 to 0.0 step 0.0 dB | | | | Gain range dsa: 0.0 to 0.0 step 0.0 dB | | | | Gain range amp: 0.0 to 0.0 step 0.0 dB | | | | Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | RX Codec: A | | | | Name: AD9371 Dual ADC | | | | Gain Elements: None | | _____________________________________________________ | | / | | | RX Dboard: B | | | _____________________________________________________ | | | / | | | | RX Frontend: 0 | | | | Name: Magnesium | | | | Antennas: TX/RX, RX2, CAL, LOCAL | | | | Sensors: lo_locked, lowband_lo_locked, ad9371_lo_locked | | | | Freq range: 1.000 to 6000.000 MHz | | | | Gain range all: 0.0 to 75.0 step 0.5 dB | | | | Gain range rfic: 0.0 to 0.0 step 0.0 dB | | | | Gain range dsa: 0.0 to 0.0 step 0.0 dB | | | | Gain range amp: 0.0 to 0.0 step 0.0 dB | | | | Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | RX Frontend: 1 | | | | Name: Magnesium | | | | Antennas: TX/RX, RX2, CAL, LOCAL | | | | Sensors: lo_locked, lowband_lo_locked, ad9371_lo_locked | | | | Freq range: 1.000 to 6000.000 MHz | | | | Gain range all: 0.0 to 75.0 step 0.5 dB | | | | Gain range rfic: 0.0 to 0.0 step 0.0 dB | | | | Gain range dsa: 0.0 to 0.0 step 0.0 dB | | | | Gain range amp: 0.0 to 0.0 step 0.0 dB | | | | Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | RX Codec: B | | | | Name: AD9371 Dual ADC | | | | Gain Elements: None | | _____________________________________________________ | | / | | | TX Dboard: A | | | _____________________________________________________ | | | / | | | | TX Frontend: 0 | | | | Name: Magnesium | | | | Antennas: TX/RX | | | | Sensors: lo_locked, lowband_lo_locked, ad9371_lo_locked | | | | Freq range: 1.000 to 6000.000 MHz | | | | Gain range all: 0.0 to 65.0 step 0.5 dB | | | | Gain range rfic: 0.0 to 0.0 step 0.0 dB | | | | Gain range dsa: 0.0 to 0.0 step 0.0 dB | | | | Gain range amp: 0.0 to 0.0 step 0.0 dB | | | | Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | TX Frontend: 1 | | | | Name: Magnesium | | | | Antennas: TX/RX | | | | Sensors: lo_locked, lowband_lo_locked, ad9371_lo_locked | | | | Freq range: 1.000 to 6000.000 MHz | | | | Gain range all: 0.0 to 65.0 step 0.5 dB | | | | Gain range rfic: 0.0 to 0.0 step 0.0 dB | | | | Gain range dsa: 0.0 to 0.0 step 0.0 dB | | | | Gain range amp: 0.0 to 0.0 step 0.0 dB | | | | Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | TX Codec: A | | | | Name: AD9371 Dual DAC | | | | Gain Elements: None | | _____________________________________________________ | | / | | | TX Dboard: B | | | _____________________________________________________ | | | / | | | | TX Frontend: 0 | | | | Name: Magnesium | | | | Antennas: TX/RX | | | | Sensors: lo_locked, lowband_lo_locked, ad9371_lo_locked | | | | Freq range: 1.000 to 6000.000 MHz | | | | Gain range all: 0.0 to 65.0 step 0.5 dB | | | | Gain range rfic: 0.0 to 0.0 step 0.0 dB | | | | Gain range dsa: 0.0 to 0.0 step 0.0 dB | | | | Gain range amp: 0.0 to 0.0 step 0.0 dB | | | | Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | TX Frontend: 1 | | | | Name: Magnesium | | | | Antennas: TX/RX | | | | Sensors: lo_locked, lowband_lo_locked, ad9371_lo_locked | | | | Freq range: 1.000 to 6000.000 MHz | | | | Gain range all: 0.0 to 65.0 step 0.5 dB | | | | Gain range rfic: 0.0 to 0.0 step 0.0 dB | | | | Gain range dsa: 0.0 to 0.0 step 0.0 dB | | | | Gain range amp: 0.0 to 0.0 step 0.0 dB | | | | Bandwidth range: 20000000.0 to 100000000.0 step 0.0 Hz | | | | Connection Type: IQ | | | | Uses LO offset: No | | | _____________________________________________________ | | | / | | | | TX Codec: B | | | | Name: AD9371 Dual DAC | | | | Gain Elements: None | | _____________________________________________________ | | / | | | RFNoC blocks on this device: | | | | | | * DmaFIFO_0 | | | * Radio_0 | | | * Radio_1 | | | * DDC_0 | | | * DDC_1 | | | * DUC_0 | | | * DUC_1 }}} === Run application === From root/SPECTRUM_VIEW directory run the pre-compiled application that can read samples from the N310. {{{ native@localhost:~$ cd SPECTRUM_VIEW/ native@localhost:~/SPECTRUM_VIEW$ ./app_read_n310_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 the functionality, open the spectrum_view.html file in a Chrome browser, this will issues commands to configure the N310 and display a short spectrum width. When the viewer is first opened, you should see the text CONNECTED below the plot. || [[Image(basic_usage_spectrum_view_1.png, width=500px)]] || 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 ===