EzDevInfo.com

johnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup. Based on Arduino Firmata Protocol Johnny-Five: The JavaScript Robotics Programming Framework johnny-five is the javascript robotics programming framework

arduino wifi with cylon.js or johnny5.js

Do you know if is possibile to implement a wifi connection through Arduino one wifi modules using one of these javascript firmata (Cylon or Johnny5)?

Reading the guidelines of these frameworks I didn't find any information about this.

Thanks a lot.


Source: (StackOverflow)

Use external C++ library with Johnny Five for Arduino based projects

I need to use the RFID-RC522 module in my Johnny Five project (it is an NFC reader).

There is an arduino Library that makes it easy to interface with that: https://github.com/miguelbalboa/rfid

Can i use this library through Johnny-Five? If yes, how?


Source: (StackOverflow)

Advertisements

Johnny Five: board not ready

I've previously had my Arduino kit working on the same hardware with Breakout, but would like to switch to Johnny Five. My hardware is wired with the simple single LED layout from http://weblog.bocoup.com/javascript-arduino-programming-with-nodejs/ but running the basic LED strobing demo isn't working as expected:

var five = require("johnny-five"),
    board, led;

board = new five.Board();

board.on("ready", function() {
  console.log('ready');
  led = new five.Led(13);
  led.strobe(100);
});

Returns:

1341154189666 Board Connecting... 
1341154189697 Serial Found possible serial port cu.usbmodem621
1341154189699 Board -> Serialport connected cu.usbmodem621
1341154191570 Repl Successfully Connected 

I end up straight in the Firmata REPL with no LED strobing, and board.ready is false.

Any suggestions for why the board.ready callback wouldn't be firing?


Source: (StackOverflow)

The relationship between Firmata, Arduino and Node js

This is a basic question of understanding. I'm trying to follow this explanation http://www.barryvandam.com/node-js-communicating-with-arduino/ but something there sounds a bit off to me.

As far as I understood before, I only need to push the standard Firmata code into the Arduino and code via Node.js to call actions and information from the Arduino. But in this link they point our that I need to upload a code to the Arduino, which will obviously delete the Firmata code that is now there. wouldn't it result in loosing connection to the Arduino?

How does it work?

many thanks!


Source: (StackOverflow)

firmatajs, multiple Arduinos give timeout (johnny-five, cylonjs)

I have two Arduino unos flashed with the standard StandardFirmata and i'm trying the multi board demo with a simple node project (johnny-five npm package). Both arduinos work when I try them separately. with the following code:

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

var boardOne = new five.Board({ id: "A", port: "/dev/cu.usbmodem1d1141" });
boardOne.on("ready", function(){
    var led = new five.Led({
    pin: 13,
    board: this
    });
    led.on();
});

node index.js 
1418288836782 Connected /dev/cu.usbmodem1d1141 
1418288836784 Repl Initialized 
>> 

When trying the multi board example I get: Device or Firmware Error A timeout occurred while connecting to the Board. Please check that you've properly flashed the board with the correct firmware.

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

var ports = [
    { id: "A", port: "/dev/cu.usbmodem1d1141" },
    { id: "B", port: "/dev/cu.usbmodem1d1131" }
];

new five.Boards(ports).on("ready", function(){
    var led = new five.Led({
        pin: 13,
        board: this[0]
    });
    led.on();
});


Update #1:

Out of curiosity I tried to switch around the usb cables and got some different results:

1) Only one arduino seems to connect:

1418318698635 Device(s) /dev/cu.usbmodem1a1231,/dev/cu.usbmodem1a1241 
1418318698642 Device(s) /dev/cu.usbmodem1a1241 
1418318701849 Connected /dev/cu.usbmodem1a1231 
1418318701850 Board ID:  A 

or 2) I get an error:

.../johnny-five-master/node_modules/firmata/lib/firmata.js:246
board.pins[pin].analogChannel = currentValue;
                              ^
TypeError: Cannot set property 'analogChannel' of undefined
at Object.SYSEX_RESPONSE.(anonymous function) [as 106] 
(.../johnny-five-master/node_modules/firmata/lib/firmata.js:246:35)


Update #2:

I did the above test with cylon.js and got the same results. Still no clue how to fix this :( One arduino works fine, multiple do nothing. (Maybe an osx related problem?)

Update #3:

I added some logs in the johnny-five code and it's definitely a connection problem(I think!?). The second Arduino never responds. I switched the order of the arduinos and get the same result (first one connects, the other fails to respond). The connection is asynchronous, so maybe it gets blocked somewhere. The lights on both arduinos definitely show some action is going on.

node index.js
err: undefined --- type: connect --- io: /dev/tty.usbmodem1d1111
err: undefined --- type: connect --- io: /dev/tty.usbmodem1d1121
err: undefined --- type: ready --- io: /dev/tty.usbmodem1d1111
1418467187527 Connected /dev/tty.usbmodem1d1111 
1418467187527 Board ID:  A 
1418467284327 Device or Firmware Error A timeout occurred while connecting to the Board. 
Please check that you've properly flashed the board with the correct firmware.

Source: (StackOverflow)

Node.js - installing johnny five library on windows

I'm trying to install the johnny five library for Node.js on windows 7 but keep getting an error:

Your environment has been set up for using Node.js 0.10.15 (x64) and npm.

C:\Users\User>npm install johnny-five
npm http GET https://registry.npmjs.org/johnny-five
npm http 304 https://registry.npmjs.org/johnny-five
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/firmata
npm http GET https://registry.npmjs.org/es6-collections
npm http GET https://registry.npmjs.org/descriptor
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/compulsive
npm http GET https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/temporal
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/firmata
npm http 304 https://registry.npmjs.org/es6-collections
npm http 304 https://registry.npmjs.org/descriptor
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/compulsive
npm http 304 https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/temporal
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/socket.io-client/0.9.16
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/policyfile/0.0.4
npm http GET https://registry.npmjs.org/redis/0.7.3
npm http GET https://registry.npmjs.org/bindings/1.1.0
npm http GET https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/sf/0.1.6
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/policyfile/0.0.4
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http 304 https://registry.npmjs.org/redis/0.7.3
npm http 304 https://registry.npmjs.org/socket.io-client/0.9.16
npm http GET https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.
16.tgz
npm http 304 https://registry.npmjs.org/bindings/1.1.0
npm http 304 https://registry.npmjs.org/async/0.1.18
npm http 304 https://registry.npmjs.org/sf/0.1.6

> serialport@1.1.3 install C:\Users\User\node_modules\johnny-five\node_modules
\serialport
> node-gyp rebuild


C:\Users\User\node_modules\johnny-five\node_modules\serialport>node "C:\Progra
m Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bi
n\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Command failed: ImportError: No module named site
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:637:15)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at maybeClose (child_process.js:735:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:802:
5)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\node_modules\johnny-five\node_modules\serialport
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm http 200 https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.
16.tgz
npm ERR! not ok code 0

I had the same problem on mac, but solved it by installing xcode command line components as suggested in a previous post, but don't know how to solve this for windows.

Thanks for any help!


Source: (StackOverflow)

Refreshing the frame coming from the Leap Motion when in a while loop

I have just begun programming in JS for the Leap Motion. I am working on a project where I can control motors based on hand gestures that are being read from the Leap Motion. The frames are being parsed and then commands are being sent to the motors through an Arduino Uno using the johnny-five library. Here is the way I am grabbing the frames from the Leap Motion:

`var five = require('johnny-five'),
Leap = require('leapjs'),
board = new five.Board(),
motor, frame, hand;

board.on('ready', function() 
{   
    var controller = Leap.loop({enableGestures: true}, function(frame) 
    {   
        checkData(frame);
    });
});`

I take the frames from the Leap Motion and send the frame to a function that goes through the frame, reads the gestures, and then calls a new function that controls motors:

    var motorA = new five.Motor([3, 0, 2]);

    motorA.start(255);  

    while(!finished)
    {
        board.wait(5000, function()
        {
            motorA.stop();
            runMotorB(number);
            finsihed = true;
        });
    }

My problem is that I need a while loop to make the program wait for the first motor to end before running the next motor. The board.wait() doesn't seem to stop the program from continuing on to the next motor without waiting for the first motor to stop. I also need to be able to grab frames from the Leap Motion while running the motor in the while loop and waiting for it to end. This is because I want to be able to see if new gestures are occurring while the motor is running. However, whenever I try to grab a new frame using a controller.frame() call, I simply get the previous frame from the Leap Motion that started the while loop, not the frame that the Leap Motion is seeing at that second. Is there a way to see what the Leap Motion is seeing while stuck within the while loop? Or is there a better way for me to be stopping the program from moving onto the next motor without actually waiting?


