discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] USRP Source Timed Command w/ OOT Block Issue


From: Salahi, Mert E
Subject: [Discuss-gnuradio] USRP Source Timed Command w/ OOT Block Issue
Date: Wed, 15 May 2019 20:28:17 +0000

Hi all,

 

I am having trouble sending timed commands to frequency hop a UHD USRP Source block. I’m using a custom message source in python that sends tune commands at specific times.  However, the timestamps that I’m adding to my frequency tunes don’t seem to take. I can really only get the USRP to pause between retunes if I artificially throttle the output messages using a time.sleep() command within the block. I can see the frequency commands working on the receiver, but the timing is not derived from the control messages. The Message Debug block in the attached image is showing that the messages are in fact being generated as expected. Any ideas on what might be going wrong here?

 

Here’s the simple python block I am using to generate the messages:

 

import numpy

import pmt

import time

import threading

from gnuradio import gr

 

class oot(gr.basic_block):

    """

    docstring for block rx_ctl

    """

    def __init__(self, config_file):

        gr.basic_block.__init__(self,

            name="_rx_ctl",

            in_sig=None,

            out_sig=None)

        self.time_count = 5 # initial timestamp to allow for setup time

        self.current_freq = 1800000000

        self.message_port_register_out(pmt.intern("rx_cmd"))

        threading.Thread(target=self.send_rx_cmd).start()

 

    def send_rx_cmd(self):

        time.sleep(1)

        count = 0

        #Output a finite number of messages then stop

        while(count < 10000):

            self.time = pmt.cons(

                pmt.from_uint64(int(self.time_count)),

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

            )

            rx_cmd = pmt.make_dict()

            rx_cmd = pmt.dict_add(rx_cmd, pmt.intern('time'), self.time)

            rx_cmd = pmt.dict_add(rx_cmd, pmt.intern("freq"), pmt.from_double(self.current_freq))

            self.message_port_pub(pmt.intern('rx_cmd'),

                rx_cmd)

            count += 1

            self.time_count += 0.5

            self.current_freq = 1800000000 - 500000 + 1000000*(count%2)

            # time.sleep(0.5)

 

Ultimately, I’d like to have a transmitting N210+WBX and a receiving N210+WBX frequency hopping in synch with each other (using an external pps signal for time alignment). The transmit side works great via streams tags, but I don’t think stream tags are an option for controlling the receiving USRP.

 

Thanks for any help!

Attachment: Screenshot_2019-05-15_11-45-39.png
Description: Screenshot_2019-05-15_11-45-39.png


reply via email to

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