E310 FM Receiver: Difference between revisions
No edit summary |
No edit summary |
||
Line 106: | Line 106: | ||
=== b. Update the Build Commands === | === b. Update the Build Commands === | ||
In Independent | In "Set Independent Commands", to the right of "Run Remote", add: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> |
Revision as of 10:44, 30 June 2025
Beginner Tutorials
Introducing GNU Radio Flowgraph Fundamentals
Creating and Modifying Python Blocks DSP Blocks
SDR Hardware |
This tutorial describes how to receive broadcast commercial radio stations transmitting Frequency Modulated (FM) signals using the Ettus Research E310.
USRP (E310) Setup Guide
This page provides step-by-step instructions to configure a USRP E310 for:
- Receiving signals with a Python script
- Remote control via SSH
- Using GNU Radio on a host machine
1. Hardware Connection
- Plug the antenna into the RX2-A port on the USRP. The RX2-A port is dedicated to receive (RX) operations.
- Turn on the USRP and ensure it has a stable power supply.
2. Determine the USRP’s IP Address
On your host machine (connected to the same network):
sudo snap install nmap # Install nmap if not already present
nmap -sn 10.0.0.0/24 # Scan the local subnet
- This finds the DHCP‑assigned IP of the USRP (e.g., 10.0.0.100).
3. Assign a Static IP Address
To simplify SSH access, give the USRP a fixed IP.
a. Create the static_ip.sh Script
SSH into the USRP (using the DHCP IP) and run:
nano static_ip.sh
Paste the following:
#!/bin/sh
# 1. Flush existing IP addresses
ip addr flush dev eth0
# 2. Assign static IP and netmask
ip addr add 10.0.0.200/24 dev eth0
# 3. Bring the interface up
ip link set eth0 up
# 4. Add default gateway
ip route add default via 10.0.0.1
- Each step configures the Ethernet interface (eth0) for static addressing.
b. Run the Script
bash static_ip.sh
- The IP remains active until the next reboot.
4. SSH Connection
On the host:
ssh root@10.0.0.200
- You now have remote shell access to the USRP.
5. Mount USRP Filesystem via SSHFS
To edit USRP files locally:
sshfs root@10.0.0.200:/ ~/remote_usrp
- Mounts the USRP’s root directory at `~/remote_usrp` on the host.
6. Configure Geany IDE
To simplify the workflow, we will use Geany, a lightweight IDE, on the host machine to:
- Edit files located on the USRP (via SSHFS)
- Launch scripts remotely on the USRP (via SSH)
- Centralize all development and execution within one interface
- This allows you to work entirely from the host, avoiding the need to manually SSH into the USRP or use a separate editor.
a. Open Build Commands
In Geany, go to Build → Set Build Commands.
b. Update the Build Commands
In "Set Independent Commands", to the right of "Run Remote", add:
scp "%f" root@10.67.44.142:/tmp/ && ssh root@10.67.44.142 'python3 /tmp/"%f"'
- This runs a remote startup script on the USRP when you press “Execute.”
c. Create the start_usrp_script.sh Script
On the USRP:
nano /home/root/start_usrp_script.sh
Paste:
#!/bin/sh
# Cleanup function on interrupt
cleanup() {
echo "[INFO] Stop requested"
pkill -f usrp_fm_receiver.py
exit 0
}
# Trap INT and TERM signals
trap cleanup INT TERM
# Launch the main Python script
python3 /home/root/usrp_fm_receiver.py
- Ensures the Python process is cleanly terminated on exit.
7. Running the Flow
- In Geany, open `~/remote_usrp/home/root/usrp_fm_receiver.py`.
- Press “Execute” to start the script on the USRP.
- On your host, launch GNU Radio Companion and run `fm_receiver_host_udp.py` to receive the UDP stream.
- The USRP script streams FM over UDP; GNU Radio handles it on the host side.
Additional Notes
- To make the IP configuration persistent, consider adding `static_ip.sh` to `/etc/rc.local` or creating a `systemd` service.
- Verify compatibility of Python and GNU Radio versions between the USRP and host.
- IP addresses have been anonymized, but this obviously needs to be adapted to the use case.
Last updated: 30 June 2025