Source: (StackOverflow)

Serialport Node Errors on Beaglebone (ARM)

I'm trying to run a Node Arduino library [https://github.com/rwldrn/johnny-five] on a Beaglebone running Ubuntu 12.04. However, when ever I try run an example program (servo.js, or any other) the console spits out:

/home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/node_modules/bindings/bindings.js:91
  throw err
        ^
Error: Could not locate the bindings file. Tried:
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build/Debug/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build/Release/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/out/Debug/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/Debug/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/out/Release/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/Release/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/build/default/serialport.node
 → /home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/compiled/0.8.15/linux/arm/serialport.node
    at bindings (/home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/home/rov/node_modules/johnny-five/node_modules/firmata/node_modules/serialport/serialport.js:7:44)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/home/rov/node_modules/johnny-five/node_modules/firmata/lib/firmata.js:9:18)
    at Module._compile (module.js:449:26)

I've tried installing serialport through npm (npm install serialport) and I still get the same error. How do I install serialport so that it can be recognized by the servo.js file?


Source: (StackOverflow)

Twitter Streaming api shows several duplicates tweets

I am blink an led every time there is a new tweet. My script was working fine till yesterday. Today when i run my script its showing me duplicates tweets like this.

Twitter Streaming api shows duplicate tweets

I am using node.js ,twitter api and johnny-five

Here is my script

//INITIALIZING TWITTER API
var Twitter = require('twitter');

var client = new Twitter({
    consumer_key: 'asdf',
    consumer_secret: 'asdf',
    access_token_key: 'asdf',
    access_token_secret: 'asdf'
});

//INITIALIZING JOHNNY-FIVE API
 var five = require("johnny-five"),
    // or "./lib/johnny-five" when running from the source
    board = new five.Board();

board.on("ready", function() {
//INITIALIZE PINS 
    var red = new five.Led(2);
    var yellow = new five.Led(5);
    var green = new five.Led(8);
    red.on();
//TURN OFF LED  
    yellow.stop();yellow.off();
    green.stop();green.off();       

    client.stream('statuses/filter', {track: '#f8'}, function(stream) {
    stream.on('data', function(tweet) {
    console.log("\n"+tweet.text);
    red.stop();red.off();
    yellow.blink(100);
    board.wait(400,function(){
        yellow.stop();yellow.off();
        red.on();
    }); 
    });
    stream.on('error', function(error) {
    throw error;
    });
});
});

In this script there are three led declared red one indicates there are no tweets at the moment and yellow led blinks every time there is a new tweet and the green one is just sitting there doing nothing(I was planning to add more logic to my script with green led).

One more thing i noticed is that duplicates tweets are occurring with trending hashtags like #f8 and others. i used hashtags which are not trending and i was working fine.


Source: (StackOverflow)

Parallax RFID and Johnny-Five

I have a parallax RFID reader and I am confused on where to start when using johnny-five with it. I am trying to use this as guidance - http://www.gumbolabs.org/2009/10/17/parallax-rfid-reader-arduino/ - but obviously that does not use johnny-five.

I don't know if I should be starting with a johnny-five object to read the data and interact with the sensor, or if I should skip that and be using serialport directly. If I use serialport how exactly do I do that?

https://github.com/RyanHirsch/j5-rfid

Output:

1381834286406 Board Connecting... 
1381834286421 Serial Found possible serial port /dev/cu.usbmodemfa141
1381834286422 Board -> Serialport connected /dev/cu.usbmodemfa141
open
err undefined
results 3

Code:

var sp = new SerialPort("/dev/cu.usbmodemfa141", {
  parser: serialport.parsers.readline("\r") ,
  baudrate: 2400
}, false);

sp.open(function () {
  console.log('open');
  sp.on('data', function(data) {
    console.log('data received: ' + data);
  });
  sp.write("ls\n", function(err, results) {
    console.log('err ' + err);
    console.log('results ' + results);
  });
});

Source: (StackOverflow)

Johnny-Five apps always fail with RangeError after less than 1 second

My Johnny-Five apps are all failing after less than 1 second. I've tried with 0.7.9 and 0.7.8. This is the error I'm seeing:

ytham:[master]~/js/deltarobot$ node .
1386668719984 Board Connecting... 
1386668719986 Board -> Serialport connected /dev/cu.usbmodem1421
1386668723299 Board <- Serialport connected /dev/cu.usbmodem1421
1386668723299 Repl Initialized 
>> 1386668723348 Board  

