discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] pySerial and GNU Radio


From: John Bonn
Subject: Re: [Discuss-gnuradio] pySerial and GNU Radio
Date: Thu, 14 Jan 2010 14:17:24 -0800 (PST)

Hey...

Happy to see a coinciding question in the same time frame :)

I'd also tried a similar approach. But the data acceptable on Scope sink
seems entirely in a different format, than just sending raw samples via the
File Descriptor block. That explains why you are able reproduce the data on
a File sink. 

The method I tried was to connect a TCP Source to a TCP Sink and Scope Sink.
When I was sending data as raw samples to the TCP Source, it appeared
correctly at the TCP sink, but nothing at Scope Sink. It was more
interesting when I connected a Vector Source to TCP Sink (server), and what
came out was ASCII junk, which convinced me that the samples should be
wrapped around some Vector Source like mechanism.

Am I entirely on a wrong track ?

Regards,

John




Josh Blum-2 wrote:
> 
> I remember needing to call os.dup() or os.dup2() on the serial device's 
> file descriptor, and passing that new file descriptor to the file 
> source. Hope that helps! -Josh
> 
> On 01/13/2010 01:35 PM, address@hidden wrote:
>> Hi there Gurus of Software Defined Radio Heaven,
>>
>> I have been trying to get pySerial and GNU Radio to work together but
>> only
>> with limited success. The goal is to read data from a serial connection,
>> say '/dev/ttyUSB0', and use it to calculate the bit error rate.
>>
>> I'm using pySerial in GNU Radio the following way,
>>
>>     [...]
>>     self.ser = serial.Serial('/dev/ttyUSB0')
>>     self.src = gr_file_descriptor_source(gr.sizeof_char,
>> self.ser.fileno(),
>> False)
>>     [...]
>>
>> If I put a self.ser.readline() in there somewhere (before calling Run())
>> the next line is read correctly from the serial connection.
>>
>> When I connect a file_descriptor_source with both a file_sink and a
>> scope_sink the result is that the file contains the correct data, no
>> problem, but the scope_sink just never gets updated. No errors, no
>> nothing. When I change the repeat parameter to true, I get a 'lseek'
>> Invalid seek error.
>>
>> Any ideas on how to get it working?
>>
>> - Martin
>>
>>
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 

-- 
View this message in context: 
http://old.nabble.com/pySerial-and-GNU-Radio-tp27153172p27167828.html
Sent from the GnuRadio mailing list archive at Nabble.com.





reply via email to

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