discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] [USRP-users] Fwd: RE: synchronize two USRP N 210


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] [USRP-users] Fwd: RE: synchronize two USRP N 210
Date: Sun, 30 Nov 2014 21:02:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Hi Bashar,
It was a bit hard to read, and I'm trying not to debug too much of your
code, but you should definitely set the start time for all your USRPs,
not just for one.

Best regards,
Marcus
On 11/29/2014 12:10 AM, Bashar Hussain wrote:
>
>
> Dear Marcus
> Thanks for you. Actually I started to get better results now, I have one more 
> question . In my scenario I am using two USRPs: 
> - USRP 1 : TX/RX as transmitter , RX2 as RX0- USRP 2 : RX2 as RX1
> now for the timing of both RX I followed your suggestion and I got a better 
> results but still not stable, it seems that I do not make the timing for the 
> TX/RX correctly. Please kindly check the piece of code about the TX/RX which 
> is the same USRP as for RX0 :
>
>
> self.uhd_usrp_sink_0 = uhd.usrp_sink(  device_addr="addr=192.168.1.221",  
> stream_args=uhd.stream_args(  cpu_format="fc32",  channels=range(1),  ),  )   
>    self.uhd_usrp_sink_0.set_samp_rate(128e6/interp_rate)  
> self.uhd_usrp_sink_0.set_clock_source("external", 0)  
> self.uhd_usrp_sink_0.set_time_source("external", 0)  
> self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec())  
> self.uhd_usrp_sink_0.set_center_freq(freq, 0)  
> self.uhd_usrp_sink_0.set_gain(30, 0)  
> self.uhd_usrp_sink_0.set_antenna("TX/RX", 0)  time.sleep(1);     cmd_time2 = 
> self.uhd_usrp_sink_0.get_time_last_pps()      real_seconds2 = 
> uhd.time_spec_t.get_real_secs(cmd_time2)    future_real_seconds2 = 
> real_seconds2 + 1    future_cmd_time2 = uhd.time_spec_t(future_real_seconds2) 
>      self.uhd_usrp_sink_0.set_start_time(future_cmd_time2)
> Regards 
> Bashar
>
>> Date: Fri, 28 Nov 2014 13:14:34 +0100
>> From: address@hidden
>> To: address@hidden; address@hidden
>> Subject: Re: [USRP-users] Fwd: RE:  synchronize two USRP N 210
>>
>> Hi Bashar,
>> thanks for following up on this :)
>>
>> So, the idea was to replace "set_command_time()" by "set_start_time()",
>> and to generally omit the clearing of command times (as you then don't
>> even set any):
>>
>> -initialize all three USRP_sink/source objects
>> -set the time
>> -set_start_time on all three of them
>> -start your flowgraph.
>>
>> Best regards,
>> Marcus
>>
>> On 11/28/2014 12:44 PM, Bashar Hussain wrote:
>>> Dear Marcus 
>>>
>>>
>>>
>>>
>>>
>>> Thanks for your reply. 
>>>
>>>
>>>
>>>
>>>
>>> So here is the code now  looks like:
>>>
>>>
>>>
>>>
>>>
>>> self.uhd_usrp_source_1 = uhd.usrp_source(
>>>
>>>
>>>             device_addr="addr=192.168.1.211",
>>>
>>>
>>>             stream_args=uhd.stream_args(
>>>
>>>
>>>                 cpu_format="fc32",
>>>
>>>
>>>                 channels=range(1),
>>>
>>>
>>>             ),
>>>
>>>
>>>         )
>>>
>>>
>>>         self.uhd_usrp_source_1.set_clock_source("external", 0)
>>>
>>>
>>>         self.uhd_usrp_source_1.set_time_source("external", 0)
>>>
>>>
>>>         self.uhd_usrp_source_1.set_time_unknown_pps(uhd.time_spec())
>>>
>>>
>>>         self.uhd_usrp_source_1.set_samp_rate(100e6/dec_rate)
>>>
>>>
>>>         self.uhd_usrp_source_1.set_center_freq(freq, 0)
>>>
>>>
>>>         self.uhd_usrp_source_1.set_gain(rx_gain, 0)
>>>
>>>
>>>         self.uhd_usrp_source_1.set_antenna("RX2", 0)
>>>
>>>
>>>         
>>>
>>>
>>>         
>>>
>>>
>>>         self.uhd_usrp_source_0 = uhd.usrp_source(
>>>
>>>
>>>             device_addr="addr=192.168.1.221",
>>>
>>>
>>>             stream_args=uhd.stream_args(
>>>
>>>
>>>                 cpu_format="fc32",
>>>
>>>
>>>                 channels=range(1),
>>>
>>>
>>>             ),
>>>
>>>
>>>         )
>>>
>>>
>>>         self.uhd_usrp_source_0.set_clock_source("external", 0)
>>>
>>>
>>>         self.uhd_usrp_source_0.set_time_source("external", 0)
>>>
>>>
>>>         self.uhd_usrp_source_0.set_time_unknown_pps(uhd.time_spec())
>>>
>>>
>>>         self.uhd_usrp_source_0.set_samp_rate(100e6/dec_rate)
>>>
>>>
>>>         self.uhd_usrp_source_0.set_center_freq(freq, 0)
>>>
>>>
>>>         self.uhd_usrp_source_0.set_gain(rx_gain, 0)
>>>
>>>
>>>         self.uhd_usrp_source_0.set_antenna("RX2", 0)
>>>
>>>
>>>         
>>>
>>>
>>>         time.sleep(1);
>>>
>>>
>>>
>>>
>>>
>>>     
>>>
>>>
>>>         cmd_time = self.uhd_usrp_source_1.get_time_last_pps()
>>>
>>>
>>>         cmd_time0 = self.uhd_usrp_source_0.get_time_last_pps()
>>>
>>>
>>>
>>>
>>>
>>>     
>>>
>>>
>>>         real_seconds = uhd.time_spec_t.get_real_secs(cmd_time)
>>>
>>>
>>>         real_seconds0 = uhd.time_spec_t.get_real_secs(cmd_time0)
>>>
>>>
>>>
>>>
>>>
>>>     
>>>
>>>
>>>         future_real_seconds = real_seconds + 1
>>>
>>>
>>>         future_real_seconds0 = real_seconds0 + 1 
>>>
>>>
>>>
>>>
>>>
>>>     
>>>
>>>
>>>         future_cmd_time = uhd.time_spec_t(future_real_seconds)
>>>
>>>
>>>         future_cmd_time0 = uhd.time_spec_t(future_real_seconds0)
>>>
>>>
>>>
>>>
>>>
>>>      
>>>
>>>
>>>         self.uhd_usrp_source_1.set_command_time(future_cmd_time)
>>>
>>>
>>>         self.uhd_usrp_source_0.set_command_time(future_cmd_time0)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>         self.uhd_usrp_source_1.set_start_time(future_cmd_time)
>>>
>>>
>>>         self.uhd_usrp_source_0.set_start_time(future_cmd_time0)
>>>
>>>
>>>
>>>
>>>
>>>         self.uhd_usrp_source_1.clear_command_time()
>>>
>>>
>>>         self.uhd_usrp_source_0.clear_command_time()
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Or I have to delete the clear_command_time lines ?
>>>
>>>
>>>  
>>>
>>>
>>> Regards ..
>>>
>>>
>>>
>>>
>>>
>>> Bashar Mufid 
>>>
>>>
>>> Eng.Bashar Mufid 
>>> Research & Teaching Assistant
>>> Al-Quds University
>>> Faculty Of Engineering / Department of Electronics Engineering 
>>> Al-Quds - West Bank - Palestine 
>>> Tel:00972-56-8585085 
>>>
>>>
>>>> Date: Fri, 28 Nov 2014 12:42:27 +0100
>>>> From: address@hidden
>>>> To: address@hidden; address@hidden
>>>> Subject: Re: [USRP-users] Fwd: RE:  synchronize two USRP N 210
>>>>
>>>> Hi Bashar,
>>>>
>>>> I'll reply once you send your emails to the mailing list instead of me
>>>> individually.
>>>>
>>>> Best regards,
>>>> Marcus Müller
>>>>
>>>> On 11/28/2014 12:34 PM, Bashar Hussain wrote:
>>>>> Dear Marcus 
>>>>>
>>>>> Thanks for your reply. 
>>>>>
>>>>> So here is the code now  looks like:
>>>>>
>>>                                       
>                                         




reply via email to

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