user1335: 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?

user1335: 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/

1335: <p>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 <code>/etc/inittab</code>:</p>

<pre><code>#ttyATH0::askfirst:/bin/ash --login
</code></pre>

<p>This is my arduino code:</p>

<pre><code>void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("dudee");
  delay(100);
}
</code></pre>

<p>This is my node.js code:</p>

<pre><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();
</code></pre>

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

<pre><code>~/test# node serial.js
hello
open
</code></pre>

<p>While if I open the serial monitor I see it.</p>

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

<p>What can it be?</p>
 1335: <p>Autosolved thanks to <a href="http://forum.arduino.cc/index.php?topic=194934.15" rel="nofollow">this old forum post</a>.</p>

<p>It is <code>Serial1</code> not <code>Serial</code>.
In the Arduino code in the Yun <code>Serial</code> is a different object from <code>Serial1</code>. 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 <code>Serial1</code>:</p>

<p><a href="https://www.arduino.cc/en/Tutorial/YunSerialTerminal" rel="nofollow">https://www.arduino.cc/en/Tutorial/YunSerialTerminal</a>
<a href="http://andrea-toscano.com/arduino-yun-tcpip-to-serial1-redirect/" rel="nofollow">http://andrea-toscano.com/arduino-yun-tcpip-to-serial1-redirect/</a>
<a href="http://crossbar.io/iotcookbook/Arduino-Yun-Disable-Bridge/" rel="nofollow">http://crossbar.io/iotcookbook/Arduino-Yun-Disable-Bridge/</a></p>
