1 Reply Latest reply on Apr 8, 2016 1:06 PM by Intel Corporation

    SerialPort on Galileo-io

    ortizvinicius

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

      });

      });