כדי להפעיל ולשלוט על SDR מסוג B205 דרך מחשב רגיל שמחובר לשרת שליטה מרחוק, תצטרך להתקין את התוכנות הבאות:
🖥️ מחשב שמחובר ל-SDR B205 (המחשב המקומי):
UHD (USRP Hardware Driver)
- דרייבר רשמי של Ettus/NI עבור SDR מסוג B205
- התקנה:
sudo apt install libuhd-dev uhd-host
GNU Radio
- סביבת עיבוד אותות גרפית ותכנותית
- התקנה:
sudo apt install gnuradio
Python + gr-osmosdr
- ספריות לשליטה בתוכנה על SDR
- התקנה:
sudo apt install python3-pip && pip3 install gr-osmosdr
ssh-server
- מאפשר חיבור מרחוק מהמחשב השני
- התקנה:
sudo apt install openssh-server
🖥️ מחשב שרת (שולט מרחוק):
GNU Radio + UHD
- כדי להריץ זרימות עיבוד מרחוק
- התקנה זהה למחשב המקומי
SSH Client / VSCode Remote / Jupyter
- לשליטה מרחוק על המחשב שמחובר ל-SDR
- אפשר להשתמש ב־VSCode עם הרחבת Remote SSH או ב־Jupyter Notebook עם חיבור מרוחק
ZMQ / TCP Streaming
- להעברת נתונים מה-SDR לשרת
- ניתן להגדיר זרימה ב-GNU Radio שמעבירה את המידע דרך ZMQ או TCP
🧠 תרחיש עבודה מומלץ:
- המחשב המקומי מריץ GNU Radio Flowgraph שמזרים נתונים דרך ZMQ
- המחשב המרוחק מתחבר ל־ZMQ ומעבד את הנתונים או שולט על התדרים דרך SSH
רוצה שאכין לך:
- Flowgraph לדוגמה ב-GNU Radio?
- סקריפט הפעלה מרחוק?
- תרשים מערכת בעברית?
תגיד לי מה הכי חשוב לך להמשיך.
import os
# Create GNU Radio flowgraph Python script for SDR B205 with ZMQ streaming
flowgraph_code = """
#!/usr/bin/env python3
from gnuradio import gr, blocks, uhd
import time
class sdr_b205_zmq_stream(gr.top_block):
def __init__(self):
gr.top_block.__init__(self, "SDR B205 ZMQ Stream")
# SDR Source
self.usrp_source = uhd.usrp_source(
",".join(("type=b200", "")),
uhd.stream_args(cpu_format="fc32", channels=[0]),
)
self.usrp_source.set_samp_rate(1e6)
self.usrp_source.set_center_freq(100e6)
self.usrp_source.set_gain(30)
# ZMQ PUB Sink
self.zmq_pub_sink = blocks.zmq_pub_sink(
type="complex",
addr="tcp://*:5555",
timeout=100,
)
# Connect blocks
self.connect(self.usrp_source, self.zmq_pub_sink)
if __name__ == '__main__':
tb = sdr_b205_zmq_stream()
tb.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
tb.stop()
tb.wait()
"""
# Save the flowgraph to a Python file
flowgraph_filename = "sdr_b205_zmq_stream.py"
with open(flowgraph_filename, "w") as f:
f.write(flowgraph_code)
# Create remote execution script
remote_script = """
#!/bin/bash
# Remote execution script for SDR B205 ZMQ stream
# Activate Python environment if needed
# source ~/gnuradio_env/bin/activate
# Run the flowgraph
python3 sdr_b205_zmq_stream.py
"""
remote_script_filename = "run_remote_sdr.sh"
with open(remote_script_filename, "w") as f:
f.write(remote_script)
# Create BOM file
bom_content = """Bill of Materials (BOM) for SDR B205 ZMQ Streaming Setup
1. SDR Device:
- Ettus USRP B205-mini-i
2. Host Computer:
- Linux-based PC with USB 3.0 port
3. Software:
- GNU Radio
- UHD Driver
- Python 3
- gr-osmosdr
- ZMQ (ZeroMQ)
4. Remote Server:
- Linux-based PC with SSH access
- Python 3
- ZMQ client libraries
5. Network:
- TCP/IP connection between host and server
6. Optional:
- VSCode with Remote SSH
- Jupyter Notebook for remote control
"""
bom_filename = "sdr_b205_bom.txt"
with open(bom_filename, "w") as f:
f.write(bom_content)
print("Flowgraph, remote script, and BOM file have been created successfully.")
🖥️ קבצים מוכנים:
Flowgraph ב-GNU Radio שמעביר נתונים דרך ZMQ: sdr_b205_zmq_stream.py
סקריפט הפעלה מרחוק: run_remote_sdr.sh
רשימת רכיבים מלאה (BOM): sdr_b205_bom.txt
🖼️ תרשים מערכת:
![תרשים מערכת SDR B205 עם שליטה מרחוק]
🧠 איך זה עובד:
- המחשב המקומי מריץ את הקובץ
sdr_b205_zmq_stream.py
שמזרים נתונים מה-SDR דרך ZMQ. - השרת המרוחק מתחבר לכתובת
tcp://<ip>:5555
ומקבל את הנתונים. - ניתן לשלוט על התדרים, קצב דגימה, ועוצמה דרך SSH או ממשק גרפי.
🛠️ דרישות תוכנה:
במחשב המקומי:
בשרת המרוחק:
#!/usr/bin/env python3
from gnuradio import gr, blocks, uhd
import time
class sdr_b205_zmq_stream(gr.top_block):
def __init__(self):
gr.top_block.__init__(self, "SDR B205 ZMQ Stream")
# SDR Source
self.usrp_source = uhd.usrp_source(
",".join(("type=b200", "")),
uhd.stream_args(cpu_format="fc32", channels=[0]),
)
self.usrp_source.set_samp_rate(1e6)
self.usrp_source.set_center_freq(100e6)
self.usrp_source.set_gain(30)
# ZMQ PUB Sink
self.zmq_pub_sink = blocks.zmq_pub_sink(
type="complex",
addr="tcp://*:5555",
timeout=100,
)
# Connect blocks
self.connect(self.usrp_source, self.zmq_pub_sink)
if __name__ == '__main__':
tb = sdr_b205_zmq_stream()
tb.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
tb.stop()
tb.wait()
אין תגובות:
הוסף רשומת תגובה