Giter VIP home page Giter VIP logo

node-usb's Introduction

libusb-1.0 bindings for Node.js

node-usb binds libusb-1.0 to Node.js

Tested with Node version 0.6.6/Linux. Brew/OSX port of libusb-1.0 has still an issue which results in a segfault. Try using the latest development branch from http://git.libusb.org

Installation

Make sure you have installed libusb-1.0-0-dev (Ubuntu: sudo apt-get install libusb-1.0-0-dev).

Just run

make

in current directory and wait. "Unit tests" are automatically executed by default target. Failed unit tests do not mean that node-usb is not working. It depends on your USB environment that all tests pass. If they fail, just ignore them.

You can although execute the tests by typing:

node tests/node-usb-test.js

If you want to use the USB vendor ids, execute

make create-usb-ids

For creating debug output you have to compile node-usb with

make debug

or

node-waf clean configure --debug=true build

API

returned values can always be an error object, so make sure that no error occurs! The device/interface/endpoint descriptor values are always injected into the proper object. I do not list them.

Usb

.LIBUSB_* : const
	constant properties from libusb
.isLibusbInitalized : boolean
	property for getting libusb initalization status
.refresh() : undefined
	refreshes the node-usb environment
.setDebugLevel(int _level) : undefined
	wrapper for libusb_set_debug; _level has to be between 0 and 4
.getDevices() : Device[]
	returns the devices discovered by libusb
.close() : undefined
	closes node-usb

Device
.deviceAddress : int
	property for getting device address
.busNumber : int
	property for getting bus number
.reset(function _afterReset) : undefined
	[async] resets device, expects callback function after reset
.getConfigDescriptor() : Object
	returns configuration descriptor of device
.getExtraData() : Array
	returns byte array with extra data from config descriptor
.getInterfaces() : Interface[]
	returns interfaces
.getDeviceDescriptor() : Object
	returns devices descriptor
.controlTransfer(mixed read|write, int _bmRequestType, int _bRequest, int _wValue, int _wIndex, function afterTransfer(data) [, int _timeout])
	[async] delegates to libusb_control_transfer. First parameter can be either
	  * int, then controlTransfer works in read mode (read data FROM USB device)
	  * Buffer object, then controlTransfer works in write mode (write data TO USB device)
	_timeout parameter is optional.
	afterTransfer contains a Buffer object with the data read from device.

Interface

.__idxInterface : int
	property for internal interface index
.__idxAltSetting : int
	property for internal alternate interface setting
.getEndpoints() : Endpoint[]
	returns an array of Endpoint objects
.detachKernelDriver() : undefined
	detaches the kernel driver from interface
.attachKernelDriver() : undefined
	re-attaches the kernel driver to interface
.claim() : undefined
	claims the interface. this method must be __always__ called if you want to transfer data via the endpoint. There is no hig level API check for this
.release(function afterClaim(data)) : undefined
	[async] releases prior claimed interface; function wil be called after releasing
.setAlternateSetting(int _alternateSettingIdx, function afterAlternateSettingChosen(data))
	[async] sets alternate setting of interface; first parameter is the alternate setting index (there is no check for a valid index!), seconds is the callback function which is called after alternate setting has been chosen	
.isKernelDriverActive() : int
	returns 0  if not active; 1 if active
.getExtraData() : Array
	returns byte array with extra data from interface descriptor

Endpoint

.__endpointType : int
	property for getting the endpoint type (IN/OUT), check with Usb.LIBUSB_ENDPOINT_TYPE constants
.__transferType : int
	property for getting the transfer type (bulk, interrupt, isochronous); check with Usb.LIBUSB_TRANSFER_* constants
.__maxIsoPacketSize : int
	property for getting the max isochronous packet size if transfer type is isochronous
.__maxPacketSize : int
	property for getting the max packet size
.getExtraData() : Array
	byte array with extra data from endpoint descriptor
.bulkTransfer(mixed read|write, function afterTransfer(data) [, int _timeout])
.interruptTransfer(mixed read|write, function afterTransfer(data) [, int _timeout]) : undefined
	[async] bulkTransfer and interruptTransfer are more or less equal. If endpoint works in bulk mode, you use bulkTransfer(), if endpoint work in interrupt mode, you use interruptTransfer(). If you use the wrong method, the function call will fail.
	First parameter can be either
	* int, then the function will work in read mode (read _int_ bytes FROM USB device)
	* Buffer object, the function will work in write mode (write buffer TO USB device)
	The _timeout parameter is optional; if not used, an unlimited timeout is used.
	Both functions are working in asynchronous mode, the second parameter is the callback handler after the function has been executed / data arrived.
	afterTransfer contains a Buffer object as first parameter
.submitNative(mixed read|write, function after(data) [, int _timeout, int _iso_packets, int _flags]) : undefined
	[async] bulkTransfer, controlTransfer and interruptTransfer are using the EV library for threading. submitNative() uses the libusb asynchronous interface. This is not really tested now.
	submitNative() will be the only function to handle isochronous transfer mode and detects the endpoint type automatically.
	First parameter can be either (you know it already):
	* int, the function will be work in read mode (read _int_ bytes FROM USB device)
	* Buffer object, the function will work in write mode (write byte array TO USB device)
	The parameter _iso_packets and _flags can be used, if the endpoint is working in isochronous mode otherwise they are useless. 

Examples

A simple port of lsusb can be executed by typing

node examples/lsusb/lsusb.js

If you own a Microsoft Kinect, you can manipulate the LED, set the angle of the device and read the axis of the accelerometer

node examples/node-usb-kinect.js

Browse to localhost:8080 and see the magic.

If you have permission issues, you have to add the proper rights to the USB device or execute the examples as root (NOT RECOMMENDED!)

More information

node-usb's People

Contributors

bramp avatar schakko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-usb's Issues

mac/libusb issue?

Hi Schakko,

trying to use node-usb the code never reaches ...4... , but does so without any prior errors, so I guess libusb is installed correctly

assert.doesNotThrow(function() { instance.setDebugLevel(0); });
console.log(“…3…”);
var devices = instance.get_devices();
console.log(“…4…”);

this runs under node 4.11, mac osx 10.6.8

Thanks Lutz

Timeout issue

Hi, thanks for your greatjob! I haven't my laptop with me but I will try to add screenshot/data asap.

