Hi All,

I'm using Node-Red on a BBB and want to do some serial messaging. I am 
using a  node-red function block calling Octalbonescript ( 
https://github.com/theoctal/octalbonescript/wiki/Serial-Port)  to do a 
serial write function this works okay (i.e. sends data out of the serial 
port)


*var b = context.global.octalbonescript;*

*b.serial.open('/dev/ttyO2', {baudRate: 115200}, function(data){*
*  console.log(data);*
*}, function(err){*
*  if(err){*
*    console.error(err.message);*
*  }*
*});*

*var path='/dev/ttyO2';*

*//msg.payload is passed from the previous block as "hello World"*
*var buffer = msg.payload +'\r';*

*b.serial.write(path, buffer);*

*return msg;*

Now, I want to try and get the serial read working, but I don't fully 
understand the operation and wondered if anyone can help (an example would 
be tops).  The documentation defines the serial.open as:
serial.open(path, options, handler[data], callback[err|null, serialPort])
 so I take it that the incoming serial data is passed into the 
handler[data]. Do I need to keep calling this function to check for any 
data or do I just do it once and it gets handled in the background??

Best regards 

Michael


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/d7292d61-e9cb-4a37-b7db-3dba553e708c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to