Transmit and receive a single tone over the air between two USRP2/N210 radios
using the bare UHD example tools, then capture the received signal and plot it in Octave.
This tutorial uses two USRPs on a sandbox to transmit and receive a single
frequency over the air, demonstrating the USRP Hardware Driver (UHD) used
standalone to configure and drive the radios. One node transmits a waveform with
tx_waveforms; the other observes the spectrum with rx_ascii_art_dft and
records samples with rx_samples_to_file. It can be run on any pair of USRP2/N210
radios on the testbed — see available USRP hardware.
After completing this tutorial you will be able to:
uhd_find_devices / uhd_usrp_probe.tx_waveforms.rx_ascii_art_dft.| Difficulty | Beginner |
| Estimated time | 60 min |
| Domain / sandbox | A sandbox with two USRP2/N210 nodes (example: sb7.cosmos-lab.org) |
| Topic group | SDR & GNU Radio |
| Last verified | Not re-tested (migrated 2026-06-20) |
Background knowledge
Account & access
Devices / nodes
| Resource | Role | Qty | Notes |
|---|---|---|---|
| node1-1 | Transmitter | 1 | USRP2/N210 attached via Ethernet (SBX daughterboard, 400–4400 MHz) |
| node1-2 | Receiver | 1 | USRP2/N210 attached via Ethernet |
Disk images
| Image | Load onto | Provides |
|---|---|---|
| baseline-sdr.ndz | node1-1, node1-2 | precompiled UHD tools + Octave; node↔USRP interface preconfigured |
Software components
| Component | Version | Source |
|---|---|---|
| UHD (USRP Hardware Driver) | as shipped in image | preinstalled in baseline-sdr.ndz |
| Octave | 3.8+ | preinstalled in baseline-sdr.ndz |
Spectrum / RF — over-the-air transmit; examples use 1800 MHz. Keep gains modest
(--gain 5–10) and stay within your reservation's allowed spectrum.
Two sandbox nodes, each with a USRP2/N210 on a dedicated point-to-point Ethernet
link (node 192.168.10.1 ↔ USRP 192.168.10.2). node1-1 transmits over the air;
node1-2 receives. Both are controlled from the sandbox console.
ssh <username>@console.sb7.cosmos-lab.org
omf load -i baseline-sdr.ndz -t system:topo:all
omf tell -a on -t all
omf stat -t all
Open a separate SSH session to each node from the console. node1-1 is the
transmitter, node1-2 the receiver.
ssh root@node1-1
Set the USRP-facing interface to 192.168.10.1/24. On the SDR image:
root@node1-1:~# cd /etc/netplan/
root@node1-1:/etc/netplan# systemctl disable cosmos-ifrename.service
root@node1-1:/etc/netplan# cp 10-cosmos-roles.yaml 10-cosmos-roles.yaml.bak
root@node1-1:/etc/netplan# nano 10-cosmos-roles.yaml
Add (indentation matters — spaces, not tabs):
enp4s0:
dhcp4: false
addresses: [192.168.10.1/24]
Apply it:
root@node1-1:~# netplan apply
Repeat the same on node1-2.
Note: the interface name (
enp4s0, historicallyeth2) depends on the node
hardware/image. Confirm withip link. The Troubleshooting section shows how to
verify connectivity to the radio.
Go to the UHD examples directory (one of these, depending on the image):
root@node1-1:~# cd /usr/local/lib/uhd/examples/ # or ~/uhd/host/build/examples/ or /usr/lib/uhd/examples
Discover the radio:
root@node1-1:~# uhd_find_devices
--------------------------------------------------
-- UHD Device 0
--------------------------------------------------
Device Address:
type: usrp2
addr: 192.168.10.2
serial: F297B6
Probe its capabilities (abridged):
root@node1-1:~# uhd_usrp_probe
| Mboard: N210r4
| RX Dboard: A ID: SBX (0x0054) Freq range: 400.000 to 4400.000 MHz
| TX Dboard: A ID: SBX (0x0055) Freq range: 400.000 to 4400.000 MHz
If either command returns No UHD Devices Found, see Troubleshooting.
On node1-1, transmit a 1 MHz sine, sampled at 5 Msps, on an 1800 MHz carrier:
root@node1-1:~# ./tx_waveforms --wave-freq 1e6 --wave-type SINE --freq 1800e6 --rate 5e6 --gain 10 --ampl 0.2
Setting TX Freq: 1800.000000 MHz... Actual TX Freq: 1800.000000 MHz...
Setting TX Gain: 10.000000 dB... Actual TX Gain: 10.000000 dB...
Checking TX: LO: locked ...
Press Ctrl + C to stop streaming...
On node1-2, watch the spectrum at 1800 MHz:
root@node1-2:~# ./rx_ascii_art_dft --freq 1800e6 --gain 10 --rate 5e6 --frame-rate 10 --ref-lvl -30 --dyn-rng 70
You should see a peak around 1800 MHz (carrier plus the 1 MHz tone). Press
Ctrl-C on node1-1 to stop transmitting and the peak collapses to the noise floor.
Try other waveforms, e.g. a 500 kHz sawtooth (note the multiple harmonics):
root@node1-1:~# ./tx_waveforms --wave-freq 500e3 --wave-type RAMP --freq 1800e6 --rate 5e6 --gain 5 --ampl 0.1
List all options with ./tx_waveforms --help.
On node1-1, transmit a clean tone:
root@node1-1:~# ./tx_waveforms --wave-freq 1e6 --wave-type SINE --freq 1800e6 --rate 5e6 --ampl 0.5
On node1-2, capture samples to a file (usrp_samples.dat):
root@node1-2:~# ./rx_samples_to_file --freq 1800e6 --rate 5e6 --type float
Plot the captured IQ in Octave (the read_float_binary helper is attached to this page):
root@node1-2:~# octave
octave:1> c = read_float_binary('usrp_samples.dat');
octave:2> creal = c(1:2:length(c));
octave:3> cimag = c(2:2:length(c));
octave:4> subplot(211); plot(creal(100:230)); title('real'); axis([0 140 -0.010 0.010]);
octave:5> subplot(212); plot(cimag(100:230)); title('imag'); axis([0 140 -0.010 0.010]);
![]() |
|---|
| Plot of the received sine wave |
uhd_find_devices / uhd_usrp_probe return the radio (serial, daughterboard).rx_ascii_art_dft shows a clear peak atomf tell -a offh -t all
(No omf save needed unless you customized the image.)
| Symptom | Likely cause | Fix |
|---|---|---|
uhd_find_devices → No UHD Devices Found |
node↔USRP interface not configured | verify with ip addr/ifconfig, set 192.168.10.1/24, then ping 192.168.10.2 (USRP). Once the ping succeeds, retry. |
Interface name not enp4s0 |
hardware/image variation | find it with ip link; apply the static address to that interface |
| Spectrum shows only noise | transmitter not running / wrong freq or gain | confirm tx_waveforms is streaming on node1-1, matching --freq/--rate on both ends |
Example manual interface setup and connectivity check:
root@node1-1:~# ifconfig eth2 192.168.10.1 netmask 255.255.255.0 up
root@node1-1:~# ping 192.168.10.2
64 bytes from 192.168.10.2: icmp_req=1 ttl=32 time=1.04 ms
Author(s): COSMOS team · Last verified: Not re-tested (migrated 2026-06-20) · Tested image/release: baseline-sdr.ndz · Tags: sdr, uhd, usrp, octave