hybridgroup / cylon-firmata

Cylon adaptor for the Firmata protocol
http://cylonjs.com
Other
45 stars 10 forks source link

Error installing on Mac OSX #9

Closed ghendricks closed 10 years ago

ghendricks commented 10 years ago

I am trying to install on Mac OSX Mountain Lion but I am getting the following:

[gregaryh@lapras ~]$ npm install cylon-firmata
npm http GET https://registry.npmjs.org/cylon-firmata
npm http 200 https://registry.npmjs.org/cylon-firmata
npm http GET https://registry.npmjs.org/cylon-firmata/-/cylon-firmata-0.7.0.tgz
npm http 200 https://registry.npmjs.org/cylon-firmata/-/cylon-firmata-0.7.0.tgz
npm http GET https://registry.npmjs.org/firmata
npm http GET https://registry.npmjs.org/node-namespace
npm http 304 https://registry.npmjs.org/node-namespace
npm http 200 https://registry.npmjs.org/firmata
npm http GET https://registry.npmjs.org/firmata/-/firmata-0.2.9.tgz
npm http 200 https://registry.npmjs.org/firmata/-/firmata-0.2.9.tgz
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/bindings/1.1.1
npm http GET https://registry.npmjs.org/sf/0.1.6
npm http GET https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/async/0.1.18
npm http 304 https://registry.npmjs.org/bindings/1.1.1
npm http 304 https://registry.npmjs.org/sf/0.1.6
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/wordwrap

> serialport@1.2.5 install /Users/gregaryh/node_modules/cylon-firmata/node_modules/firmata/node_modules/serialport
> node-gyp rebuild

  CXX(target) Release/obj.target/serialport/src/serialport.o
  CXX(target) Release/obj.target/serialport/src/serialport_unix.o
  CXX(target) Release/obj.target/serialport/src/serialport_poller.o
  SOLINK_MODULE(target) Release/serialport.node
  SOLINK_MODULE(target) Release/serialport.node: Finished
npm http GET https://registry.npmjs.org/cylon-gpio
npm http GET https://registry.npmjs.org/cylon-i2c
npm http 200 https://registry.npmjs.org/cylon-i2c
npm http GET https://registry.npmjs.org/cylon-i2c/-/cylon-i2c-0.6.0.tgz
npm http 200 https://registry.npmjs.org/cylon-gpio
npm http GET https://registry.npmjs.org/cylon-gpio/-/cylon-gpio-0.8.1.tgz
npm http 200 https://registry.npmjs.org/cylon-gpio/-/cylon-gpio-0.8.1.tgz
npm http 200 https://registry.npmjs.org/cylon-i2c/-/cylon-i2c-0.6.0.tgz
npm http GET https://registry.npmjs.org/i2c
npm http 200 https://registry.npmjs.org/i2c
npm http GET https://registry.npmjs.org/i2c/-/i2c-0.1.4.tgz
npm http 200 https://registry.npmjs.org/i2c/-/i2c-0.1.4.tgz
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/underscore/1.2.4
npm http GET https://registry.npmjs.org/repl/0.1.3
npm http GET https://registry.npmjs.org/coffee-script/1.3.3
npm http 200 https://registry.npmjs.org/bindings
npm http 200 https://registry.npmjs.org/repl/0.1.3
npm http GET https://registry.npmjs.org/repl/-/repl-0.1.3.tgz
npm http 200 https://registry.npmjs.org/underscore/1.2.4
npm http GET https://registry.npmjs.org/underscore/-/underscore-1.2.4.tgz
npm http 200 https://registry.npmjs.org/repl/-/repl-0.1.3.tgz
npm http 200 https://registry.npmjs.org/underscore/-/underscore-1.2.4.tgz
npm http 200 https://registry.npmjs.org/coffee-script/1.3.3
npm http GET https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz
npm http 200 https://registry.npmjs.org/coffee-script/-/coffee-script-1.3.3.tgz

> i2c@0.1.4 install /Users/gregaryh/node_modules/cylon-i2c/node_modules/i2c
> node-gyp rebuild

  CXX(target) Release/obj.target/i2c/src/i2c.o
In file included from ../src/i2c.cc:11:
../src/i2c-dev.h:27:10: fatal error: 'linux/types.h' file not found
#include <linux/types.h>
         ^
