serial module
Albert van der Horst
albert at spenarnc.xs4all.nl
Tue May 22 12:28:00 EDT 2012
In article <jp6gcj$1rij$1 at adenine.netfront.net>,
Ron Eggler <ronDOTeggler at tscheemail.com> wrote:
>Hoi,
>
>I'm trying to connect to a serial port and always get the error
>"serial.serialutil.SerialException: Port is already open." whcih is untrue.
>I have no serial port open yet, my code looks like this:
>#!/usr/bin/python
>import time
>import serial
>
># configure the serial connections (the parameters differs on the device
># you are connecting to)
>ser = serial.Serial(
> port='/dev/ttyUSB0',
> baudrate=19200,
> parity=serial.PARITY_ODD,
> stopbits=serial.STOPBITS_TWO,
> bytesize=serial.SEVENBITS
>)
>
>ser.open()
>
>Why do I get this error?
You realize that these parameters relate to RS232 ports?
It is anybody's guess what they do in USB. The best answers is probably
that it depends on the whim of whoever implements the usb device.
Certainly this stuff is system dependant, so please start with stating
which version kernel etc. of Linux you run, and the output of
lsusb --verbose.
>
>Thank you,
>Ron
Groetjes Albert
--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert at spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
More information about the Python-list
mailing list