On May 31, 2021, at 9:46 AM, Skyvalakis Konstantinos
<[email protected]> wrote:
I did what you said and changed my code to accordingly:
self.sink = uhd.usrp_sink(
",".join(("", "addr=192.168.10.2")),
uhd.stream_args(
cpu_format="fc32",
channels=range(1),
),
)
self.source = uhd.usrp_source(
",".join(("addr0=192.168.10.2,addr1=192.168.10.3", "")),
uhd.stream_args(
cpu_format="fc32",
channels=range(2),
),
)
self.source.set_clock_source('external', 0);
self.source.set_time_source('external', 0);
self.source.set_clock_source('external', 1);
self.source.set_time_source('external', 1);
self.source.set_time_unknown_pps(uhd.time_spec())
self.source.set_samp_rate(self.adc_rate)
self.source.set_gain(self.rx_gain0,0)
self.source.set_gain(self.rx_gain1,1)
self.source.set_antenna("RX2",0)
self.source.set_antenna("RX2",1)
self.sink.set_clock_source('external');
self.sink.set_time_source('external');
self.sink.set_time_unknown_pps(uhd.time_spec())
self.sink.set_samp_rate(self.dac_rate)
self.sink.set_gain(self.tx_gain)
self.sink.set_antenna("TX/RX")
time.sleep(1)
cmd_time0 = self.source.get_time_last_pps()
cmd_time1 = self.sink.get_time_last_pps()
real_seconds0 = uhd.time_spec_t.get_real_secs(cmd_time0)
real_seconds1 = uhd.time_spec_t.get_real_secs(cmd_time1)
future_real_seconds0 = real_seconds0 + 1
future_real_seconds1 = real_seconds1 + 1
future_cmd_time0 = uhd.time_spec_t(future_real_seconds0)
future_cmd_time1 = uhd.time_spec_t(future_real_seconds1)
self.source.set_command_time(future_cmd_time0)
self.sink.set_command_time(future_cmd_time1)
self.source.set_center_freq(uhd.tune_request(self.freq,0), 0)
self.source.set_center_freq(uhd.tune_request(self.freq,0), 1)
self.sink.set_center_freq(uhd.tune_request(self.freq,0), 0)
self.source.clear_command_time()
self.sink.clear_command_time()
When I run the code it output the following error in the terminal:
Traceback (most recent call last):
File "./reader_monostatic_with_MIMO_sniffer_v5.py", line 171, in
<module>
main_block = reader_top_block()
File "./reader_monostatic_with_MIMO_sniffer_v5.py", line 140, in
__init__
self.usrp_init()
File "./reader_monostatic_with_MIMO_sniffer_v5.py", line 55, in
usrp_init
self.sink.set_time_unknown_pps(uhd.time_spec())
File
"/usr/local/lib/python2.7/dist-packages/gnuradio/uhd/uhd_swig.py",
line 4779, in set_time_unknown_pps
return _uhd_swig.usrp_sink_sptr_set_time_unknown_pps(self, time_spec)
RuntimeError: RuntimeError: fifo ctrl timed out looking for acks
------------------------------------------------------------------------
*From:* Skyvalakis Konstantinos
*Sent:* Monday, May 31, 2021 3:55 PM
*To:* Marcus D. Leech
*Subject:* Re: USRP N200
Thank you very much for the suggestion.
I will try it ASAP and I will let you know.
------------------------------------------------------------------------
*From:* Discuss-gnuradio
<[email protected]> on behalf
of Marcus D. Leech <[email protected]>
*Sent:* Monday, May 31, 2021 3:42 PM
*To:* [email protected]
*Subject:* Re: USRP N200
On 05/31/2021 06:23 AM, Skyvalakis Konstantinos wrote:
Hi,
I have 2 USRP N200 devices equipped with an SBX daughterboard each.
I want to build a 1 Tx, 2 Rx system, where everything is synchronized.
I have an external generator to provide 10MHz ref clock and PPS
input for both USRP devices with equal length cables.
The 1st USRP, with the SBX daughterboard, is both Tx and Rx.
The 2nd USRP, with the SBX daughterboard, is just Rx.
Phase synchronization is crucial to my application and thus I really
need to know if I am doing it right or not.
Therefore, I am attaching the following code in Python, that I
use to synchronize the devices and I would like to know if it's
correct or not.
def usrp_init(self):
self.source = [None, None]
self.source[0] = uhd.usrp_source(
device_addr=self.usrp_address_source[0],
stream_args=uhd.stream_args(
cpu_format="fc32",
channels=range(1),
),
)
self.source[1] = uhd.usrp_source(
device_addr=self.usrp_address_source[1],
stream_args=uhd.stream_args(
cpu_format="fc32",
channels=range(1),
),
)
self.sink = uhd.usrp_sink(
device_addr=self.usrp_address_sink,
stream_args=uhd.stream_args(
cpu_format="fc32",
channels=range(1),
),
)
self.source[0].set_clock_source('external', 0);
self.source[0].set_time_source('external', 0);
self.source[0].set_time_unknown_pps(uhd.time_spec())
self.source[0].set_samp_rate(self.adc_rate)
self.source[0].set_gain(self.rx_gain0, 0)
self.source[0].set_antenna("RX2", 0)
self.source[1].set_clock_source('external', 0)
self.source[1].set_time_source('external', 0)
self.source[1].set_time_unknown_pps(uhd.time_spec())
self.source[1].set_samp_rate(self.adc_rate)
self.source[1].set_gain(self.rx_gain1, 0)
self.source[1].set_antenna("RX2", 0)
self.sink.set_clock_source('external', 0);
self.sink.set_time_source('external', 0);
self.sink.set_time_unknown_pps(uhd.time_spec())
self.sink.set_samp_rate(self.dac_rate)
self.sink.set_gain(self.tx_gain, 0)
self.sink.set_antenna("TX/RX", 0)
time.sleep(1)
cmd_time0 = self.source[0].get_time_last_pps()
cmd_time1 = self.source[1].get_time_last_pps()
cmd_time2 = self.sink.get_time_last_pps()
real_seconds0 = uhd.time_spec_t.get_real_secs(cmd_time0)
real_seconds1 = uhd.time_spec_t.get_real_secs(cmd_time1)
real_seconds2 = uhd.time_spec_t.get_real_secs(cmd_time2)
future_real_seconds0 = real_seconds0 + 1
future_real_seconds1 = real_seconds1 + 1
future_real_seconds2 = real_seconds2 + 1
future_cmd_time0 = uhd.time_spec_t(future_real_seconds0)
future_cmd_time1 = uhd.time_spec_t(future_real_seconds1)
future_cmd_time2 = uhd.time_spec_t(future_real_seconds2)
self.source[0].set_command_time(future_cmd_time0)
self.source[1].set_command_time(future_cmd_time1)
self.sink.set_command_time(future_cmd_time2)
self.source[0].set_center_freq(uhd.tune_request(self.freq,0), 0)
self.source[1].set_center_freq(uhd.tune_request(self.freq,0), 0)
self.sink.set_center_freq(uhd.tune_request(self.freq,0), 0)
self.source[0].clear_command_time()
self.source[1].clear_command_time()
self.sink.clear_command_time()
Thanks in advance.
Konstantinos
Your RX streams need to be coming from a SINGLE multi_usrp object,
not separate objects.
Please see the rx_multi_samples example code.
Also there's a good knowledge-base article about synchronization:
https://kb.ettus.com/Synchronization_and_MIMO_Capability_with_USRP_Devices