# Data Collection Across Multiple Machines and USRPs

**URL:** <https://www.ruby-forum.com/t/data-collection-across-multiple-machines-and-usrps/230181>\
**Category:** GNU Radio\
**Created:** [June 3, 2014, 8:25pm UTC](https://www.ruby-forum.com/t/data-collection-across-multiple-machines-and-usrps/230181 "2014-06-03T20:25:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [June 3, 2014, 8:25pm UTC](https://www.ruby-forum.com/t/data-collection-across-multiple-machines-and-usrps/230181/1 "2014-06-03T20:25:28Z")

</div>

Hey list, this is a question for anyone that has used the USRPs and GNU  
Radio for synchronized data collection.

I need to collect data using USRP N210s across a wireless network for a  
field test. Basically the USRPs would be connected to laptops running  
GNU  
radio and the laptops themselves will be networked over WiFi.

My conceptualized collection would work as so: master computer that  
would  
control the collection python scripts on remote machines and itself  
locally  
(a simple USRP source to throttle to file sink). The caveat is these  
scripts must start within a second of each other, so I am trying to  
avoid  
delays and keep latency under a 1000 ms (preferably somewhere close to  
500  
ms). My initial testing of my idea at my work desk as been less than  
spectacular. I was using a bash script that had two lines of code:

#!/bin/sh  
./home/$USER/Documents/GNU\_radio/data\_collection.py  
–uhd-addr=addr=10.2.8.104 &  
ssh -t $USER@Dell1 python ~/Documents/GNU\_radio/data\_collection.py  
–uhd-addr=addr=10.2.8.105 &

It is a very simple script executing a script on local and one remotely  
via  
SSH, and according to the saved data files the file  
creation/modification  
times are off. If the the save files are created from scratch, the  
timing  
is extremely close and meets expectations when it is just two scripts.  
If  
the files are already pre-existing then the modification times can range  
from 1 to 5 seconds. When I add more scripts to the shell script. Like  
so:

#!/bin/sh  
./home/$USER/Documents/GNU\_radio/data\_collection.py  
–uhd-addr=addr=10.2.8.104 &  
./home/$USER/Documents/GNU\_radio/data\_collection.py  
–uhd-addr=addr=10.2.8.102 &  
ssh -t $USER@Dell1 python ~/Documents/GNU\_radio/data\_collection.py  
–uhd-addr=addr=10.2.8.105 &  
ssh -t $USER@Dell1 python ~/Documents/GNU\_radio/data\_collection.py  
–uhd-addr=addr=10.2.8.103 &

The times are even more off and can range from 3 to 10 seconds.  
Alternatively, I can have dual USRP sources to file sink in the same  
script  
to get back down to the original script and I have a 3 to 7 seconds gap  
between the data files collected in the local script compared to the  
data  
files collected by the remote script.

Is there a better way to go about collecting data quickly in  
synchronized  
fashion? I thought about a timing function built in each GNU radio  
script  
that should start the flow graph on any even second (based off a modulus  
function of current system time in seconds) but I want to weigh all  
options  
first.

Thanks for your time reading,

Jon

---

<div class="post-metadata">

**Author:** ![jfaulkenberry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@jfaulkenberry](https://www.ruby-forum.com/u/jfaulkenberry)\
**Post date:** [June 3, 2014, 8:29pm UTC](https://www.ruby-forum.com/t/data-collection-across-multiple-machines-and-usrps/230181/2 "2014-06-03T20:29:35Z")

</div>

Hey Jonathan,

when you cannot use GPSDOs, you should just sync your Laptops using NTP,  
and then set the laptop time as device time on the USRPs using  
set\_time\_now.

You can then agree on a specific point in time, use set\_start\_time on  
the USRP sources and try to estimate how well-coordinated you are by  
cross-correlating your measurements.

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![jfaulkenberry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@jfaulkenberry](https://www.ruby-forum.com/u/jfaulkenberry)\
**Post date:** [June 3, 2014, 8:33pm UTC](https://www.ruby-forum.com/t/data-collection-across-multiple-machines-and-usrps/230181/3 "2014-06-03T20:33:43Z")

</div>

On Tue, Jun 3, 2014 at 2:28 PM, Marcus Müller [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Marcus

I’ll also recommend the file\_meta\_sink block:

> **[GNU Radio Manual and C++ API Reference: gr::blocks::file\_meta\_sink Class...](https://www.gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1file __meta__ sink.html)**

This will store a time stamp based on the time info from the USRPs. It  
should help you realign the data sets afterwards.

Tom

---

<div class="post-metadata">

**Author:** ![jfaulkenberry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/c2a13f/32.png) [@jfaulkenberry](https://www.ruby-forum.com/u/jfaulkenberry)\
**Post date:** [June 3, 2014, 9:12pm UTC](https://www.ruby-forum.com/t/data-collection-across-multiple-machines-and-usrps/230181/4 "2014-06-03T21:12:02Z")

</div>

From: discuss-gnuradio-bounces+sean.nowlan=removed\_email\_address@domain.invalid  
[[mailto:discuss-gnuradio-bounces+sean.nowlan=removed\_email\_address@domain.invalid](mailto:discuss-gnuradio-bounces+sean.nowlan=removed_email_address@domain.invalid)] On  
Behalf Of Tom R.  
Sent: Tuesday, June 03, 2014 2:32 PM  
To: GNURadio D.ion List  
Subject: Re: [Discuss-gnuradio] Data Collection Across Multiple Machines  
and USRPs

On Tue, Jun 3, 2014 at 2:28 PM, Marcus Müller  
\<removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:  
Hey Jonathan,

when you cannot use GPSDOs, you should just sync your Laptops using NTP,  
and then set the laptop time as device time on the USRPs using  
set\_time\_now.

You can then agree on a specific point in time, use set\_start\_time on  
the USRP sources and try to estimate how well-coordinated you are by  
cross-correlating your measurements.

Greetings,  
Marcus

I’ll also recommend the file\_meta\_sink block:

[http://gnuradio.org/doc/doxygen/classgr\_1\_1blocks\_1\_1file\_\_meta\_\_sink.html](http://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1file __meta__ sink.html)

This will store a time stamp based on the time info from the USRPs. It  
should help you realign the data sets afterwards.

Tom

If you don’t have GPSDOs but need near-GPS accuracy, one option is to  
get cheap USB GPS pucks and configure your GPSD instance to run an NTP  
server, and point your system ntpd client at it. Then use the  
“set\_time\_now” UHD/gr-uhd command to set the time register on multiple  
radios. Finally, use the “set\_start\_time” command mentioned above to  
schedule RX captures.

[GPSD redirection page](http://www.catb.org/gpsd/gpsd-time-service-howto.html)[http://www.catb.org/gpsd/gpsd-time-service-howto.html](http://www.catb.org/gpsd/gpsd-time-service-howto.html)

Sean

On 03.06.2014 20:24, Jonathan F. wrote:

Hey list, this is a question for anyone that has used the USRPs and GNU

Radio for synchronized data collection.

I need to collect data using USRP N210s across a wireless network for a

field test. Basically the USRPs would be connected to laptops running  
GNU

radio and the laptops themselves will be networked over WiFi.

My conceptualized collection would work as so: master computer that  
would

control the collection python scripts on remote machines and itself  
locally

(a simple USRP source to throttle to file sink). The caveat is these

scripts must start within a second of each other, so I am trying to  
avoid

delays and keep latency under a 1000 ms (preferably somewhere close to  
500

ms). My initial testing of my idea at my work desk as been less than

spectacular. I was using a bash script that had two lines of code:

#!/bin/sh

./home/$USER/Documents/GNU\_radio/data\_collection.py

–uhd-addr=addr=10.2.8.104 &

ssh -t $USER@Dell1 python ~/Documents/GNU\_radio/data\_collection.py

–uhd-addr=addr=10.2.8.105 &

It is a very simple script executing a script on local and one remotely  
via

SSH, and according to the saved data files the file  
creation/modification

times are off. If the the save files are created from scratch, the  
timing

is extremely close and meets expectations when it is just two scripts.  
If

the files are already pre-existing then the modification times can range

from 1 to 5 seconds. When I add more scripts to the shell script. Like  
so:

#!/bin/sh

./home/$USER/Documents/GNU\_radio/data\_collection.py

–uhd-addr=addr=10.2.8.104 &

./home/$USER/Documents/GNU\_radio/data\_collection.py

–uhd-addr=addr=10.2.8.102 &

ssh -t $USER@Dell1 python ~/Documents/GNU\_radio/data\_collection.py

–uhd-addr=addr=10.2.8.105 &

ssh -t $USER@Dell1 python ~/Documents/GNU\_radio/data\_collection.py

–uhd-addr=addr=10.2.8.103 &

The times are even more off and can range from 3 to 10 seconds.

Alternatively, I can have dual USRP sources to file sink in the same  
script

to get back down to the original script and I have a 3 to 7 seconds gap

between the data files collected in the local script compared to the  
data

files collected by the remote script.

Is there a better way to go about collecting data quickly in  
synchronized

fashion? I thought about a timing function built in each GNU radio  
script

that should start the flow graph on any even second (based off a modulus

function of current system time in seconds) but I want to weigh all  
options

first.

Thanks for your time reading,

Jon

* * *

Discuss-gnuradio mailing list

removed\_email\_address@domain.invalid[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)
