Talking to a usb device (serial terminal)

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Mon Mar 3 12:31:55 EST 2008


blaine wrote:

> So my question is this - what is the easiest way to interface to
> this "serial" device?
> 
> I don't imagine a straight read() and write() command to
> /dev/ttyusb0 is the most efficient (if it even works) 

It doesn't only work, it's the preferred way (if you don't use
advanced wrappers like pyserial). For the basics see

http://www.easysw.com/~mike/serial/serial.html

> especially since we would need to set a baud rate.

What is the relationship between read/write, the baud rate, and
efficiency? The serial port is configured using POSIX terminal
interface (termios).

Regards,


Björn

-- 
BOFH excuse #89:

Electromagnetic energy loss




More information about the Python-list mailing list