Arduino Yun, node.js and serial I'm trying to bypass Bridge library and read serial directly from nodejs. I'm on the last sys upgrade (1.3) I have correctly installed nodes and serial module via opkg install. I have also commented out the line in the /etc/inittab:

#ttyATH0::askfirst:/bin/ash --login


This is my arduino code:

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("dudee");
  delay(100);
}


This is my node.js code:

var SerialPort = require("serialport").SerialPort
var serialPort = new SerialPort("/dev/ttyATH0", {
    baudrate: 9600,
    dataBits: 8,
    parity: 'none',
    stopBits: 1,
    flowControl: false
}, false);

console.log("hello");

serialPort.on("open", function () {
    console.log('open');
    serialPort.on('data', function(data) {
        console.log('data received: ' + data);
    });
});

serialPort.on('error', function(err) {
    console.log('error: '+err);
});

serialPort.open();


If I ssh to yun and run the script I don't see any "dudee":

~/test# node serial.js
hello
open


While if I open the serial monitor I see it.

If I run the node script on my computer (changing the right serial port name) everything works nice and I see the dude..

What can it be?
Autosolved thanks to this old forum post.

It is Serial1 not Serial.
In the Arduino code in the Yun Serial is a different object from Serial1. Even if it is not super well document (or at least not in the first dumb google search) here are some links that talks about Serial1:

https://www.arduino.cc/en/Tutorial/YunSerialTerminal
http://andrea-toscano.com/arduino-yun-tcpip-to-serial1-redirect/
http://crossbar.io/iotcookbook/Arduino-Yun-Disable-Bridge/