Re: [Discuss-gnuradio] pySerial and GNU Radio

2010-01-14 Thread John Bonn

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, s042...@student.dtu.dk 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
>> Discuss-gnuradio@gnu.org
>> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> 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.



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] pySerial and GNU Radio

2010-01-14 Thread Josh Blum
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, s042...@student.dtu.dk 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
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio



___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio


[Discuss-gnuradio] pySerial and GNU Radio

2010-01-13 Thread s042353
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
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio