[pyserial - winXP] Serial port stop receiving data after a few hours, raise no error

Discussion in 'Python' started by pauland80@gmail.com, Aug 7, 2007.

  1. Guest

    <snip>
    > My soft passively listen to a device sending +- 300 bytes of data each
    > second. After several hours of work, the soft abruptly stops receiving
    > data without any error, (while the device sends properly, of course)
    > and I need to restart it (the python soft) to "reactivate" the ports.
    >
    > I read that when the serial port encounters an error (frame error or
    > so, I imagine?) it stop receiving data until the library function
    > "getCommError()" is called.
    >
    > Am I on the good track? Can I call this function from my pyserial
    > code?
    >
    > Why pyserial does'nt raise a serial.SerialException in this case?
    >
    > Notes:
    > ---------
    > I'm not working with plain serial ports, I use serial over USB (FTDI
    > or so) and serial over Ethernet (moxa.com).
    > I'm in 115k 8N1 and I use 4 ports simultaneously
    > I use python 2.4 with pyserial 2.2 on Windows XP.

    <snip>



    Late thanks for your both answers! (Please excuse me for that)

    The problem was a bug in the device firmware.
    But before finding this, I dugg lightly in the pyserial source and
    found (to take with care!) :

    + getCommError(...) is (?) no more implemented in the win32 API (it
    was in the win16 API) ; it is replaced by GetCommState(...) ; pyserial
    use GetCommState(...) in _reconfigurePort()

    + pyserial use ClearCommError in the functions read(...) and
    inWaiting(...) ; it takes somewhat different arguments than
    GetCommState(...) but return the same (?) info AND clear the errors
    (getcomm(Error|State) doesn't (?)).

    + the errors on the serial flow (overrun and so) seem just cleared
    away and not followed to the application by pyserial.

    PA

    the links :
    delta win 16/32 on msdn : http://msdn2.microsoft.com/en-us/library/aa383678.aspx
    GetCommState() on msdn : http://msdn2.microsoft.com/en-us/library/aa363260.aspx
    ClearCommError() on msdn : http://msdn2.microsoft.com/en-us/library/aa363180.aspx
     
    , Aug 7, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    461
    Hendrik van Rooyen
    Jun 7, 2007
  2. Replies:
    4
    Views:
    2,073
    marina_dan
    Oct 31, 2011
  3. terry
    Replies:
    5
    Views:
    890
    Gabriel Genellina
    May 3, 2008
  4. zxo102
    Replies:
    3
    Views:
    381
    zxo102
    Oct 12, 2008
  5. John Nagle
    Replies:
    1
    Views:
    1,584
    Tim Golden
    Mar 31, 2011
Loading...

Share This Page