Community
cancel
Showing results for 
Search instead for 
Did you mean: 
VOrti
Beginner
893 Views

SerialPort on Galileo-io

Jump to solution

Hi, im using johnny-five with galileo-io in a galileo gen 2 running yocto, i am trying to set a serial communication with SerialPort module, but i am getting the error: "Illegal instruction"

The code:

var Serialport = require("serialport").SerialPort;

var five = require("johnny-five");

var Galileo = require("galileo-io");

var board = new Galileo();

board.on("ready", function() {

var sp = new Serialport("/dev/ttyS0", { baudRate: 57600 });

sp.on("open", function() {

console.log("Port is open!"); // Once the port is open, you may read or write to it.

sp.on("data", function(data) {

console.log("Received: ", data);

});

setInterval(function(){

sp.write(new Buffer(["0120000003"])) }, 5000);

});

});


Accepted Solutions
idata
Community Manager
37 Views

Hello ortizvinicius,

 

 

According to http://johnny-five.io/platform-support/# intel-galileo-gen-2 http://johnny-five.io/platform-support/# intel-galileo-gen-2, Johnny-five does not support Galileo's UART interface.

 

 

However, if you would like to interact with Galileo's interfaces, I'd suggest you to use mraa, this library has a lot more support for Galileo's interfaces. You can find more information about this library in https://github.com/intel-iot-devkit/mraa https://github.com/intel-iot-devkit/mraa.

 

 

Peter.

View solution in original post

1 Reply
idata
Community Manager
38 Views

Hello ortizvinicius,

 

 

According to http://johnny-five.io/platform-support/# intel-galileo-gen-2 http://johnny-five.io/platform-support/# intel-galileo-gen-2, Johnny-five does not support Galileo's UART interface.

 

 

However, if you would like to interact with Galileo's interfaces, I'd suggest you to use mraa, this library has a lot more support for Galileo's interfaces. You can find more information about this library in https://github.com/intel-iot-devkit/mraa https://github.com/intel-iot-devkit/mraa.

 

 

Peter.

View solution in original post