discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] pipes


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] pipes
Date: Wed, 5 Jul 2006 07:06:41 -0700
User-agent: Mutt/1.5.9i

On Wed, Jul 05, 2006 at 10:32:36AM +0000, paul munro wrote:
> Ok, I have tried the TCP method with no real success. I have set GNUradio 
> to be the client, Labview as the server. They connect, then the python 
> script disconnects with errors before any data is communicated. I have 
> tried a couple of different methods. 1) no framing or correlator, and
> 2) with gr.simple_correlator(1024)
> 
> My code is as follows:
> 
>            # write to fd (socket)
>            fd = socket.socket (socket.AF_INET, socket.SOCK_STREAM)
>           self.conn = fd.connect(('0.0.0.0',options.socket))
>            print "Connecting to:", self.conn
>            print "Address:", self.conn
>            # sink to file descriptor
>            self.dst = gr.file_descriptor_sink (gr.sizeof_gr_complex, 
> fd.fileno())
>            print ("data to socket")
> 
>            self.connect(self.u, self.dst)
> 
>           #self.corr = gr.simple_correlator (1024)
>          #self.connect(self.u, self.corr, self.dst)
> 

I'm pretty sure that "fd"  is going out of scope and thus the underlying
file descriptor is closed.

This is what is causing:

> 1)when using no correlator the error I get is:
>         gr_file_descriptor_sink: Bad file descriptor

Try assigning it to self.fd = socket.socket(...)


> 2) when using gr.simple_correlator(8) the error is:
>         File 
> "/usr/local/lib/python2.3/site-packages/gnuradio/gr/basic_flow_graph.py", 
> line
>         242, in _check_type_match
>             raise ValueError, 'source and destination data sizes are 
> different'

You've got to connect things with the same size ins and outs together.
Sorry, the error message could use some improvement.  It should tell
you the blocks involved.

> >From what I can gather, Labview reads x bytes (8 in my case) in string 
> format. This string can then be recast to complex. I have done this reading 
> from a file and pipes with no problems. I'm not sure if the problem is the 
> tcp control or a lower level of gnuradio.

It's your python code.  No problem with TCP or GNU Radio.

> Any suggestions??

Start with something more simple.  E.g., have GNU Radio generate a
complex sinusoid using gr.sig_source_c and use TCP to send it to
labview.

Eric




reply via email to

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