I would add that in my experience it is not enough to make the unknown PPS into a known PPS. For example, if I were to go into the python file that my flowgraph generated and in the __init__() function add something like:
curr_hw_time = self.USRP_A.get_time_last_pps() #note: curr_hw_time is a 'time_spec_t()' object self.USRP_A.set_time_next_pps( (curr_hw_time+1.0 ) ) self.USRP_B.set_time_next_pps( (curr_hw_time+1.0 ) ) Then I would also have to add something like self.USRP_A.set_start_time(uhd.time_spec_t(curr_hw_time+2.0 ) ) self.USRP_B.set_start_time(uhd.time_spec_t(curr_hw_time+2.0 ) ) To maintain the relative phase relation of the signals I receive between re-initializations and full reboots of the USRPs. I am not sure why this is the case, but this is the result I have seen while testing -Mark On Mon, Nov 4, 2019 at 12:39 PM Paul Boven <p.bo...@xs4all.nl> wrote: > Hi Ali, > > Your CDA-2990 (OctoClock?) distributes both a frequency reference signal > (10MHz) and a time reference signal (1PPS). To get both USRP to record > at the same time, you need to first get them to run on the same time > internally, and then tell them both, in advance, at what time to start > streaming. > > Unfortunately, that will take a bit of tinkering, and cannot be done > from just regular GRC blocks at the moment. > > The first half of the problem, getting them to run at the same time, is > a bit more difficult than it should be, as it involves writing some code > to turn your 'unknown PPS' into a know PPS. Basically, you read out the > PPS status from one of the USRPs, and once you see that it changes (i.e. > a PPS edge has just been detected by it) you read out the time on your > PC, add one second to it, and tell both USRPs that they have to set > themselves to this time value at their next PPS. For more details, see: > > https://files.ettus.com/manual/page_sync.html > > Once you have this done, you can send a command to each USRP to start > streaming at a particular second. This could be done either from two > separate applications, or just one that talks to both USRPs, using two > UHD source blocks. > > I've 'hacked' the required statements into the python code that gets > generated when your GRC file is compiled. That has the huge drawback of > having to re-patch it every time you change the flowgraph. This approach > gets more convenient if you write your flowgraph in Python or C++, and > add the required synchronization commands in there. Most of my > measurements were done with a modified uhd_rx_cfile, where I added the > synchronization logic, and an extra argument for the start time (in unix > epoch seconds). > > Regards, Paul Boven. > > On 10/29/19 9:04 PM, alireza nazari wrote: > > Hi, > > > > I am trying to use GNURadio to receive signals and record them to files > > from two USRP B210(each has two channels). Both SDRs are connected to an > > CDA-2990 external clock. In gnuRadio I had to put two UHD source blocks > > and use "serial=xxx" to point them to each SDR and connect each output > > channel to 4 file Sink blocks. I also changed the clock and time source > > to "external" and synced to "unknown PPS". However, a couple of files > > are different in size from the other couple. Apparently if I want to > > start them synchronously, all four channels should be in one source > > block, but how can I do that and point out each 2 channels come from a > > different device? When I try one USRP source block > > with "serial0=31A3C93,serial1=31A3D4B", I face an error bellow: > > /Traceback (most recent call last): > > File "E:\Alireza\sdr_A20\top_block.py", line 207, in <module> > > main() > > File "E:\Alireza\sdr_A20\top_block.py", line 201, in main > > tb = top_block_cls() > > File "E:\Alireza\sdr_A20\top_block.py", line 125, in __init__ > > self.uhd_usrp_source_0.set_clock_source('external', 1) > > File "E:\Program > > Files\PothosSDR\lib\python2.7\site-packages\gnuradio\uhd\uhd_swig.py", > > line 2987, in set_clock_source > > return _uhd_swig.usrp_source_sptr_set_clock_source(self, source, > > mboard) > > RuntimeError: LookupError: IndexError: multi_usrp::mb_root(1) - > > LookupError: IndexError: multi_usrp::mb_root(1) - path not found > > / > > > > Is there any example available on how I can synchronously start > > recording from different devices? I assume this is a trivial task but I > > have been searching for this for a few days right now and I can't find > > any helpful answer. I am attaching my .grc files. > > > > Thank you, > > Ali > > > -- Mark Wagner University of California San Diego Electrical and Computer Engineering