[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] TX Frequency Hopping w/ Stream Tags (USRP X310/UBX)

From: Salahi, Mert E
Subject: [Discuss-gnuradio] TX Frequency Hopping w/ Stream Tags (USRP X310/UBX)
Date: Thu, 18 Apr 2019 20:53:01 +0000

Hi all,


I’m trying to transmit timed, frequency-hopped bursts with a USRP X310/UBX. I wrote a custom python source block that reads in a IQ .bin files and then adds stream tags with appropriate time, packet length, and frequency data. Everything works has expected when I simply feed my tx_freq tune command tags the same frequency over and over – I can see the correct hop timing on my test equipment and am able to demodulate the signal from the USRP. However, when I try to randomly select two frequencies I see the following UHD error after only transmitting the first handful of hopped bursts:


thread[thread-per-block[1]: <block gr uhd usrp sink (2)>]: EnvironmentError: IOError: Block ctrl (CE_01_Port_40) no response packet - AssertionError: bool(buff)

  in uint64_t ctrl_iface_impl<_endianness>::wait_for_ack(bool, double) [with uhd::endianness_t _endianness = (uhd::endianness_t)0u; uint64_t = long unsigned int]

  at /home/lab/latestgnuradio/src/uhd/host/lib/rfnoc/ctrl_iface.cpp:142


Here’s a code snippet of how I’m adding the tags. I don’t think there is anything wrong here since everything works when I give the same tx_freq command. I’m able to play this custom source block into a tag stream debug sink and see the exact tags that I expect without any issues – seems like a USRP issue.


            # Logic for state2 state

            elif(self.sync_flag and self.state1_flag and not self.state2_flag):

                out[i] = self.state2_iq[self.state2_sample_count]



                    # Get time for current hop, add state1_wait_time if first state1 burst


                    if(self.state2_count == 0):

                        self.time_count += self.state2_wait_time


                        self.time_count += self.state2_hop_time

                    self.hop_count = (self.time_count - self.base_time)/self.radio_hop_time


                    time = pmt.cons(


                        pmt.from_double((self.time_count) % 1),


                    print("self.burst_count = " + str(self.burst_count))

                    print("state2 BURST")

                    # self.current_freq = 1800000000

                    self.current_freq = 1800000000 + 100000000*round(numpy.random.uniform(0,1,1))

                    print("Current frequency = " + str(self.current_freq))

                    print(" ")

                    # Frequency tune tag

                    tune_tag = gr.tag_t()

                    tune_tag.offset = self.sample_count

                    tune_tag.key = pmt.string_to_symbol('tx_command')

                    tune_tag.value = pmt.to_pmt({'freq': self.current_freq})

                    tune_tag.value = pmt.dict_add(tune_tag.value, pmt.intern('time'), time)

                    self.add_item_tag(0, tune_tag)


                    # Burst length tag

                    length_tag = gr.tag_t()

                    length_tag.offset = self.sample_count

                    length_tag.key = pmt.string_to_symbol('packet_len')

                    length_tag.value = pmt.from_long(self.samples_per_burst)

                    self.add_item_tag(0, length_tag)


                    # Time tag

                    time_tag = gr.tag_t()

                    time_tag.offset = self.sample_count

                    time_tag.key = pmt.string_to_symbol('tx_time')

                    time_tag.value = pmt.make_tuple(




                    self.add_item_tag(0, time_tag)

                    self.state2_count += 1

                    self.burst_count += 1



Thanks for any help!


Attachment: frequency_hop_source.py
Description: frequency_hop_source.py

reply via email to

[Prev in Thread] Current Thread [Next in Thread]