title: Unable to read serial port with node-serialport on raspberry pi
body: <p>I'm using a raspberry pi (the first model) running on Jessy (8), node v0.12.6 and serialport 2.0.6. I have connected the pin Rx on the pin Tx of the physical serial port. </p>
  
  <p>It's working fine with <code>cat /dev/ttyAMA0</code> and <code>echo "Hello" &gt; /dev/ttyAMA0</code></p>
  
  <p>The writing on the serial port with node-serialport is fine. I am using the code bellow (and using <code>cat</code> to read this) (source: <a href="https://www.npmjs.com/package/serialport" rel="nofollow">https://www.npmjs.com/package/serialport</a>)</p>
  
  <pre><code>var serialport = require("serialport");
  var SerialPort = serialport.SerialPort;
  var sp = new SerialPort("/dev/ttyAMA0", {
      baudrate:9600,
      databits: 8,
      parity: 'none',
      stopBits: 1,
      flowControl: false,
      parser: serialport.parsers.readline("\n"),
  });
  
  sp.on('open', function() {
      console.log("sending");
      sp.write("Hello");
  });
  </code></pre>
  
  <p>I am now trying to read my serial port with node-serialport, but it doesn't work. When I am trying to read the serialport with node-serialport (and using <code>echo</code> to write on it), the data from <code>echo</code> are not writen in the terminal. The terminal only says "open". I am using this code, same source: </p>
  
  <pre><code>var serialport = require("serialport");
  var SerialPort = serialport.SerialPort;
  var sp = new SerialPort("/dev/ttyAMA0", {
      baudrate:9600,
      databits: 8,
      parity: 'none',
      stopBits: 1,
      flowControl: false,
      parser: serialport.parsers.readline("\n"),
  });
  
  
  sp.on('open', function() {
      console.log('open');
      sp.on('data', function(data) {
          console.log('data received: ' + data);
      });
  });
  </code></pre>
  
  <p>I don't understand what's happening here. Any help would be much appreciated!</p>
  
  <p>Thanks a lot! :)</p>
  
  <p>Nicolas</p>