FAQ
I have a pain in the a** problem with pyserial- it works 90% of time
but on the 10% of time it thorows and termios.error exception with the
value (5, 'Input/output error') and i cannot get rid of it :(
The system works as follows:
A device sends out rs485 data -> rs485 to rs232 converter converts it -
an rs232->usb cable attatched to a computer reads the data. Until
now it hasn't bothered me too much since it hasn't been a lot of data
(every time i get this exception i unload the pl2303 module from
kernel, then reload it, open the com port and hope it won't happen
soon). But now the amount of data is getting bigger and the exceptions
in the log are quite bothering already so if anyone has a good idea
what could affect it i'd be very glad...
oh and the settings for the port opening are:
self.ser = serial.Serial(self.port, self.baudrate, rtscts=0,
xonxoff=0, timeout=0)

With best regards,
Tanel

Search Discussions

  • Diez B. Roggisch at Nov 30, 2009 at 4:15 pm

    a b wrote:

    I have a pain in the a** problem with pyserial- it works 90% of time
    but on the 10% of time it thorows and termios.error exception with the
    value (5, 'Input/output error') and i cannot get rid of it :(
    The system works as follows:
    A device sends out rs485 data -> rs485 to rs232 converter converts it -
    an rs232->usb cable attatched to a computer reads the data. Until
    now it hasn't bothered me too much since it hasn't been a lot of data
    (every time i get this exception i unload the pl2303 module from
    kernel, then reload it, open the com port and hope it won't happen
    soon). But now the amount of data is getting bigger and the exceptions
    in the log are quite bothering already so if anyone has a good idea
    what could affect it i'd be very glad...
    oh and the settings for the port opening are:
    self.ser = serial.Serial(self.port, self.baudrate, rtscts=0,
    xonxoff=0, timeout=0)
    Did you try a different usb2serial-converter? I've got plenty of them used
    in the past few years, and frankly, they mostly suck. Big time.

    With them, all kinds of timing-issues and other problems arose, and some
    hardware refused to outright work with them.

    So, I suggest you try & get a hold on as many usb2serial-converters you can
    get from friends and colleagues, and try out which one works best.

    There is nothing on the software-side you can do (short from lowering the
    bps, as this might cover up for some issues due to relaxed timing. But I
    had to cut down to like 2400 bps or some crap like that, which isn't really
    usable)

    Diez
  • Grant Edwards at Nov 30, 2009 at 5:41 pm

    On 2009-11-30, a b wrote:
    I have a pain in the a** problem with pyserial- it works 90%
    of time but on the 10% of time it thorows and termios.error
    exception with the value (5, 'Input/output error') and i
    cannot get rid of it :(
    Sounds like faulty converter or a bug in the device driver to
    me.
    The system works as follows:
    A device sends out rs485 data -> rs485 to rs232 converter converts it -
    an rs232->usb cable attatched to a computer reads the data. Until
    now it hasn't bothered me too much since it hasn't been a lot
    of data (every time i get this exception i unload the pl2303
    module from kernel, then reload it, open the com port
    Does that get rid of the error? If so, then it's definitely a
    problem with the converter or device-driver.
    and hope it won't happen soon). But now the amount of data is
    getting bigger and the exceptions in the log are quite
    bothering already so if anyone has a good idea what could
    affect it i'd be very glad... oh and the settings for the port
    opening are: self.ser = serial.Serial(self.port,
    self.baudrate, rtscts=0, xonxoff=0, timeout=0)
    Unless you want to try to troubleshoot the device driver and
    USB traffic, the only suggestion I have is to try different
    converters and/or different versions of the driver.

    --
    Grant Edwards grante Yow! If Robert Di Niro
    at assassinates Walter Slezak,
    visi.com will Jodie Foster marry
    Bonzo??
  • Glazner at Nov 30, 2009 at 9:38 pm

    On Nov 30, 7:41?pm, Grant Edwards wrote:
    On 2009-11-30, a b wrote:

    I have a pain in the a** problem with pyserial- it works 90%
    of time but on the 10% of time it thorows and termios.error
    exception with the value (5, 'Input/output error') and i
    cannot get rid of it :(
    Sounds like faulty converter or a bug in the device driver to
    me.
    The system works as follows:
    A device sends out rs485 data -> rs485 to rs232 converter converts it -
    an rs232->usb cable attatched to a computer reads the data. Until
    now it hasn't bothered me too much since it hasn't been a lot
    of data (every time i get this exception i unload the pl2303
    module from kernel, then reload it, open the com port
    Does that get rid of the error? ?If so, then it's definitely a
    problem with the converter or device-driver.
    and hope it won't happen soon). But now the amount of data is
    getting bigger and the exceptions in the log are quite
    bothering already so if anyone has a good idea what could
    affect it i'd be very glad... oh and the settings for the port
    opening are: self.ser = serial.Serial(self.port,
    self.baudrate, rtscts=0, xonxoff=0, timeout=0)
    Unless you want to try to troubleshoot the device driver and
    USB traffic, the only suggestion I have is to try different
    converters and/or different versions of the driver.

    --
    Grant Edwards ? ? ? ? ? ? ? ? ? grante ? ? ? ? ? ? Yow! If Robert Di Niro
    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? at ? ? ? ? ? ? ? assassinates Walter Slezak,
    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?visi.com ? ? ? ? ? ?will Jodie Foster marry
    ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Bonzo??
    Try to use Portmon to see if your data is sent correctly.(if not, then
    its the cable/converter)
    http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx
    or another port monitor tool for other OS.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedNov 30, '09 at 4:03p
activeNov 30, '09 at 9:38p
posts4
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase