# Re: linking Gnuradio and Gpredict?

**URL:** <https://www.ruby-forum.com/t/re-linking-gnuradio-and-gpredict/233204>\
**Category:** GNU Radio\
**Created:** [November 24, 2014, 11:16am UTC](https://www.ruby-forum.com/t/re-linking-gnuradio-and-gpredict/233204 "2014-11-24T11:16:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 24, 2014, 11:16am UTC](https://www.ruby-forum.com/t/re-linking-gnuradio-and-gpredict/233204/1 "2014-11-24T11:16:49Z")

</div>

I know this is going back a bit but I would like to do the same thing  
for my  
Gnuradio satellite ground station. I was actually tempted to compile  
satellite tracking into a Gnuradio block. One you could simply use in a  
flowchart without any of the messing about with XMLRPC but like my new  
hexagonal wheel project, with active compensatory suspension, it might  
be  
better to use what’s already there.

Did anyone do this? And, how difficult would it be in practice to  
develop a  
native block that either contains predict, or accesses it? Possibly not  
very  
difficult at all and maybe already done?

Mike

* * *

On 22/07/13 12:31, M Dammer wrote:

Is it possible to link Gnuradio and Gpredict ? I want to use Gpredict as  
tracker controlling the antenna position and to pass doppler corrected  
frequency data to Gnuradio.

In a word, yes.

Can be very simple. I did it by using an XML Server in the flow graph,  
and wrote a quick XML client (actually I “stole” most of it from an  
example), and sent the doppler info from predict via a variable.

doppler info was received from predict using some code to query predict  
using UDP. I think I just used nc to send the UDP query to predict,  
recovered the shift from the reply, and sent it back to the XML Server  
running within the flow graph.

Unfortunately I can’t find my actual code right now, but I literally  
copied an example, and added the UDP Predict clients bit. It went  
something like this pseudo code (Yes, this is a mix of shell,and

python, and you need to re-write the getting doppler from predict  
yourself,  
but you get the idea, and should give you enough)

import time  
import sys  
from socket import \*  
import xmlrpclib  
import binascii

s = xmlrpclib.Server("[http://192.168.39.74:8081](http://192.168.39.74:8081)  
[http://192.168.39.74:8081"](http://192.168.39.74:8081%22) "😉  
infinite=1  
while infinite == 1;

# Grab predict doppler using UDP

DOPPLER=`nc -u -s 2 $PREDICTHOST GET_DOPPLER $NORAD_NUMBER`  
s.set\_doppler\_shift($DOPPLER)  
time.sleep(1)

The variable (lets call it doppler\_shift) exists in the flowgraph,  
and was multiplied appropriately and applied to the centre frequency of  
a FIR filter.

You can pretty much pass any information you want in and out of a flow  
graph using a XML Server/Client pair. I’ve done TX/RX switching, and  
am currently working on telemetry decoding/display

Iain

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 24, 2014, 8:24pm UTC](https://www.ruby-forum.com/t/re-linking-gnuradio-and-gpredict/233204/2 "2014-11-24T20:24:32Z")

</div>

Hi Mike

Alex (the gqrx and Gpredict author) suggested using pyephem to me once  
when I  
asked about this. I did have a little play with it, but haven’t done  
anything  
interesting or useful.

[http://rhodesmill.org/pyephem/](http://rhodesmill.org/pyephem/)

Darren, G0HWW
