[Top][All Lists]

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

Re: [Discuss-gnuradio] pySerial and GNU Radio

From: Josh Blum
Subject: Re: [Discuss-gnuradio] pySerial and GNU Radio
Date: Thu, 14 Jan 2010 12:23:22 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100113 Shredder/3.0.2pre

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(),

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

reply via email to

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