string_decoder.js:109
  charStr += buffer.toString(this.encoding, 0, end);
                    ^
RangeError: toString() radix argument must be between 2 and 36
    at Number.toString (native)
    at StringDecoder.write (string_decoder.js:109:21)
    at ReadStream.onData (readline.js:839:39)
    at ReadStream.EventEmitter.emit (events.js:95:17)
    at Board.<anonymous> (/Users/ytham/js/deltarobot/node_modules/johnny-five/lib/board.js:305:27)
    at Board.<anonymous> (/Users/ytham/js/deltarobot/node_modules/johnny-five/lib/board.js:124:18)
    at SerialPort.<anonymous> (/Users/ytham/js/deltarobot/node_modules/johnny-five/node_modules/firmata/lib/firmata.js:402:13)
    at SerialPort.EventEmitter.emit (events.js:95:17)
    at afterRead (/Users/ytham/js/deltarobot/node_modules/johnny-five/node_modules/serialport/serialport.js:303:18)
    at /Users/ytham/js/deltarobot/node_modules/johnny-five/node_modules/serialport/serialport.js:342:9

With 0.7.2 it does not give me this error, however I am unable to move my servos. I'm seeing this issue happen with all of the Servo examples from the Johnny-Five readme as well. I'm also ruling out a hardware issue because it has given me the same problem on 3 different servos. Also, I only see the issue when the servo is plugged in to the 5V and not the 3.3V, which is very odd. Node.js is also the latest (0.10.22).

I've tried 2 different Arduino Uno boards and 2 different laptops (both running OSX 10.9) as well, and I see the exact same issue on everything.


Source: (StackOverflow)

Multiple Arduino Boards using Johnny five

I am programming arduino boards in javascript. I am trying to connect multiple arduino boards using the johnny-five library. I followed the johnny-five documentation and I can strobe the led 13 on both boards at once.

However my issue is I want to control leds one at a time. How can I specifically initialise LEDs on each board?


Source: (StackOverflow)

Johnny-Five multiple Arduinos connecting, but not emitting "ready"

I'm having a little difficulty with johnny-five (Multiple Boards) ; can anyone shed some light on this for me?

I have 2 Arduinos connected and I can access them individually perfectly fine with the "var board = new five.Board()".

I can successfully connect and use them both with Cylon.js.

However, when I attempt to utilize the "new five.Boards()" it never seems emit a "ready" event so I can start coding my logic.

Using (slightly modified) johnny-five/eg/boards-multi.js

var five = require("../lib/johnny-five.js");
var boards = new five.Boards(["A", "B"]);

// Create 2 board instances with IDs "A" & "B"
boards.on("ready", function() {

  // Both "A" and "B" are initialized
  // (connected and available for communication)

  // |this| is an array-like object containing references
  // to each initialized board.
  this.each(function(board) {

    console.log("READY"); // NOTE: this never executes

    // Initialize an Led instance on pin 13 of
    // each initialized board and strobe it.
    var led = new five.Led({
      pin: 13,
      board: board
    });

    led.blink();
  });
});

My console shows:

1437253899028 Device(s) /dev/ttyACM1,/dev/ttyACM0
1437253899104 Connected /dev/ttyACM1
1437253899121 Device(s) /dev/ttyACM0
1437253899126 Connected /dev/ttyACM0
1437253901860 Board ID:  A
1437253901862 Board ID:  B

...and I wait forever and it never emits "ready"...

Note 1: I have re-uploaded the latest "StandardFirmata" on both of them several times; and they work just fine on their own.

Note 2: I have tried the exact same setup on 3 different systems (one ubuntu linux, one on Windows, and one of Raspberry PI 2B) same problem on all...

I'm not sure if I am missing something boneheaded here; however no matter what I try johnny-five just wont allow me to proceed. As I mentioned above, it seems to work perfectly with Cylon-- however, I'd rather use j5 as I've got quite a bit of code already in place I'd rather not port over to Cylon just to connect more than one Arduino to my system.

Any help would be greatly appreciated!

Update #1:

I am getting a little closer, I can address each Arduino board now. However; I am still stumped on how to properly catch the "ready" event.

var five = require('johnny-five');
var ports = [
  { id: "A", port: "/dev/ttyACM0" },
  { id: "B", port: "/dev/ttyACM1" }
];

