E310 FM Receiver: Difference between revisions
(Created page with "<div style="float:right"> {{Template:BeginnerTutorials}} </div> This tutorial describes how to receive broadcast commercial radio stations transmitting Frequency Modulated (FM) signals using the Ettus Research E310.") |
No edit summary |
||
Line 4: | Line 4: | ||
This tutorial describes how to receive broadcast commercial radio stations transmitting Frequency Modulated (FM) signals using the Ettus Research E310. | 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 == | |||
* '''Antenna''' | |||
Plug the antenna into the **RX2-A** port on the USRP. | |||
:The RX2-A port is dedicated to receive (RX) operations. | |||
* '''Power''' | |||
Turn on the USRP and ensure it has a stable power supply. | |||
== 2. Discover the USRP’s IP Address == | |||
On your host machine (connected to the same network): | |||
<syntaxhighlight lang="bash"> | |||
sudo snap install nmap # Install nmap if not already present | |||
nmap -sn 10.0.0.0/24 # Scan the local subnet | |||
</syntaxhighlight> | |||
: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: | |||
<syntaxhighlight lang="bash"> | |||
nano static_ip.sh | |||
</syntaxhighlight> | |||
Paste the following: | |||
<syntaxhighlight lang="bash"> | |||
#!/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 | |||
</syntaxhighlight> | |||
:Each step configures the Ethernet interface (eth0) for static addressing. | |||
=== b. Run the Script === | |||
<syntaxhighlight lang="bash"> | |||
bash static_ip.sh | |||
</syntaxhighlight> | |||
:The IP remains active until the next reboot. | |||
== 4. SSH Connection == | |||
On the host: | |||
<syntaxhighlight lang="bash"> | |||
ssh root@10.0.0.200 | |||
</syntaxhighlight> | |||
:You now have remote shell access to the USRP. | |||
== 5. Mount USRP Filesystem via SSHFS == | |||
To edit USRP files locally: | |||
<syntaxhighlight lang="bash"> | |||
sshfs root@10.0.0.200:/ ~/remote_usrp | |||
</syntaxhighlight> | |||
: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 “Execute” Command === | |||
Replace with: | |||
<syntaxhighlight lang="bash"> | |||
ssh -t root@10.0.0.200 "bash -i -c '/home/root/start_usrp_script.sh'" | |||
</syntaxhighlight> | |||
:This runs a remote startup script on the USRP when you press “Execute.” | |||
=== c. Create the '''start_usrp_script.sh''' Script === | |||
On the USRP: | |||
<syntaxhighlight lang="bash"> | |||
nano /home/root/start_usrp_script.sh | |||
</syntaxhighlight> | |||
Paste: | |||
<syntaxhighlight lang="bash"> | |||
#!/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 | |||
</syntaxhighlight> | |||
: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. | |||
<small>Last updated: 30 June 2025</small> |
Revision as of 10:31, 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
- Antenna
Plug the antenna into the **RX2-A** port on the USRP. :The RX2-A port is dedicated to receive (RX) operations.
- Power
Turn on the USRP and ensure it has a stable power supply.
2. Discover 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 “Execute” Command
Replace with:
ssh -t root@10.0.0.200 "bash -i -c '/home/root/start_usrp_script.sh'"
- 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.
Last updated: 30 June 2025