Sorry to ask, but I could do with a little bit of help to get me moving.
I use gnu radio to drive an SDR for DATV, I slightly reworked an existing flowgraph without any GUI, and use the generated .py file from a script in Linux.
I am wondering if I can pass variables from command line to the python file at run time.
For example here are the first few lines from the Python script.
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Sr250
# Generated: Sat Aug 3 00:17:48 2019
##################################################
from gnuradio import blocks
from gnuradio import dtv
from gnuradio import eng_notation
from gnuradio import filter
from gnuradio import gr
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from optparse import OptionParser
import osmosdr
import time
class SR250(gr.top_block):
def __init__(self):
gr.top_block.__init__(self, "Sr250")
##################################################
# Variables
##################################################
self.symbol_rate = symbol_rate = 250e3
self.taps = taps = 80
self.samp_rate = samp_rate = symbol_rate * 2
self.rolloff = rolloff = 0.35
self.resample = resample = int(round(5e6/symbol_rate))
self.center_freq = center_freq = 2408.9e6
##################################################
# Blocks
##################################################
self.rational_resampler_xxx_0 = filter.rational_resampler_ccc(
interpolation=resample,
So it would be good to add the frequency as an external variable and possibly the symbol rate. I think the answer lies with Import sys, but to date my tries have failed me.
So if there is a Python Guru out there that could put me in the correct direction it would be appreciated.
Adrian