I have an issue "time out" when I try to send data (with transfer) to device. If I try to set the timeout to 15000ms the issue is still here (and timeout appears about 1,5 sec after the start of the transfer.
Is it possible to have more tips or clues un order to solve that.

Thanks !

Build issue on Mac w/ numerous node versions

Hi,

I've tried npm installing with a number of node versions (w/ and w/o sudo, including 0.6.9, 0.6.19, & 0.8.5). All are giving me errors. Am I missing something or is the package currently non-functional on mac?

Thanks,

Matt


sudo npm install node-usb
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/node-usb
npm http 304 https://registry.npmjs.org/node-usb

> [email protected] install /Users/matt/node_modules/node-usb
> node-waf configure build

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : ok /Users/matt/.node_libraries 
Checking for node prefix                 : ok /usr/local/Cellar/node/0.6.1 
Checking for libusb-1.0                  : not found 
/Users/matt/node_modules/node-usb/wscript:18: error: the configuration failed (see '/Users/matt/node_modules/node-usb/build/config.log')
npm ERR! [email protected] install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-usb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-usb
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "node-usb"
npm ERR! cwd /Users/matt/Development/koko/test
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.46
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/matt/Development/koko/test/npm-debug.log
npm ERR! not ok code undefined
npm ERR! not ok code 1

npm-debug.log:

cat npm-debug.log 
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'node-usb' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 verbose config file /Users/matt/.npmrc
6 verbose config file /usr/local/etc/npmrc
7 verbose config file /usr/local/lib/node_modules/npm/npmrc
8 verbose read json /Users/matt/package.json
9 warn package.json [email protected] No README.md file found!
10 verbose read json /Users/matt/node_modules/serialport/package.json
11 verbose from cache /Users/matt/package.json
12 verbose readDependencies using package.json deps
13 verbose cache add [ 'node-usb', null ]
14 silly cache add name=undefined spec="node-usb" args=["node-usb",null]
15 verbose parsed url { pathname: 'node-usb', path: 'node-usb', href: 'node-usb' }
16 silly lockFile 10f1884b-node-usb node-usb
17 verbose lock node-usb /Users/matt/.npm/10f1884b-node-usb.lock
18 silly lockFile 10f1884b-node-usb node-usb
19 verbose addNamed [ 'node-usb', '' ]
20 verbose addNamed [ null, '' ]
21 silly lockFile b6621649-node-usb node-usb@
22 verbose lock node-usb@ /Users/matt/.npm/b6621649-node-usb.lock
23 silly addNameRange { name: 'node-usb', range: '', hasData: false }
24 verbose url raw node-usb
25 verbose url resolving [ 'https://registry.npmjs.org/', './node-usb' ]
26 verbose url resolved https://registry.npmjs.org/node-usb
27 info retry registry request attempt 1 at 12:28:39
28 verbose etag "2ZFLW5JLWGWCNXPDSSGHWF2MQ"
29 http GET https://registry.npmjs.org/node-usb
30 http 304 https://registry.npmjs.org/node-usb
31 silly registry.get cb [ 304,
31 silly registry.get   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
31 silly registry.get     etag: '"2ZFLW5JLWGWCNXPDSSGHWF2MQ"',
31 silly registry.get     date: 'Tue, 04 Sep 2012 16:28:38 GMT',
31 silly registry.get     'content-length': '0' } ]
32 verbose etag node-usb from cache
33 silly addNameRange number 2 { name: 'node-usb', range: '', hasData: true }
34 silly addNameRange versions [ 'node-usb', [ '0.0.1' ] ]
35 verbose addNamed [ 'node-usb', '0.0.1' ]
36 verbose addNamed [ '0.0.1', '0.0.1' ]
37 silly lockFile 00da7448-node-usb-0-0-1 [email protected]
38 verbose lock [email protected] /Users/matt/.npm/00da7448-node-usb-0-0-1.lock
39 verbose read json /Users/matt/.npm/node-usb/0.0.1/package/package.json
40 silly lockFile 00da7448-node-usb-0-0-1 [email protected]
41 silly lockFile b6621649-node-usb node-usb@
42 silly resolved [ { name: 'node-usb',
42 silly resolved     version: '0.0.1',
42 silly resolved     description: 'experimental libusb bindings',
42 silly resolved     author: { name: 'Christopher Klein' },
42 silly resolved     main: './usb_bindings',
42 silly resolved     scripts: { install: 'node-waf configure build' },
42 silly resolved     readme: 'libusb-1.0 bindings for Node.js\n==============================\nnode-usb is just a sample of how to interact between node.js ->  Google V8 -> external libraries (in this case libusb-1.0).\nAt the moment only discovering of availble devices is possible and no asynchronous support is integrated.\n\nTested with Node version 0.2.4\n\nInstallation\n==============================\nMake sure you have installed libusb-1.0-0-dev (Ubuntu: sudo apt-get install libusb-1.0-0-dev).\nJust run\n\tmake setup\nin current directory and wait. "Unit tests" can be executed with\n\tnode tests/node-usb-test.js\n\nIf you want to use the USB vendor ids, execute\n\tmake create-usb-ids\n\nExamples\n=============================\nA simple version of lsusb can be executed by typing\n\tnode examples/lsusb.js\n\n\nTODO\n=============================\n* Move to asynchronous calls\n* read/write streams\n* ...\n\nMore information\n==============================\nChristopher Klein <ckl[at]ecw[dot]de>\nhttp://twitter.com/schakko\nhttp://wap.ecw.de\n',
42 silly resolved     _id: '[email protected]',
42 silly resolved     _from: 'node-usb' } ]
43 info install [email protected] into /Users/matt
44 info installOne [email protected]
45 verbose from cache /Users/matt/.npm/node-usb/0.0.1/package/package.json
46 info /Users/matt/node_modules/node-usb unbuild
47 verbose read json /Users/matt/node_modules/node-usb/package.json
48 verbose tar unpack /Users/matt/.npm/node-usb/0.0.1/package.tgz
49 silly lockFile 3dfbfa79-Users-matt-node-modules-node-usb /Users/matt/node_modules/node-usb
50 verbose lock /Users/matt/node_modules/node-usb /Users/matt/.npm/3dfbfa79-Users-matt-node-modules-node-usb.lock
51 silly gunzTarPerm modes [ '755', '644' ]
52 silly gunzTarPerm extractEntry package.json
53 silly gunzTarPerm extractEntry .npmignore
54 silly gunzTarPerm extractEntry README
55 silly gunzTarPerm extractEntry lsusb.js
56 silly gunzTarPerm extractEntry usb.js
57 silly gunzTarPerm extractEntry usb_ids.js
58 silly gunzTarPerm extractEntry Makefile
59 silly gunzTarPerm extractEntry examples/lsusb.js
60 silly gunzTarPerm extractEntry src/bindings.cc
61 silly gunzTarPerm extractEntry src/bindings.h
62 silly gunzTarPerm extractEntry src/node_usb.cc
63 silly gunzTarPerm extractEntry src/node_usb.h
64 silly gunzTarPerm extractEntry tests/node-usb-test.js
65 silly gunzTarPerm extractEntry util/create_usb_ids.js
66 silly gunzTarPerm extractEntry wscript
67 verbose read json /Users/matt/node_modules/node-usb/package.json
68 silly lockFile 3dfbfa79-Users-matt-node-modules-node-usb /Users/matt/node_modules/node-usb
69 info preinstall [email protected]
70 verbose from cache /Users/matt/node_modules/node-usb/package.json
71 verbose readDependencies using package.json deps
72 verbose from cache /Users/matt/node_modules/node-usb/package.json
73 verbose readDependencies using package.json deps
74 silly resolved []
75 verbose about to build /Users/matt/node_modules/node-usb
76 info build /Users/matt/node_modules/node-usb
77 verbose from cache /Users/matt/node_modules/node-usb/package.json
78 verbose linkStuff [ false, false, false, '/Users/matt/node_modules' ]
79 info linkStuff [email protected]
80 verbose linkBins [email protected]
81 verbose linkMans [email protected]
82 verbose rebuildBundles [email protected]
83 info install [email protected]
84 verbose unsafe-perm in lifecycle false
85 verbose set uid from=0 to=501
86 silly exec sh "-c" "node-waf configure build"
87 silly sh,-c,node-waf configure build,/Users/matt/node_modules/node-usb spawning
88 info [email protected] Failed to exec install script
89 info /Users/matt/node_modules/node-usb unbuild
90 verbose from cache /Users/matt/node_modules/node-usb/package.json
91 info preuninstall [email protected]
92 info uninstall [email protected]
93 verbose true,/Users/matt/node_modules,/Users/matt/node_modules unbuild [email protected]
94 info postuninstall [email protected]
95 error [email protected] install: `node-waf configure build`
95 error `sh "-c" "node-waf configure build"` failed with 1
96 error Failed at the [email protected] install script.
96 error This is most likely a problem with the node-usb package,
96 error not with npm itself.
96 error Tell the author that this fails on your system:
96 error     node-waf configure build
96 error You can get their info via:
96 error     npm owner ls node-usb
96 error There is likely additional logging output above.
97 error System Darwin 10.8.0
98 error command "node" "/usr/local/bin/npm" "install" "node-usb"
99 error cwd /Users/matt/Development/koko/test
100 error node -v v0.6.19
101 error npm -v 1.1.46
102 error code ELIFECYCLE
103 verbose exit [ 1, true ]

