Skip to content
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

brickpi-raspberry install fails due to outdated serialport dependency #3

Open
RickBullotta opened this issue Dec 8, 2016 · 6 comments

Comments

@RickBullotta
Copy link
Contributor

It seems to be based on an ancient version of serialport. Can we get it updated ASAP?

npmoutput.txt

@RickBullotta
Copy link
Contributor Author

I tested with serialport 4.0.6 and async 2.1.4, and updated a number of the source files to address a major bug with sensor setup and to add some additional capabilities (new events on sensors, a couple other minor tweaks). Should I create a pull request?

@codeofsumit
Copy link

codeofsumit commented Mar 12, 2017

@RickBullotta do you mind helping me out on this? I'm having the same issue. The first errors appearing during install are these:

node-pre-gyp ERR! Tried to download(404): https://node-serialport.s3.amazonaws.com/serialport/v1.6.3/Release/node-v51-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v51 ABI) (falling back to source compile with node-gyp)

@RickBullotta
Copy link
Contributor Author

RickBullotta commented Mar 12, 2017 via email

@RickBullotta
Copy link
Contributor Author

RickBullotta commented Mar 12, 2017 via email

@codeofsumit
Copy link

@RickBullotta thank you!
FYI: I installed serialport and node-gyp manually, now I was able to install the library with an updated serialport version (forked it and changed the package.json).
Install works but I was not yet able to move any motor. The setup() function errors in a timeout.

Have you eventually been able to control lego motors via nodeJS using this library?

@ppinto
Copy link

ppinto commented Jul 9, 2017

@codeofsumit - I was able to get the motors to move with the updated version you created and pulled from your repository to get around the node-gyp and serialport errors. I have been testing as a function inside a node red flow. I get these errors after the robot moves ones in one direction.
timed out
rx Timeout
checksum failed...

here is the main function that I am calling
var brickpi = global.get('BrickPi');
var robot = new brickpi.BrickPi();

var newMsg = { payload: msg.payload.trim() };
var myMsg=newMsg.payload.split(",");

var motorB = new brickpi.Motor({port: brickpi.PORTS.MB, name: 'motorB'});
var motorC = new brickpi.Motor({port: brickpi.PORTS.MC, name: 'motorC'});

robot.addMotor(motorB).addMotor(motorC).setup();

robot.on('ready', function() {
motorB.resetPosition();
motorC.resetPosition();
robot.run();
});

if (myMsg[0] == "move")
{
switch (myMsg[1]) {
case "fwd":
robot.on('ready', function() {
motorB.resetPosition();
motorC.resetPosition();
robot.run();

                motorB.start(150).moveTo(1000, function(err) {
                 // called when motorA has reached 5000 ticks (2500 degrees in rotation).
                 });
                 
                motorC.start(150).moveTo(1000, function(err) {

                 // called when motorA has reached 5000 ticks (2500 degrees in rotation).
                });
                });
                break;         
        case "bkwd":
                robot.on('ready', function() {
                motorB.resetPosition();
                motorC.resetPosition();
                robot.run();

                motorB.start(150).moveTo(-1000, function(err) {
                 // called when motorA has reached 5000 ticks (2500 degrees in rotation).
                 });
                motorC.start(150).moveTo(-1000, function(err) {

                 // called when motorA has reached 5000 ticks (2500 degrees in rotation).
                });
                });
                break;         
        case "left":
                robot.on('ready', function() {
                motorB.resetPosition();
                motorC.resetPosition();
                robot.run();
                motorB.start(150).moveTo(1000, function(err) {
                 // called when motorA has reached 5000 ticks (2500 degrees in rotation).
                 });
                motorC.start(150).moveTo(-1000, function(err) {

                 // called when motorA has reached 5000 ticks (2500 degrees in rotation).
                });
                });
                break;         
        case "right":
                robot.on('ready', function() {
                motorB.resetPosition();
                motorC.resetPosition();
                robot.run();
                motorB.start(150).moveTo(-1000, function(err) {
                 // called when motorA has reached 5000 ticks (2500 degrees in rotation).
                 });
                motorC.start(150).moveTo(1000, function(err) {

                 // called when motorA has reached 5000 ticks (2500 degrees in rotation).
                });
                });
                break;         

    }

}

console.log('Motor '+ mymsg[0]+' '+myMsg[1] );

setTimeout(function() {
robot.stop();
}, 10000);

return msg;

Thanks -Phil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants