Dear Keven,
Please consider the following flow graph. I have done some changes to the
OFDM TX block and in the earlier file forgot to remove that. This file has
all the original GNURadio blocks and running in no GUI mode. But still the
problem is there. I appreciate if you could help me to figure out the
problem.
Thanks,
Damindra
On Sat, Dec 24, 2016 at 1:39 PM, Damindra Bandara <
[email protected]> wrote:
> Dear Kevin,
>
> Thank you for your response. Here are the answers to the questions you
> asked.
>
> Does it happen if you only stop and start the flow graph without actually
> changing any connections? Yes. It still gives the same error when only stop
> and start the flow graph. When I do the reconfiguration without stop and
> start I do not get any error. However, I do not see any reconfigured
> parameters applied(i.e., it still runs with the previous configuration)
>
> Does it happen if you lock(), change, unlock() — instead of stop(),
> change, start()? Yes, still get the same error
>
> Does it happen if you do some reconfiguration but less than your
> application actually needs — e.g. replace a block with a newly-constructed
> identical block (should have no effect)? Yes, even for simpler applications
> that use tag streams. (I have used the [stop--> change block --> start]
> and [lock --> change parameter --> unlock] without any error before I
> introduce OFDM blocks and tagged streams. I started to get the error after
> introducing OFDM block and tagged streams.
>
> Herewith I have attached a flow graph where I simply try to lock the flow
> graph print a statement and unlock it. I still get the same error. To run
> please change the file name in the file source block and run the python
> file.
>
> If you can help me to figure the problem I really appreciate it.
>
> Best regards,
> Damindra
>
> On Sat, Dec 24, 2016 at 10:35 AM, Kevin Reid <[email protected]> wrote:
>
>> On Sat, Dec 24, 2016 at 9:46 AM, Damindra Bandara <
>> [email protected]> wrote:
>>>
>>> Also, I get the error only when I try to reconfigure a flow graph. Could
>>> you please let me know the correct way to reconfigure a flow graph when
>>> they are using tags.
>>>
>>
>> Both reconfiguration and tags are lesser-used features (reconfiguration
>> even less), and based on my experience with reconfiguration, there might
>> well be a bug in a particular block's interaction with reconfiguration. I
>> would suggest taking a troubleshooting/debugging approach to finding out
>> what is sufficient to cause the problem:
>>
>> - Does it happen if you only stop and start the flow graph without
>> actually changing any connections?
>>
>> - Does it happen if you lock(), change, unlock() — instead of stop(),
>> change, start()?
>>
>> - Does it happen if you do some reconfiguration but less than your
>> application actually needs — e.g. replace a block with a newly-constructed
>> identical block (should have no effect)?
>>
>> It would be great if (if there actually is a bug here) you can narrow it
>> down to a simple example and file a bug report.
>>
>> I might be able to help with the narrowing down if you have some
>> reasonably-sized Python/GRC code you could share, as I've gone through this
>> process several times. (I develop a reconfiguration-heavy application.)
>>
>
>
>
> --
> Damindra Savithri Bandara,
> Ph.D. in Information Technology (Candidate)
> George Mason University,
> Fairfax,
> Virginia
>
--
Damindra Savithri Bandara,
Ph.D. in Information Technology (Candidate)
George Mason University,
Fairfax,
Virginia
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Test2
# Generated: Sat Dec 24 13:45:16 2016
##################################################
from gnuradio import blocks
from gnuradio import digital
from gnuradio import eng_notation
from gnuradio import gr
from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from optparse import OptionParser
import time
class test2(gr.top_block):
def __init__(self):
gr.top_block.__init__(self, "Test2")
##################################################
# Variables
##################################################
self.tx_gain1 = tx_gain1 = 20
self.tx_freq1 = tx_freq1 = 900000000
self.sync_word2 = sync_word2 = [0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 0, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 0, 0, 0, 0, 0]
self.sync_word1 = sync_word1 = [0., 0., 0., 0., 0., 0., 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0., -1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0., -1.41421356, 0., -1.41421356, 0., -1.41421356, 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0., -1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 1.41421356, 0., 0., 0., 0., 0., 0.]
self.samp_rate = samp_rate = 32000
self.pilot_symbols = pilot_symbols = ((1, 1, 1, -1,),)
self.pilot_carriers = pilot_carriers = ((-21, -7, 7, 21,),)
self.packet_len = packet_len = 160
self.occupied_carriers = occupied_carriers = (range(-26, -21) + range(-20, -7) + range(-6, 0) + range(1, 7) + range(8, 21) + range(22, 27),)
self.len_tag_key = len_tag_key = "packet_len"
self.fft_len = fft_len = 64
##################################################
# Blocks
##################################################
self.usrp_sink = uhd.usrp_sink(
",".join(("", "")),
uhd.stream_args(
cpu_format="fc32",
channels=range(1),
),
)
self.usrp_sink.set_samp_rate(samp_rate)
self.usrp_sink.set_center_freq(tx_freq1, 0)
self.usrp_sink.set_gain(tx_gain1, 0)
self.tagged_stream1 = blocks.stream_to_tagged_stream(gr.sizeof_char, 1, packet_len, len_tag_key)
self.ofdm_tx1 = digital.ofdm_tx(
fft_len=fft_len, cp_len=fft_len/4,
packet_length_tag_key=len_tag_key,
occupied_carriers=occupied_carriers,
pilot_carriers=pilot_carriers,
pilot_symbols=pilot_symbols,
sync_word1=sync_word1,
sync_word2=sync_word2,
bps_header=1,
bps_payload=1,
rolloff=0,
debug_log=False,
scramble_bits=True
)
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vcc((0.05, ))
self.blocks_file_source_0 = blocks.file_source(gr.sizeof_char*1, '/home/radio/Desktop/top_block.py', True)
##################################################
# Connections
##################################################
self.connect((self.blocks_file_source_0, 0), (self.tagged_stream1, 0))
self.connect((self.blocks_multiply_const_vxx_0, 0), (self.usrp_sink, 0))
self.connect((self.ofdm_tx1, 0), (self.blocks_multiply_const_vxx_0, 0))
self.connect((self.tagged_stream1, 0), (self.ofdm_tx1, 0))
def get_tx_gain1(self):
return self.tx_gain1
def set_tx_gain1(self, tx_gain1):
self.tx_gain1 = tx_gain1
self.usrp_sink.set_gain(self.tx_gain1, 0)
self.usrp_sink.set_gain(self.tx_gain1, 1)
def get_tx_freq1(self):
return self.tx_freq1
def set_tx_freq1(self, tx_freq1):
self.tx_freq1 = tx_freq1
self.usrp_sink.set_center_freq(self.tx_freq1, 0)
self.usrp_sink.set_center_freq(self.tx_freq1, 1)
def get_sync_word2(self):
return self.sync_word2
def set_sync_word2(self, sync_word2):
self.sync_word2 = sync_word2
def get_sync_word1(self):
return self.sync_word1
def set_sync_word1(self, sync_word1):
self.sync_word1 = sync_word1
def get_samp_rate(self):
return self.samp_rate
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.usrp_sink.set_samp_rate(self.samp_rate)
def get_pilot_symbols(self):
return self.pilot_symbols
def set_pilot_symbols(self, pilot_symbols):
self.pilot_symbols = pilot_symbols
def get_pilot_carriers(self):
return self.pilot_carriers
def set_pilot_carriers(self, pilot_carriers):
self.pilot_carriers = pilot_carriers
def get_packet_len(self):
return self.packet_len
def set_packet_len(self, packet_len):
self.packet_len = packet_len
self.tagged_stream1.set_packet_len(self.packet_len)
self.tagged_stream1.set_packet_len_pmt(self.packet_len)
def get_occupied_carriers(self):
return self.occupied_carriers
def set_occupied_carriers(self, occupied_carriers):
self.occupied_carriers = occupied_carriers
def get_len_tag_key(self):
return self.len_tag_key
def set_len_tag_key(self, len_tag_key):
self.len_tag_key = len_tag_key
def get_fft_len(self):
return self.fft_len
def set_fft_len(self, fft_len):
self.fft_len = fft_len
def main(top_block_cls=test2, options=None):
tb = top_block_cls()
tb.start()
for x in range(0, 100):
print "We're on time %d" % (x)
tb.stop()
tb.wait()
print "TB stopped"
tb.start()
print "TB started"
try:
raw_input('Press Enter to quit: ')
except EOFError:
pass
tb.stop()
tb.wait()
if __name__ == '__main__':
main()
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio