Problem writing to ttyO1

Hello all;

I seem to be having a problem writing to ttyO1.

Here is the really simple code and the result on the console:

Code:

var data

var serialPort, sp;

var serialPort = require(“serialport”).SerialPort;

var sp = new serialPort("/dev/ttyO1", { baudrate: 9600 });

sp.on(“open”,function(){

console.log(“Hello World the Comm Port is Open”);

});

function sp_write(data){

sp.write(data,function(err, results) {

console.log('err ’ + err + ’ What happened? ’ + results);

});

}

togglepin();

function togglepin(){

// High and low parts of the frame length (not counting checksum)

sp_write("Hello Again):

//sp_write(0x0);

//sp_write(0x10);

}

And here is the console Output:

Error: Serialport not open. What happened? undefined

Hello World the Comm Port is Open

Anyone got any ideas ??

Bill

“No one could make a greater mistake than he who did nothing because he could do only a little.”

“All that is necessary for the triumph of evil is that good men do nothing” Edmond Burke (1729 - 1797)

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book