var boards = new five.Boards(ports).on('ready', function() {
  // does nothing?
  console.log("THIS SHOULD TRIGGER");
});

// Waiting 5 seconds for the boards to init, instead of "ready" event.
setTimeout( function() {
  console.log(boards[0].isReady);
  console.log(boards[1].isReady);
}, 5000);

This ends up with the console output of:

1437268012413 Connected /dev/ttyACM0
1437268012427 Connected /dev/ttyACM1
1437268015161 Board ID:  A
1437268015163 Board ID:  B
true
true

....at this point, I can do the following to address the boards (within the setTimeout() of course):

  var led1 = new five.Led( {
    pin: 6,
    board: boards[0]
  });
  led1.on();
  var led2 = new five.Led( {
    pin: 4,
    board: boards[1]
  });
  led2.on();

Still attempting to determine why I cannot catch the elusive "ready".

Update #2:

Looks like I figured it out. It was in fact emitting ready, however I wasn't utilizing the API correctly.

Working Code:

new five.Boards(ports).on('ready', function( boards ) {
  console.log( boards );  // ready emits
});

Update #3:

I think I found a bug in the library.

It seems that the following file:

node_modules/johnny-five/lib/board.js

line: 1109

If you change:

if (this.repl) 
to
if (false && this.repl)

It seems to emit the "ready" event.


Source: (StackOverflow)

Can't install latest package version from npm

I'm trying to install https://www.npmjs.org/package/galileo-io via npm, and it keeps on installing 0.3.10 instead of 0.4.0, which is the latest version.

Here's a screenshot when I try to force it to install 0.4.0

http://i.imgur.com/M2GxujN.jpg

BTW, I'm running Yocto Linux on an Intel Edison


Source: (StackOverflow)

Cannot rebuild serialport with node-pre-gyp: 404 status code downloading 64-bit nw.lib

I am trying to use johnny-five with node-webkit, so I have to rebuild it using node-pre-gyp. I have node-pre-gyp and nw-gyp installed globally. I am running on windows 7 64 bit and have the 32 bit version of node 0.10.32 and the 32 bit version of Python 2.7.3 installeds along with Visual Studio 2012; they are both in the system path.

When I run npm install johnny-five --runtime=node-webkit --target=0.8.6 I get the following error message:

> serialport@1.4.6 install C:\Users\ANTON_LAPTOP\Documents\Programming Projects\ROV\node_
modules\johnny-five\node_modules\serialport
> node-pre-gyp install --fallback-to-build

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: 404 status code downloading 64-bit nw.lib
gyp ERR! stack     at Request.<anonymous> (C:\Users\ANTON_LAPTOP\AppData\Roaming\npm\node
_modules\nw-gyp\lib\install.js:317:20)
gyp ERR! stack     at Request.emit (events.js:117:20)
gyp ERR! stack     at Request.onRequestResponse (C:\Users\ANTON_LAPTOP\AppData\Roaming\np
m\node_modules\nw-gyp\node_modules\request\request.js:1247:10)
gyp ERR! stack     at ClientRequest.emit (events.js:95:17)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (http.js:1692:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:
121:23)
gyp ERR! stack     at Socket.socketOnData (http.js:1587:20)
gyp ERR! stack     at TCP.onread (net.js:527:27)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Users\\ANTON_LAPTOP\\AppData\\Roaming\\npm\\node_modules\\nw
-gyp\\bin\\nw-gyp.js" "rebuild" "--name=serialport" "--configuration=Release" "--module_n
ame=serialport" "--version=1.4.6" "--major=1" "--minor=4" "--patch=6" "--runtime=node-web
kit" "--node_abi=node-webkit-v11" "--target=0.8.6" "--platform=win32" "--target_platform=
win32" "--arch=ia32" "--target_arch=ia32" "--module_main=./serialport" "--host=https://no
de-serialport.s3.amazonaws.com/" "--module_path=C:\\Users\\ANTON_LAPTOP\\Documents\\Progr
amming Projects\\ROV\\node_modules\\johnny-five\\node_modules\\serialport\\build\\serialp
ort\\v1.4.6\\Release\\node-webkit-v11-win32-ia32" "--remote_path=./serialport/v1.4.6/Rele
ase/" "--package_name=node-webkit-v11-win32-ia32.tar.gz" "--staged_tarball=build\\stage\\
serialport\\v1.4.6\\Release\\node-webkit-v11-win32-ia32.tar.gz" "--hosted_path=https://no
de-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/" "--hosted_tarball=https://node
-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/node-webkit-v11-win32-ia32.tar.gz"

