title: Reading bytes with PySerial: Empty results (Java works)
body: <p>I am trying to read bytes from a digital meter via PySerial. It all works with Processing/Java. But i need it to port to Raspberry Pi.</p>
  
  <p>While Java receives the correct bytes, Python does not receive anything at all. The digital meter simply sends 16 bytes delimited by 13.</p>
  
  <p>Working Java / Processing code (receives byte array):</p>
  
  <pre><code>import processing.serial.*;
  String portName = "/dev/tty.PL2303-00001004";
  myPort = new Serial(this, portName, 9600);
  ...
  if ( myPort.available() &gt; 0)
  {
    byte[] inBuffer = new byte[16];
    myPort.readBytesUntil(13, inBuffer);
    println("Buffer: " + inBuffer.length);
  }
  </code></pre>
  
  <p>Not working Python code (receives nothing / ''):</p>
  
  <pre><code>import serial
  import time
  
  ser = serial.Serial('/dev/tty.PL2303-00001004', 9600, timeout=None) # tried different timeout
  print(ser.isOpen())
  
  while True:
      tmp = ser.read()
      print tmp
      print tmp.__len__()
      time.sleep(1)
  </code></pre>
  
  <p>Reading an Arduino Board with this Python code works fine.</p>
  
  <p><strong>Solution: ser.setDTR(1) got it working!</strong></p>