node-usb installation failure on Ubuntu and Mac

I added node-usb as a dependency in a project of mine's package.json but I have spent the past day trying to get it build (using npm install) and nothing works on my mac/linux machine.

I am trying to install node-usb on my machines (I have a Mac 10.7 and a Ubuntu 12.04). I installed libusb in Ubuntu by using 'sudo apt-get install libusb-1.0-0-dev' and in Mac by doing 'brew install libusb' (the website recommends me to use the latest libusb but I can't figure out how to install it without homebrew) and I am getting the following error when I do an npm install for my project in Ubuntu:

npm http GET https://registry.npmjs.org/node-usb
npm http 304 https://registry.npmjs.org/node-usb

> [email protected] install /home/pathikrit/Projects/ASD/node_modules/node-usb
> node-waf configure build

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : ok /usr/share/nodejs 
Checking for node prefix                 : ok /usr 
Checking for libusb-1.0                  : yes 
Checking for library usb-1.0             : yes 
'configure' finished successfully (0.093s)
Waf: Entering directory `/home/pathikrit/Projects/ASD/node_modules/node-usb/build'
[1/3] cxx: src/node_usb.cc -> build/Release/src/node_usb_1.o
[2/3] cxx: src/bindings.cc -> build/Release/src/bindings_1.o
In file included from ../src/./bindings.h:4:0,
                 from ../src/node_usb.cc:1:
../src/./node_usb.h:15:25: fatal error: node_events.h: No such file or directory
compilation terminated.
In file included from ../src/./bindings.h:4:0,
                 from ../src/bindings.cc:1:
../src/./node_usb.h:15:25: fatal error: node_events.h: No such file or directory
compilation terminated.
Waf: Leaving directory `/home/pathikrit/Projects/ASD/node_modules/node-usb/build'
Build failed:
 -> task failed (err #1): 
    {task: cxx node_usb.cc -> node_usb_1.o}
 -> task failed (err #1): 
    {task: cxx bindings.cc -> bindings_1.o}

npm ERR! [email protected] install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-usb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-usb
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Linux 3.2.0-24-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /home/pathikrit/Projects/ASD
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.21
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-waf configure build`
npm ERR! message `sh "-c" "node-waf configure build"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pathikrit/Projects/ASD/npm-debug.log
npm not ok

In my Mac, I get this:

npm http GET https://registry.npmjs.org/node-usb
npm http 304 https://registry.npmjs.org/node-usb

> [email protected] install /Users/pathikrit/Projects/ASD/node_modules/node-usb
> node-waf configure build

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local/Cellar/node/0.6.18 
Checking for libusb-1.0                  : yes 
Checking for library usb-1.0             : yes 
'configure' finished successfully (0.100s)
Waf: Entering directory `/Users/pathikrit/Projects/ASD/node_modules/node-usb/build'
[1/3] cxx: src/node_usb.cc -> build/Release/src/node_usb_1.o
[2/3] cxx: src/bindings.cc -> build/Release/src/bindings_1.o
In file included from ../src/./bindings.h:4In file included from ../src/./bindings.h:4,
                 from ../src/bindings.cc:1,
                 from ../src/node_usb.cc:1:
:
../src/./node_usb.h:4:20:../src/./node_usb.h:4:20:  error: error: libusb.h: No such file or directorylibusb.h: No such file or directory

../src/./node_usb.h:15:25: error: node_events.h: No such file or directory
../src/./node_usb.h:15:25: error: node_events.h: No such file or directory
In file included from ../src/bindings.cc:1:
../src/./bindings.h:12: error: expected class-name before ‘{’ token
../src/./bindings.h:22: error: ISO C++ forbids declaration of ‘libusb_device’ with no type
../src/./bindings.h:22: error: expected ‘;’ before ‘*’ token
../src/./bindings.h:35: error: expected class-name before ‘{’ token
../src/./bindings.h:40: error: expected `)' before ‘*’ token
../src/./bindings.h:48: error: field ‘device_descriptor’ has incomplete type
../src/bindings.cc: In function ‘v8::Local<v8::Value> NodeUsb::errno_exception(int)’:
../src/bindings.cc:30: error: ‘LIBUSB_ERROR_IO’ was not declared in this scope
../src/bindings.cc:33: error: ‘LIBUSB_ERROR_INVALID_PARAM’ was not declared in this scope
../src/bindings.cc:36: error: ‘LIBUSB_ERROR_ACCESS’ was not declared in this scope
../src/bindings.cc:39: error: ‘LIBUSB_ERROR_NO_DEVICE’ was not declared in this scope
../src/bindings.cc:42: error: ‘LIBUSB_ERROR_NOT_FOUND’ was not declared in this scope
../src/bindings.cc:45: error: ‘LIBUSB_ERROR_BUSY’ was not declared in this scope
../src/bindings.cc:48: error: ‘LIBUSB_ERROR_TIMEOUT’ was not declared in this scope
../src/bindings.cc:51: error: ‘LIBUSB_ERROR_OVERFLOW’ was not declared in this scope
../src/bindings.cc:54: error: ‘LIBUSB_ERROR_PIPE’ was not declared in this scope
../src/bindings.cc:57: error: ‘LIBUSB_ERROR_INTERRUPTED’ was not declared in this scope
../src/bindings.cc:60: error: ‘LIBUSB_ERROR_NO_MEM’ was not declared in this scope
../src/bindings.cc:63: error: ‘LIBUSB_ERROR_NOT_SUPPORTED’ was not declared in this scope
../src/bindings.cc: In static member function ‘static void NodeUsb::Usb::InitalizeUsb(v8::Handle<v8::Object>)’:
../src/bindings.cc:86: error: ‘EventEmitter’ has not been declared
../src/bindings.cc:94: error: ‘LIBUSB_CLASS_PER_INTERFACE’ was not declared in this scope
../src/bindings.cc:95: error: ‘LIBUSB_CLASS_AUDIO’ was not declared in this scope
../src/bindings.cc:96: error: ‘LIBUSB_CLASS_COMM’ was not declared in this scope
../src/bindings.cc:97: error: ‘LIBUSB_CLASS_HID’ was not declared in this scope
../src/bindings.cc:98: error: ‘LIBUSB_CLASS_PRINTER’ was not declared in this scope
../src/bindings.cc:99: error: ‘LIBUSB_CLASS_PTP’ was not declared in this scope
../src/bindings.cc:100: error: ‘LIBUSB_CLASS_MASS_STORAGE’ was not declared in this scope
../src/bindings.cc:101: error: ‘LIBUSB_CLASS_HUB’ was not declared in this scope
../src/bindings.cc:102: error: ‘LIBUSB_CLASS_DATA’ was not declared in this scope
../src/bindings.cc:106: error: ‘LIBUSB_CLASS_VENDOR_SPEC’ was not declared in this scope
../src/bindings.cc:108: error: ‘LIBUSB_DT_DEVICE’ was not declared in this scope
../src/bindings.cc:109: error: ‘LIBUSB_DT_CONFIG’ was not declared in this scope
../src/bindings.cc:110: error: ‘LIBUSB_DT_STRING’ was not declared in this scope
../src/bindings.cc:111: error: ‘LIBUSB_DT_INTERFACE’ was not declared in this scope
../src/bindings.cc:112: error: ‘LIBUSB_DT_ENDPOINT’ was not declared in this scope
../src/bindings.cc:113: error: ‘LIBUSB_DT_HID’ was not declared in this scope
../src/bindings.cc:114: error: ‘LIBUSB_DT_REPORT’ was not declared in this scope
../src/bindings.cc:115: error: ‘LIBUSB_DT_PHYSICAL’ was not declared in this scope
../src/bindings.cc:116: error: ‘LIBUSB_DT_HUB’ was not declared in this scope
../src/bindings.cc:118: error: ‘LIBUSB_ENDPOINT_IN’ was not declared in this scope
../src/bindings.cc:119: error: ‘LIBUSB_ENDPOINT_OUT’ was not declared in this scope
../src/bindings.cc:121: error: ‘LIBUSB_TRANSFER_TYPE_CONTROL’ was not declared in this scope
../src/bindings.cc:122: error: ‘LIBUSB_TRANSFER_TYPE_ISOCHRONOUS’ was not declared in this scope
../src/bindings.cc:123: error: ‘LIBUSB_TRANSFER_TYPE_BULK’ was not declared in this scope
../src/bindings.cc:124: error: ‘LIBUSB_TRANSFER_TYPE_INTERRUPT’ was not declared in this scope
../src/bindings.cc:126: error: ‘LIBUSB_ISO_SYNC_TYPE_NONE’ was not declared in this scope
../src/bindings.cc:127: error: ‘LIBUSB_ISO_SYNC_TYPE_ASYNC’ was not declared in this scope
../src/bindings.cc:128: error: ‘LIBUSB_ISO_SYNC_TYPE_ADAPTIVE’ was not declared in this scope
../src/bindings.cc:129: error: ‘LIBUSB_ISO_SYNC_TYPE_SYNC’ was not declared in this scope
../src/bindings.cc:131: error: ‘LIBUSB_ISO_USAGE_TYPE_DATA’ was not declared in this scope
../src/bindings.cc:132: error: ‘LIBUSB_ISO_USAGE_TYPE_FEEDBACK’ was not declared in this scope
../src/bindings.cc:133: error: ‘LIBUSB_ISO_USAGE_TYPE_IMPLICIT’ was not declared in this scope
../src/bindings.cc: In constructor ‘NodeUsb::Usb::Usb()’:
../src/bindings.cc:149: error: class ‘NodeUsb::Usb’ does not have any field named ‘EventEmitter’
../src/bindings.cc:151: error: ‘devices’ was not declared in this scope
../src/bindings.cc: In destructor ‘NodeUsb::Usb::~Usb()’:
../src/bindings.cc:155: error: ‘devices’ was not declared in this scope
../src/bindings.cc:156: error: ‘libusb_free_device_list’ was not declared in this scope
../src/bindings.cc:159: error: ‘libusb_exit’ was not declared in this scope
../src/bindings.cc: In member function ‘int NodeUsb::Usb::InitalizeLibusb()’:
../src/bindings.cc:169: error: ‘LIBUSB_SUCCESS’ was not declared in this scope
../src/bindings.cc:172: error: ‘libusb_init’ was not declared in this scope
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Usb::New(const v8::Arguments&)’:
../src/bindings.cc:206: error: ‘class NodeUsb::Usb’ has no member named ‘Wrap’
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Usb::Refresh(const v8::Arguments&)’:
../src/bindings.cc:218: error: ‘LIBUSB_SUCCESS’ was not declared in this scope
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Usb::GetDeviceList(const v8::Arguments&)’:
../src/bindings.cc:230: error: ‘LIBUSB_SUCCESS’ was not declared in this scope
../src/bindings.cc:240: error: ‘class NodeUsb::Usb’ has no member named ‘devices’
../src/bindings.cc:241: error: ‘class NodeUsb::Usb’ has no member named ‘devices’
../src/bindings.cc:241: error: ‘libusb_get_device_list’ was not declared in this scope
../src/bindings.cc:242: error: ‘LIBUSB_SUCCESS’ was not declared in this scope
../src/bindings.cc:250: error: ‘class NodeUsb::Usb’ has no member named ‘devices’
../src/bindings.cc: At global scope:
../src/bindings.cc:318: error: prototype for ‘NodeUsb::Device::Device(NodeUsb::libusb_device*)’ does not match any in class ‘NodeUsb::Device’
../src/./bindings.h:35: error: candidates are: NodeUsb::Device::Device(const NodeUsb::Device&)
../src/./bindings.h:35: error:                 NodeUsb::Device::Device()
../src/bindings.cc: In destructor ‘NodeUsb::Device::~Device()’:
../src/bindings.cc:328: error: ‘libusb_close’ was not declared in this scope
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::New(const v8::Arguments&)’:
../src/bindings.cc:348: error: no matching function for call to ‘NodeUsb::Device::Device(NodeUsb::libusb_device*&)’
../src/./bindings.h:35: note: candidates are: NodeUsb::Device::Device()
../src/./bindings.h:35: note:                 NodeUsb::Device::Device(const NodeUsb::Device&)
../src/bindings.cc:351: error: ‘class NodeUsb::Device’ has no member named ‘Wrap’
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::BusNumberGetter(v8::Local<v8::String>, const v8::AccessorInfo&)’:
../src/bindings.cc:363: error: ‘libusb_get_bus_number’ was not declared in this scope
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::DeviceAddressGetter(v8::Local<v8::String>, const v8::AccessorInfo&)’:
../src/bindings.cc:375: error: ‘libusb_get_device_address’ was not declared in this scope
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::Open(const v8::Arguments&)’:
../src/bindings.cc:382: error: ‘libusb_open’ was not declared in this scope
../src/bindings.cc:382: error: ‘LIBUSB_SUCCESS’ was not declared in this scope
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::Close(const v8::Arguments&)’:
../src/bindings.cc:393: error: ‘libusb_close’ was not declared in this scope
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::GetConfigDescriptor(const v8::Arguments&)’:
../src/bindings.cc:413: error: ‘libusb_get_active_config_descriptor’ was not declared in this scope
../src/bindings.cc:413: error: ‘LIBUSB_SUCCESS’ was not declared in this scope
../src/bindings.cc:415: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:416: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:417: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:418: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:419: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:420: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:421: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:422: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:426: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:427: error: invalid use of incomplete type ‘struct NodeUsb::libusb_config_descriptor’
../src/./bindings.h:49: error: forward declaration of ‘struct NodeUsb::libusb_config_descriptor’
../src/bindings.cc:433: error: ‘libusb_free_config_descriptor’ was not declared in this scope
../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::GetDeviceDescriptor(const v8::Arguments&)’:
../src/bindings.cc:444: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:444: error: ‘libusb_get_device_descriptor’ was not declared in this scope
../src/bindings.cc:444: error: ‘LIBUSB_SUCCESS’ was not declared in this scope
../src/bindings.cc:444: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:447: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:448: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:449: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:450: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:451: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:452: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:453: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:454: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:455: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:456: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:457: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:458: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:459: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
../src/bindings.cc:460: error: ‘class NodeUsb::Device’ has no member named ‘device_descriptor’
In file included from ../src/node_usb.cc:1:
../src/./bindings.h:12: error: expected class-name before ‘{’ token
../src/./bindings.h:22: error: ISO C++ forbids declaration of ‘libusb_device’ with no type
../src/./bindings.h:22: error: expected ‘;’ before ‘*’ token
../src/./bindings.h:35: error: expected class-name before ‘{’ token
../src/./bindings.h:40: error: expected `)' before ‘*’ token
../src/./bindings.h:48: error: field ‘device_descriptor’ has incomplete type
Waf: Leaving directory `/Users/pathikrit/Projects/ASD/node_modules/node-usb/build'
Build failed:
 -> task failed (err #1): 
    {task: cxx node_usb.cc -> node_usb_1.o}
 -> task failed (err #1): 
    {task: cxx bindings.cc -> bindings_1.o}
npm ERR! [email protected] install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the node-usb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-usb
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/pathikrit/Projects/ASD
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.1.30
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-waf configure build`
npm ERR! message `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/pathikrit/Projects/ASD/npm-debug.log
npm ERR! not ok code undefined
npm ERR! not ok code 1

Can someone give me a step by step of what to do to install in either Ubuntu or Mac?

Events?

Now that I've got node-usb running, I've plugged in an xbox controller and am exploring what it offers.

One thing that I'm not really sure about is how to listen for events from a given device. Is it necessary to poll a usb device continuously, such as a game controller, to get its modified input values? Or rather, is there an event interface on node-usb that I can subscribe to?

Build failure on Ubuntu 12.04

[redacted]$ git clone https://github.com/schakko/node-usb.git
Cloning into 'node-usb'...
remote: Counting objects: 503, done.
remote: Compressing objects: 100% (330/330), done.
remote: Total 503 (delta 319), reused 262 (delta 133)
Receiving objects: 100% (503/503), 277.15 KiB | 221 KiB/s, done.
Resolving deltas: 100% (319/319), done.
[redacted]$ cd node-usb/
[redacted]/node-usb$ node --version
v0.6.12
[redacted]/node-usb$ npm --version
1.1.4
[redacted]/node-usb$ make
node-waf -v configure clean build; node tests/node-usb-test.js
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for node path : not found
Checking for node prefix : ok /usr
Checking for program pkg-config : /usr/bin/pkg-config
Checking for libusb-1.0 : 23:06:15 runner pkg-config --errors-to-stdout --print-errors --cflags --libs libusb-1.0
yes
'configure' finished successfully (0.083s)
'clean' finished successfully (0.004s)
Waf: Entering directory /home/addepar/Desktop/rick_hackery/ASD/node_modules/node-usb/build' [1/6] cxx: src/node_usb.cc -> build/Release/src/node_usb_1.o 23:06:15 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/include/libusb-1.0', '-I/usr/include/nodejs', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/node_usb.cc', '-c', '-o', 'Release/src/node_usb_1.o'] [2/6] cxx: src/usb.cc -> build/Release/src/usb_1.o 23:06:15 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/include/libusb-1.0', '-I/usr/include/nodejs', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/usb.cc', '-c', '-o', 'Release/src/usb_1.o'] [3/6] cxx: src/device.cc -> build/Release/src/device_1.o 23:06:15 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/include/libusb-1.0', '-I/usr/include/nodejs', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/device.cc', '-c', '-o', 'Release/src/device_1.o'] [4/6] cxx: src/interface.cc -> build/Release/src/interface_1.o 23:06:15 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/include/libusb-1.0', '-I/usr/include/nodejs', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/interface.cc', '-c', '-o', 'Release/src/interface_1.o'] In file included from ../src/bindings.h:4:0, from ../src/usb.h:4, from ../src/node_usb.cc:1: ../src/node_usb.h:22:27: fatal error: uv-private/ev.h: No such file or directory compilation terminated. In file included from ../src/bindings.h:4:0, from ../src/usb.h:4, from ../src/usb.cc:1: ../src/node_usb.h:22:27: fatal error: uv-private/ev.h: No such file or directory compilation terminated. In file included from ../src/bindings.h:4:0, from ../src/interface.cc:1: ../src/node_usb.h:22:27: fatal error: uv-private/ev.h: No such file or directory compilation terminated. In file included from ../src/bindings.h:4:0, from ../src/device.cc:1: ../src/node_usb.h:22:27: fatal error: uv-private/ev.h: No such file or directory compilation terminated. Waf: Leaving directory/home/addepar/Desktop/rick_hackery/ASD/node_modules/node-usb/build'
Build failed:
-> task failed (err #1):
{task: cxx node_usb.cc -> node_usb_1.o}
-> task failed (err #1):
{task: cxx usb.cc -> usb_1.o}
-> task failed (err #1):
{task: cxx interface.cc -> interface_1.o}
-> task failed (err #1):
{task: cxx device.cc -> device_1.o}

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module './usb_bindings'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object. (/home/addepar/Desktop/rick_hackery/ASD/node_modules/node-usb/usb.js:4:15)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:32)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
make: *** [make] Error 1

libusb-1.0 not found

On Mac 10.6.8, node 0.6.14.

Given that Homebrew installation of libusb is not recommended, I installed the latest version of libusb that is being actively developed from here: git://git.libusb.org/libusb.git as is recommended by http://libusb.org/wiki/libusb-1.0#Documentation.

Installation appears successful of libusb. Running make in node-usb results in:

node-waf -v configure clean build; node tests/node-usb-test.js
Checking for program g++ or c++ : /Developer/usr/bin/g++
Checking for program cpp : /Developer/usr/bin/cpp
Checking for program ar : /Developer/usr/bin/ar
Checking for program ranlib : /Developer/usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /Developer/usr/bin/gcc
Checking for gcc : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local/Cellar/node/0.6.11
Checking for libusb-1.0 : 00:36:10 runner pkg-config --errors-to-stdout --print-errors --cflags --libs libusb-1.0
not found
/usr/local/apps/nodeusb/wscript:21: error: the configuration failed (see '/usr/local/apps/nodeusb/build/config.log')

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module './usb_bindings'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object. (/usr/local/apps/nodeusb/usb.js:4:15)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
make: *** [make] Error 1

The error is here, "Checking for libusb-1.0 : 00:36:10 runner pkg-config --errors-to-stdout --print-errors --cflags --libs libusb-1.0"

libusb-1.0 is not found.

How do I correct this?

Error: LIBUSB_ERROR_IO

when deploying estimote-spec i get this issue
events.js:160
throw er; // Unhandled 'error' event
^

Error: LIBUSB_ERROR_IO
at Error (native)
at startTransfer (C:\Users\ainane\Documents\Visual Studio 2015\Projects\estimote-specs-master\node_modules\usb\usb.js:333:6)
at Transfer.transferDone (C:\Users\ainane\Documents\Visual Studio 2015\Projects\estimote-specs-master\node_modules\usb\usb.js:321:4)

from usb.js in the function startTransfert

function startTransfer(t){
try {
t.submit(new Buffer(self.pollTransferSize), transferDone);
} catch (e) {
self.emit("error", e);
self.stopPoll();
}
}

Endpoint::Transfer in READ mode expects uint32_t as first parameter

System: Mac 10.6.8
Node: 0.6.14
libusb: git://git.libusb.org/libusb.git via http://libusb.org/wiki/libusb-1.0#Documentation

Had to "brew install pkg-config" to for libusb-1.0 to be found by node-usb

After building node-usb, node-usb-test.js fails with:

"TypeError: Endpoint::Transfer in READ mode expects uint32_t as first parameter. If you want to write something, you must provide a Buffer instance as first parameter"

Full build log follows:

geuiss-Mac-Pro:nodeusb geuis$ make
node-waf -v configure clean build; node tests/node-usb-test.js
Checking for program g++ or c++ : /Developer/usr/bin/g++
Checking for program cpp : /Developer/usr/bin/cpp
Checking for program ar : /Developer/usr/bin/ar
Checking for program ranlib : /Developer/usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /Developer/usr/bin/gcc
Checking for gcc : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local/Cellar/node/0.6.14
Checking for libusb-1.0 : 21:29:22 runner pkg-config --errors-to-stdout --print-errors --cflags --libs libusb-1.0
yes
'configure' finished successfully (0.066s)
'clean' finished successfully (0.005s)
Waf: Entering directory /usr/local/apps/nodeusb/build' [1/6] cxx: src/node_usb.cc -> build/Release/src/node_usb_1.o 21:29:22 runner system command -> ['/Developer/usr/bin/g++', '-g', '-Wall', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-IRelease', '-I..', '-I/usr/local/include/libusb-1.0', '-I/usr/local/Cellar/node/0.6.14/include/node', '-DNODE_USB_REVISION="8706aaa22bbfcd50b9c5b99bdd3a0c6add376dc4"', '../src/node_usb.cc', '-c', '-o', 'Release/src/node_usb_1.o'] [2/6] cxx: src/usb.cc -> build/Release/src/usb_1.o [3/6] cxx: src/device.cc -> build/Release/src/device_1.o 21:29:22 runner system command -> ['/Developer/usr/bin/g++', '-g', '-Wall', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-IRelease', '-I..', '-I/usr/local/include/libusb-1.0', '-I/usr/local/Cellar/node/0.6.14/include/node', '-DNODE_USB_REVISION="8706aaa22bbfcd50b9c5b99bdd3a0c6add376dc4"', '../src/usb.cc', '-c', '-o', 'Release/src/usb_1.o'] 21:29:22 runner system command -> ['/Developer/usr/bin/g++', '-g', '-Wall', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-IRelease', '-I..', '-I/usr/local/include/libusb-1.0', '-I/usr/local/Cellar/node/0.6.14/include/node', '-DNODE_USB_REVISION="8706aaa22bbfcd50b9c5b99bdd3a0c6add376dc4"', '../src/device.cc', '-c', '-o', 'Release/src/device_1.o'] [4/6] cxx: src/interface.cc -> build/Release/src/interface_1.o [5/6] cxx: src/endpoint.cc -> build/Release/src/endpoint_1.o 21:29:22 runner system command -> ['/Developer/usr/bin/g++', '-g', '-Wall', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-IRelease', '-I..', '-I/usr/local/include/libusb-1.0', '-I/usr/local/Cellar/node/0.6.14/include/node', '-DNODE_USB_REVISION="8706aaa22bbfcd50b9c5b99bdd3a0c6add376dc4"', '../src/interface.cc', '-c', '-o', 'Release/src/interface_1.o'] 21:29:22 runner system command -> ['/Developer/usr/bin/g++', '-g', '-Wall', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-IRelease', '-I..', '-I/usr/local/include/libusb-1.0', '-I/usr/local/Cellar/node/0.6.14/include/node', '-DNODE_USB_REVISION="8706aaa22bbfcd50b9c5b99bdd3a0c6add376dc4"', '../src/endpoint.cc', '-c', '-o', 'Release/src/endpoint_1.o'] ../src/device.cc: In static member function ‘static void NodeUsb::Device::EIO_ControlTransfer(uv_work_t*)’: ../src/device.cc:396: warning: comparison is always false due to limited range of data type [6/6] cxx_link: build/Release/src/node_usb_1.o build/Release/src/usb_1.o build/Release/src/device_1.o build/Release/src/interface_1.o build/Release/src/endpoint_1.o -> build/Release/usb_bindings.node 21:29:22 runner system command -> ['/Developer/usr/bin/g++', 'Release/src/node_usb_1.o', 'Release/src/usb_1.o', 'Release/src/device_1.o', 'Release/src/interface_1.o', 'Release/src/endpoint_1.o', '-o', '/usr/local/apps/nodeusb/build/Release/usb_bindings.node', '-bundle', '-undefined', 'dynamic_lookup', '-L/usr/local/lib', '-L/usr/local/Cellar/node/0.6.14/lib', '-lusb-1.0'] Waf: Leaving directory/usr/local/apps/nodeusb/build'
'build' finished successfully (0.796s)
Failed to claim endpoint; error: -99
Failed to claim endpoint; error: -99
Failed to claim endpoint; error: -99
Failed to claim endpoint; error: -99
Failed to claim endpoint; error: -99

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Endpoint::Transfer in READ mode expects uint32_t as first parameter. If you want to write something, you must provide a Buffer instance as first parameter
at Object. (/usr/local/apps/nodeusb/tests/node-usb-test.js:88:24)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
make: *** [make] Error 1

require("./usb_bindings")

The require statement in usb.js uses an absolute path, which does not work on current node.js installations.

Build failure under 0.8.5

acacio@quasi:node-usb$ make
node-waf -v configure clean build; node tests/node-usb-test.js
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /opt/node 
Checking for program pkg-config          : /usr/bin/pkg-config 
Checking for libusb-1.0                  : 20:58:12 runner pkg-config --errors-to-stdout --print-errors --cflags --libs libusb-1.0 
yes 
'configure' finished successfully (0.247s)
'clean' finished successfully (0.059s)
Waf: Entering directory `/home/acacio/src/nodejs/node-usb/build'
[1/6] cxx: src/node_usb.cc -> build/Release/src/node_usb_1.o
20:58:13 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/local/include/libusb-1.0', '-I/opt/node/include/node', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/node_usb.cc', '-c', '-o', 'Release/src/node_usb_1.o']
[2/6] cxx: src/usb.cc -> build/Release/src/usb_1.o
20:58:13 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/local/include/libusb-1.0', '-I/opt/node/include/node', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/usb.cc', '-c', '-o', 'Release/src/usb_1.o']
[3/6] cxx: src/device.cc -> build/Release/src/device_1.o
20:58:13 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/local/include/libusb-1.0', '-I/opt/node/include/node', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/device.cc', '-c', '-o', 'Release/src/device_1.o']
[4/6] cxx: src/interface.cc -> build/Release/src/interface_1.o
20:58:13 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/local/include/libusb-1.0', '-I/opt/node/include/node', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/interface.cc', '-c', '-o', 'Release/src/interface_1.o']
[5/6] cxx: src/endpoint.cc -> build/Release/src/endpoint_1.o
20:58:13 runner system command -> ['/usr/bin/g++', '-g', '-Wall', '-fPIC', '-DPIC', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-D_GNU_SOURCE', '-DEV_MULTIPLICITY=1', '-I/usr/local/include/libusb-1.0', '-I/opt/node/include/node', '-DNODE_USB_REVISION="61986afa8d9cdf28121d29d47d28a57da0f7d853"', '../src/endpoint.cc', '-c', '-o', 'Release/src/endpoint_1.o']
../src/device.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::Reset(const v8::Arguments&)’:
../src/device.cc:151: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_ref(uv_handle_t*)’
../src/device.cc: In static member function ‘static void NodeUsb::Device::EIO_Reset(uv_work_t*)’:
../src/device.cc:178: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_unref(uv_handle_t*)’
../src/device.cc: In static member function ‘static void NodeUsb::Device::EIO_After_Reset(uv_work_t*)’:
../src/device.cc:182: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_unref(uv_handle_t*)’
../src/device.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Device::ControlTransfer(const v8::Arguments&)’:
../src/device.cc:381: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_ref(uv_handle_t*)’
../src/device.cc: In static member function ‘static void NodeUsb::Device::EIO_After_ControlTransfer(uv_work_t*)’:
../src/device.cc:404: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_unref(uv_handle_t*)’
../src/interface.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Interface::Release(const v8::Arguments&)’:
../src/interface.cc:191: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_ref(uv_handle_t*)’
../src/interface.cc: In static member function ‘static void NodeUsb::Interface::EIO_After_Release(uv_work_t*)’:
../src/interface.cc:212: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_unref(uv_handle_t*)’
../src/interface.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Interface::AlternateSetting(const v8::Arguments&)’:
../src/interface.cc:238: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_ref(uv_handle_t*)’
../src/interface.cc: In static member function ‘static void NodeUsb::Interface::EIO_After_AlternateSetting(uv_work_t*)’:
../src/interface.cc:259: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_unref(uv_handle_t*)’
../src/endpoint.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Endpoint::BulkTransfer(const v8::Arguments&)’:
../src/endpoint.cc:262: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_ref(uv_handle_t*)’
../src/endpoint.cc: In static member function ‘static void NodeUsb::Endpoint::EIO_After_BulkTransfer(uv_work_t*)’:
../src/endpoint.cc:270: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_unref(uv_handle_t*)’
../src/endpoint.cc: In static member function ‘static v8::Handle<v8::Value> NodeUsb::Endpoint::InterruptTransfer(const v8::Arguments&)’:
../src/endpoint.cc:274: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_ref(uv_handle_t*)’
../src/endpoint.cc: In static member function ‘static void NodeUsb::Endpoint::EIO_After_InterruptTransfer(uv_work_t*)’:
../src/endpoint.cc:282: error: cannot convert ‘uv_loop_t*’ to ‘uv_handle_t*’ for argument ‘1’ to ‘void uv_unref(uv_handle_t*)’
Waf: Leaving directory `/home/acacio/src/nodejs/node-usb/build'
Build failed:
 -> task failed (err #1): 
    {task: cxx device.cc -> device_1.o}
 -> task failed (err #1): 
    {task: cxx interface.cc -> interface_1.o}
 -> task failed (err #1): 
    {task: cxx endpoint.cc -> endpoint_1.o}

module.js:340
    throw err;
          ^
Error: Cannot find module './usb_bindings'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/home/acacio/src/nodejs/node-usb/usb.js:4:15)
    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)
make: *** [make] Error 1
acacio@quasi:node-usb$ node --version
v0.8.5

Cannot find module 'usb_bindings'

Hi,

I have tried installing the node-usb in my ubuntu11.04. I am getting following error "USB_BINDINGS" module not found. can you help me out on this subject.

root@ubuntu:/home/san# nodejs --version
v0.6.8
root@ubuntu:/home/san# cd node-usb/
root@ubuntu:/home/san/node-usb# make
node-waf configure clean build; nodejs tests/node-usb-test.js
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for gcc : ok
Checking for node path : not found
Checking for node prefix : ok /usr
Checking for libusb-1.0 : yes
'configure' finished successfully (1.996s)
'clean' finished successfully (0.040s)
Waf: Entering directory /home/san/node-usb/build' [1/6] cxx: src/node_usb.cc -> build/Release/src/node_usb_1.o [2/6] cxx: src/usb.cc -> build/Release/src/usb_1.o [3/6] cxx: src/device.cc -> build/Release/src/device_1.o [4/6] cxx: src/interface.cc -> build/Release/src/interface_1.o [5/6] cxx: src/endpoint.cc -> build/Release/src/endpoint_1.o [6/6] cxx_link: build/Release/src/node_usb_1.o build/Release/src/usb_1.o build/Release/src/device_1.o build/Release/src/interface_1.o build/Release/src/endpoint_1.o -> build/Release/usb_bindings.node Waf: Leaving directory/home/san/node-usb/build'
'build' finished successfully (6.181s)

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'usb_bindings'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object. (/home/san/node-usb/usb.js:4:15)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
make: *** [make] Error 1
root@ubuntu:/home/san/node-usb#

segfault on make

Here's the output:

node-waf configure clean build && node tests/node-usb-test.js
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for node path                   : ok /Users/isaacs/.node_libraries 
Checking for node prefix                 : ok /usr/local 
Checking for libusb-1.0                  : yes 
Checking for library usb-1.0             : yes 
'configure' finished successfully (0.173s)
'clean' finished successfully (0.007s)
Waf: Entering directory `/Users/isaacs/dev-src/js/node-usb/build'
[1/3] cxx: src/node_usb.cc -> build/default/src/node_usb_1.o
[2/3] cxx: src/bindings.cc -> build/default/src/bindings_1.o
[3/3] cxx_link: build/default/src/node_usb_1.o build/default/src/bindings_1.o -> build/default/usb_bindings.node
ld: warning: directory '/lib' following -L not found
Waf: Leaving directory `/Users/isaacs/dev-src/js/node-usb/build'
'build' finished successfully (0.761s)
node-usb [../src/node_usb.cc:init() 21]: Initalizing NodeUsb
node-usb [../src/node_usb.cc:InitalizeAll() 6]: Entering
node-usb [../src/bindings.cc:InitalizeUsb() 80]: Entering
node-usb [../src/bindings.cc:InitalizeUsb() 146]: Leave
node-usb [../src/bindings.cc:InitalizeDevice() 288]: Entering...
node-usb [../src/bindings.cc:InitalizeDevice() 315]: Leave
{ LIBUSB_CLASS_PER_INTERFACE: 0,
  isLibusbInitalized: false,
  LIBUSB_CLASS_AUDIO: 1,
  LIBUSB_CLASS_COMM: 2,
  LIBUSB_CLASS_HID: 3,
  LIBUSB_CLASS_PRINTER: 7,
  LIBUSB_CLASS_PTP: 6,
  LIBUSB_CLASS_MASS_STORAGE: 8,
  LIBUSB_CLASS_HUB: 9,
  LIBUSB_CLASS_DATA: 10,
  LIBUSB_CLASS_VENDOR_SPEC: 255,
  LIBUSB_DT_DEVICE: 1,
  LIBUSB_DT_CONFIG: 2,
  LIBUSB_DT_STRING: 3,
  LIBUSB_DT_INTERFACE: 4,
  LIBUSB_DT_ENDPOINT: 5,
  LIBUSB_DT_HID: 33,
  LIBUSB_DT_REPORT: 34,
  LIBUSB_DT_PHYSICAL: 35,
  LIBUSB_DT_HUB: 41,
  LIBUSB_ENDPOINT_IN: 128,
  LIBUSB_ENDPOINT_OUT: 0,
  LIBUSB_TRANSFER_TYPE_CONTROL: 0,
  LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: 1,
  LIBUSB_TRANSFER_TYPE_BULK: 2,
  LIBUSB_TRANSFER_TYPE_INTERRUPT: 3,
  LIBUSB_ISO_SYNC_TYPE_NONE: 0,
  LIBUSB_ISO_SYNC_TYPE_ASYNC: 1,
  LIBUSB_ISO_SYNC_TYPE_ADAPTIVE: 2,
  LIBUSB_ISO_SYNC_TYPE_SYNC: 3,
  LIBUSB_ISO_USAGE_TYPE_DATA: 0,
  LIBUSB_ISO_USAGE_TYPE_FEEDBACK: 1,
  LIBUSB_ISO_USAGE_TYPE_IMPLICIT: 2 }
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
node-usb [../src/bindings.cc:New() 335]: New Device object created
node-usb [../src/bindings.cc:Device() 319]: Assigning libusb_device structure to self
/bin/sh: line 1: 87285 Segmentation fault      node tests/node-usb-test.js
make: *** [make] Error 139

gdb says this about it:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00000001005f4237 in darwin_get_active_config_descriptor ()

usb_bindings.node: undefined symbol: ev_rt_now

I changed the dependencies with the commit 435e8b9 the dependencies from libev to libuv.

After compiling the module under v0.5.9 I get the error "usb_bindings.node: undefined symbol: ev_rt_now".
v0.6.7 and pre-v0.7.0 returns "unable to load shared library node usb_bindings.node" - with gdb (http://stackoverflow.com/questions/8701240/unable-to-load-nowjs-now-js) I get the same error "undefined symbol: ev_rt_now".

nm usb_bindings | grep "ev" returns

0001019c t ev_now
00013fd5 t ev_now
U ev_ref
U ev_rt_now
U ev_run
000073c1 t ev_unloop
00007889 t ev_unloop

Environment: 2.6.35-31-generic #63-Ubuntu SMP Mon Nov 28 19:23:11 UTC 2011 i686 GNU/Linux

Error: The specified procedure could not be found.

I'm trying to use node-usb in an appjs app (node.exe v0.8.21). I got libusbx and node-usb built/installed, and my app runs fine until i add "var usb = require('usb')" to the top. Now when i run the app i get:

C:\Users\bharrell\Desktop\test\app\data>.\bin\node.exe --harmony .\app.js

C:\Users\bharrell\Desktop\test\app\data\node_modules\usb\node_modules\bindings\bindings.js:79
throw e
^
Error: The specified procedure could not be found.
C:\Users\bharrell\Desktop\test\app\data\node_modules\usb\build\Release\usb_bindings.node
at Object.Module._extensions..node (module.js:485:11)
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 bindings (C:\Users\bharrell\Desktop\test\app\data\node_modules\usb\node_modules\bindings\bindings.js:74:15)
at Object. (C:\Users\bharrell\Desktop\test\app\data\node_modules\usb\usb.js:1:119)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.