title: Python Serial stops reading
body: <p>I'm working on a project with a coin acceptor and a raspberry. I have the following code to test the output from the coin acceptor: </p>
  
  <pre><code>import serial
  from time import sleep
  
  ser = serial.Serial('/dev/ttyUSB0', 4800, 8, 'N', 1, timeout=None)
  while True:
    line = ser.read(ser.inWaiting())
    if len(line) &gt; 0:
      print ord(line)
  ser.close()
  </code></pre>
  
  <p>everything works fine and i get output from the acceptor every time i drop a coin. But after a while it stops reading. In windows with a serial port monitor it works and I get output every time.</p>
  
  <p>Thanks!</p>