-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SerialPort on Galileo-io #1086
Comments
There are a couple issues with this code, let me help clarify some parts for you: var Serialport = require("serialport").SerialPort;
var five = require("johnny-five");
var Galileo = require("galileo-io");
var board = new five.Board({
io: 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);
});
}); Note the changes to Another issue is the call to Can you try the updated code and let me know what happens? Thanks! |
Same result:
About new Buffer(["0120000003"]) Im trying to write the string "0120000003", the correct way is new Buffer("0120000003") ? |
@ortizvinicius that depends, are you trying to send the string of characters "0120000003"? Or series of bytes that is comprised of those values?
|
string of characters |
Got it—then give that a try :) |
both have the same result :/ |
Can you paste the entire output? Then, try just this: var Serialport = require("serialport").SerialPort;
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);
});
sp.write(new Buffer("0120000003"));
}); And paste the result as well |
For the first the output is:
For the last is just illegal instruction |
Ok, so that means this bug isn't in Johnny-Five or Galileo-IO. Let's keep narrowing it down... try this: var Serialport = require("serialport").SerialPort;
var sp = new Serialport("/dev/ttyS0", {
baudRate: 57600
}); (and nothing else) |
illegal instruction |
with this last code i got illegal instruction too |
It looks like there is something wrong with binaries somewhere. Perhaps Node.js binaries or serialport binaries. |
@ortizvinicius thanks for your patience, one last thing to try before we talk about refiling this over at node-serialport. Try: var Serialport = require("serialport").SerialPort;
var sp = new Serialport("/dev/ttyS0"); Then: var Serialport = require("serialport").SerialPort; Then, at the terminal, type:
|
Thank you. Well, the first shows illegal instruction, the second shows nothing, and the last says only "true" |
This is very helpful, let's first ping @reconbot and have him read up on the thread and then help us figure out the move forward |
I dont know if it can help but have you tried to run as root access with |
@henricavalcante sudo dont work in yocto |
Can you try something for me?
And give the output? Also what version of yocto are you running on the Galileo? |
@reconbot is it possible that it's happening because pre-compiled serialport binaries are being installed but that the binaries don't or can't work on a Galileo? Is it possible to somehow force serialport to be compiled rather than have pre-compiled binaries installed when |
Hi @reconbot the code outputs only "Illegal Instruction" I'm not sure of how to see the version haha, but i think is 201409031130 |
As far as I can tell this is exactly the problem. When I was telling @reconbot about this (he's about 3 feet away from me), I remembered when I wrote this, I was unable to use Serialport and ended up using |
@ortizvinicius Now, please try the latest beta version of serialport, we've recently made some changes and it would be helpful to know if they change anything for you. See serialport/node-serialport#733 for more details.
@fivdi we don't yet have precompiled arm binaries so I don't think that would be the case, but the binary does seem to be compiled with unsupported cpu instructions. |
Instaled the beta and the outputs is illegal instruction again |
Alright, lets move this to the right project. Please open a new issue on node-seriaport and we'll debug there. I have a galileo at home that might still work. I know for sure we work on an edison, but you might have to do some tricks to get it to use the older system. |
The Galileo 2 is from Intel so it's not going to have an ARM processor!!! It has an Intel Quark SoC X1000 processor which supports the Pentium instruction set. I'm unsure how compatible this processor is with the processors in PCs but would imagine that the serialport install process detects it as an Intel processor and installs pre-compiled Intel binaries. |
Ahh good point! That's a mistake on my part. We should still move the issue over to the right project, but Did the rebuild work? |
I haven't tried yet. I haven't used a Galileo 2 since sometime early last year but will take a look and see. |
Moved to serialport/node-serialport#747 |
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:
The text was updated successfully, but these errors were encountered: