Intel® Makers
Intel® Edison, Intel® Joule™, Intel® Curie™, Intel® Galileo
Announcements
Welcome - This is a Peer-to-Peer Forum only. Intel has discontinued these products but you may find support from other customers on this Forum
9872 Discussions

SerialPort on Galileo-io

VOrti
Beginner
979 Views

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);

});

});

1 Solution
idata
Community Manager
123 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
124 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.
Reply