gyp ERR! cwd C:\Users\ANTON_LAPTOP\Documents\Programming Projects\ROV\node_modules\johnny
-five\node_modules\serialport
gyp ERR! node -v v0.10.32
gyp ERR! nw-gyp -v v0.12.3
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'nw-gyp.cmd rebuild --name=serialport --
configuration=Release --module_name=serialport --version=1.4.6 --major=1 --minor=4 --patc
h=6 --runtime=node-webkit --node_abi=node-webkit-v11 --target=0.8.6 --platform=win32 --ta
rget_platform=win32 --arch=ia32 --target_arch=ia32 --module_main=./serialport --host=http
s://node-serialport.s3.amazonaws.com/ --module_path=C:\Users\ANTON_LAPTOP\Documents\Progr
amming Projects\ROV\node_modules\johnny-five\node_modules\serialport\build\serialport\v1.
4.6\Release\node-webkit-v11-win32-ia32 --remote_path=./serialport/v1.4.6/Release/ --packa
ge_name=node-webkit-v11-win32-ia32.tar.gz --staged_tarball=build\stage\serialport\v1.4.6\
Release\node-webkit-v11-win32-ia32.tar.gz --hosted_path=https://node-serialport.s3.amazon
aws.com/serialport/v1.4.6/Release/ --hosted_tarball=https://node-serialport.s3.amazonaws.
com/serialport/v1.4.6/Release/node-webkit-v11-win32-ia32.tar.gz' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\ANTON_LAPTOP\Documents\
Programming Projects\ROV\node_modules\johnny-five\node_modules\serialport\node_modules\no
de-pre-gyp\lib\util\compile.js:76:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack     at maybeClose (child_process.js:756:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:823:
5)
node-pre-gyp ERR! System Windows_NT 6.1.7601
node-pre-gyp ERR! command "node" "C:\\Users\\ANTON_LAPTOP\\Documents\\Programming Project
s\\ROV\\node_modules\\johnny-five\\node_modules\\serialport\\node_modules\\node-pre-gyp\\
bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\ANTON_LAPTOP\Documents\Programming Projects\ROV\node_modul
es\johnny-five\node_modules\serialport
node-pre-gyp ERR! node -v v0.10.32
node-pre-gyp ERR! node-pre-gyp -v v0.5.19
node-pre-gyp ERR! not ok
Failed to execute 'nw-gyp.cmd rebuild --name=serialport --configuration=Release --module_
name=serialport --version=1.4.6 --major=1 --minor=4 --patch=6 --runtime=node-webkit --nod
e_abi=node-webkit-v11 --target=0.8.6 --platform=win32 --target_platform=win32 --arch=ia32
 --target_arch=ia32 --module_main=./serialport --host=https://node-serialport.s3.amazonaw
s.com/ --module_path=C:\Users\ANTON_LAPTOP\Documents\Programming Projects\ROV\node_module
s\johnny-five\node_modules\serialport\build\serialport\v1.4.6\Release\node-webkit-v11-win
32-ia32 --remote_path=./serialport/v1.4.6/Release/ --package_name=node-webkit-v11-win32-i
a32.tar.gz --staged_tarball=build\stage\serialport\v1.4.6\Release\node-webkit-v11-win32-i
a32.tar.gz --hosted_path=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Relea
se/ --hosted_tarball=https://node-serialport.s3.amazonaws.com/serialport/v1.4.6/Release/n
ode-webkit-v11-win32-ia32.tar.gz' (1)
npm WARN optional dep failed, continuing serialport@1.4.6
johnny-five@0.8.19 node_modules\johnny-five
├── ease-component@1.0.0
├── descriptor@0.1.0
├── temporal@0.3.8
├── colors@1.0.3
├── es6-shim@0.20.0
├── nanotimer@0.3.1
├── firmata@0.3.3 (browser-serialport@1.0.6)
├── lodash@2.4.1
└── galileo-io@0.3.9 (graceful-fs@2.0.3, es6-promise@2.0.0, remapped@0.2.1)

I have tried running the process with the --target_arch=ia32 but that had no effect. I have also tried this on 64 bit node and python with no change. I would really appreciate any help!


Source: (StackOverflow)