1 error generated.
make: *** [Release/obj.target/i2c/src/i2c.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/gregaryh/node_modules/cylon-i2c/node_modules/i2c
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
edgarsilva commented 10 years ago

Hi @ghendricks this is happening because the firmata module tries to install cylon-i2c which in turns tries to install node-i2c the one failing due to some missing linux libs that you are not going to have available in OSX. We'll push an update for this, in the mean time there is a simple workaround you can use the repos instead.

if you are not using or no not need i2c support:

  1. Download cylon-firmata repo.
  2. Comment out the cylon-i2c dependency in package.json
  3. Install cylon-firmata module with the path inside your project folder (npm install <path/to/cylonfirmata>)

if you do need i2c support:

  1. Download cylon-firmata and cylon-i2c repos.
  2. Comment out the i2c dependency in package.json inside cylon-i2c folder.
  3. Install cylon-i2c module with the path inside the cylon-firmata folder (npm install <path/to/cylon-i2c>)
  4. Install cylon-firmata module with the path inside your project folder (npm install <path/to/cylon-firmata>)

This should work with all functionality intact, I will push a fix for the dependency issues later today so it gets out in the next npm module release.

Let me know if there's anything else I can do to help.

edgarsilva commented 10 years ago

Hi @ghendricks

This should be fix by now, have you ever had a chance to check it out? let us know so we can close the issue.

neonag commented 10 years ago

hi edgarsilva when i ran my sample blinking led code in my mac this is the error i got

neo$ node blinkCjs.js I, [2014-07-03T14:53:11.694Z] INFO -- : Initializing connections. I, [2014-07-03T14:53:11.697Z] INFO -- : Initializing connection 'arduino'. D, [2014-07-03T14:53:11.697Z] DEBUG -- : Loading adaptor 'firmata'. D, [2014-07-03T14:53:11.986Z] DEBUG -- : Registering Firmata adaptor for Robot 65599 D, [2014-07-03T14:53:11.986Z] DEBUG -- : Registering GPIO AnalogSensor driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO Button driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO ContinuousServo driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO LED driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO MakeyButton driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO Maxbotix driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO Motor driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO Servo driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO IR Range Sensor driver for Robot 65599 D, [2014-07-03T14:53:11.987Z] DEBUG -- : Registering GPIO DirectPin Driver for Robot 65599 D, [2014-07-03T14:53:11.988Z] DEBUG -- : Registering i2c BlinkM driver for Robot 65599 D, [2014-07-03T14:53:11.989Z] DEBUG -- : Registering i2c HMC6352 driver for Robot 65599 D, [2014-07-03T14:53:11.989Z] DEBUG -- : Registering i2c MPL115A2 driver for Robot 65599 D, [2014-07-03T14:53:11.989Z] DEBUG -- : Registering i2c BMP180 driver for Robot 65599 D, [2014-07-03T14:53:11.989Z] DEBUG -- : Registering i2c MPU6050 driver for Robot 65599 D, [2014-07-03T14:53:11.989Z] DEBUG -- : Registering i2c LCD driver for Robot 65599 I, [2014-07-03T14:53:11.990Z] INFO -- : Initializing devices. I, [2014-07-03T14:53:11.990Z] INFO -- : Initializing device 'led'. D, [2014-07-03T14:53:11.990Z] DEBUG -- : Loading driver 'led'. I, [2014-07-03T14:53:11.991Z] INFO -- : Starting connections. I, [2014-07-03T14:53:11.992Z] INFO -- : Connecting to 'arduino' on port /dev/ttyACM0.

events.js:72 throw er; // Unhandled 'error' event ^ Error: Cannot open /dev/ttyACM0

how can handle this error ?

zankich commented 10 years ago

@neonag it appears that you're referencing the wrong serial port

Connecting to 'arduino' on port /dev/ttyACM0

Your serial port will follow the format /dev/cu.usbmodem*. Once you find the correct serial port, replace /dev/ttyACM0 with the correct port and you should be ready to go!

davidmoshal commented 10 years ago

Same problem, osx Mavericks:

sudo npm install i2c

i2c@0.1.4 install /Users/davem/Documents/Arduino/johnny-five/jf1/first/node_modules/i2c node-gyp rebuild

CXX(target) Release/obj.target/i2c/src/i2c.o In file included from ../src/i2c.cc:11: ../src/i2c-dev.h:27:10: fatal error: 'linux/types.h' file not found

include <linux/types.h>

     ^

1 error generated. make: *\ [Release/obj.target/i2c/src/i2c.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12) gyp ERR! System Darwin 13.3.0 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/davem/Documents/Arduino/johnny-five/jf1/first/node_modules/i2c gyp ERR! node -v v0.10.29

stewart commented 10 years ago

@davidmoshal the i2c module doesn't have OS X support (requires Linux-specific headers) and so cannot be installed on any version of OS X. The i2c module itself is primarily designed to be run directly on single-board Linux computers like the Raspberry Pi or Beaglebone Black.

For more info, see https://github.com/kelly/node-i2c/issues/17.

deadprogram commented 10 years ago

@davidmoshal did you mean to install the cylon-i2c drivers? You would use npm install cylon-i2c

This not the same as the node i2c module.

davidmoshal commented 10 years ago

trying to connect to an i2c module (Adafruit 8x8 led matrix) using johnny-five (ie: Node) on osx. can connect to simple led, but not i2c modules.

deadprogram commented 10 years ago

Johnny-five uses node.js, just like cylon.js does, but you probably would not use both cylon.js and johnny-five at the same time. @davidmoshal can you provide an example of your code, please?

rwaldron commented 10 years ago

@davidmoshal you should file a bug here: https://github.com/rwaldron/johnny-five/issues?state=open

deadprogram commented 10 years ago

The original issue was already addressed, so I am going to close this one.