[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] pipes
From: |
paul munro |
Subject: |
Re: [Discuss-gnuradio] pipes |
Date: |
Wed, 05 Jul 2006 10:32:36 +0000 |
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)
1)when using no correlator the error I get is:
gr_file_descriptor_sink: Bad file descriptor
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'
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.
Any suggestions??
Regards Paul
From: Eric Blossom <address@hidden>
To: paul munro <address@hidden>
CC: address@hidden
Subject: Re: [Discuss-gnuradio] pipes
Date: Tue, 4 Jul 2006 06:54:52 -0700
On Tue, Jul 04, 2006 at 06:44:55AM +0000, paul munro wrote:
> Is there a way of sending the data from the USRP to another application
> using pipes?? I only know the basics of pipes, and need to look into it
> more. I was going to try using TCP but thought pipes maybe easier. Also,
> labview (the app i am sending it to) expects data over the TCP port to
be
> in string format, which is another headache I'm not really prepared to
> tackle.
> My main issue is whether pipes can be done in using the available
GNURadio
> libraries. I am guessing it maybe achieved using the
> gr_file_descriptor_sink(), but I'm not sure how to write to the pipe
using
> this.
>
> Any ideas??
> Regards Paul
Hi Paul, you can use pipes or TCP. I suggest TCP, it's really no
problem. In both cases, open the pipe / socket in python, then use
the foo.fileno() method to get the file descriptor. Use the file
descriptor with gr.file_descriptor_sink
Eric
_________________________________________________________________
Dont just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/