Giter Club home page Giter Club logo

node-serialport's Introduction

Node Serialport

Backers on Open Collective Sponsors on Open Collective lerna codecov Test / Lint

Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!

Go to https://serialport.io/ to learn more, find guides and api documentation.

Quick Links

Developing

Developing node serialport projects

  1. Clone this repo git clone [email protected]:serialport/node-serialport.git
  2. Run npm install to setup local package dependencies (run this any time you depend on a package local to this repo)
  3. Run npm test to ensure everything is working properly
  4. Add dev dependencies to the root package.json and package dependencies to the package's one.

Developing Docs

See https://github.com/serialport/website

License

SerialPort packages are all MIT licensed and all it's dependencies are MIT licensed.

Code of Conduct

SerialPort follows the Nodebots Code of Conduct. While the code is MIT licensed participation in the community has some rules to make this a good place to work and learn.

TLDR

  • Be respectful.
  • Abusive behavior is never tolerated.
  • Data published to NodeBots is hosted at the discretion of the service administrators, and may be removed.
  • Don't build evil robots.
  • Violations of this code may result in swift and permanent expulsion from the NodeBots community.

Governance and Community

SerialPort is currently employees a governance with a group of maintainers, committers and contributors, all fixing bugs and adding features and improving documentation. You need not apply to work on SerialPort, all are welcome to join, build, and maintain this project.

  • A Contributor is any individual creating or commenting on an issue or pull request. By participating, this is you.
  • Committers are contributors who have been given write access to the repository. They can review and merge pull requests.
  • Maintainers are committers representing the required technical expertise to resolve rare disputes.

If you have a PR that improves the project people in any or all of the above people will help you land it.

Maintainers

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

node-serialport's People

Contributors

adrai avatar akajes avatar chalkers avatar deadprogram avatar dependabot[bot] avatar dsanders11 avatar edgarsilva avatar fivdi avatar gazhank avatar giseburt avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hipsterbrown avatar jacobrosenthal avatar jaybeavers avatar jgautier avatar jgillick avatar joeferner avatar mscdex avatar pmhpereira avatar programmarchy avatar reconbot avatar renovate-bot avatar renovate[bot] avatar rwaldron avatar stewart avatar timnew avatar tootallnate avatar tuna-f1sh avatar vdesmedt 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  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

node-serialport's Issues

Baudrate defaults to 38400

It seems the default baudrate is set to 38400 not 9600 as you say in the wiki. So when I do an npm update, I have to manually edit the serialport.js to set it to 9600. Not a major, issue as can be overridden, but might help to make it easier to use.

doesn't seem to work with Silicon Labs USBtoUART adaptor?

Maybe I'm messing up something - I'm able to talk to an arduino via node-serialport, but not to an industrial stepper motor which is connected via a SiLabs CP210x USB-to-RS485 dongle. There is no data transmitted nor received, the process just seems to wait forever (but without blocking).

I sent and received data via CoolTerm, pySerial/miniterm.py, and even my C reference implementation with exactly the same port configuration (I compared my C code to serialport_native.cc) is working - cf. http://pastie.org/3452151

There is a strange thing I noticed with the following setup:

  1. I start my node.js script, set it to wait for several seconds via a setTimeout after opening the port
  2. I execute my C-Program, within this time, in another terminal
    result: after the timeout passes, everything is working fine and data will be transmitted.

Without executing C-program (which seems to do a tiny bit different, although it looks quite the same to your code), no data will be transmitted after the timeout.

I also tried @jaredhanson 's fork in the hope that it might work better with libuv, but to no avail.

What am I doing wrong? Is there a device-dependent incompatibility? These unforeseeable problems with every node-based project will drive me crazy some day... sigh.

Please, take a look - maybe you'll notice something I'm missing.

OS X 10.7.3 node 0.6.9-0.6.11

No serial device error

I would like to create a soft landing for the case of no serial device connected when attempting to use node-serialport. Right now node-serialport works beautifully except, if I start my code and the serial device is not connected then I get this error:

open_port: Unable to open /dev/ttyS0 - : No such file or directory
node: ../deps/libev/ev.c:2668: ev_io_start: Assertion `("libev: ev_io_start called with negative fd", fd >= 0)' failed.
Aborted

I thought the problem was in this line in serialport.js:
this.fd = serialport_native.open(this.port, options.baudrate, options.databits, options.stopbits, options.parity, options.flowcontrol);

So I tried, no pun intended, to put this line in a try catch block like so:

try{
this.fd = serialport_native.open(this.port, options.baudrate, options.databits, options.stopbits, options.parity, options.flowcontrol);
}
catch(e){
me.emit("error", (e ? e :"Could not open port" + e.message));
me.close();
}

No joy. Am I barking up the wrong tree? Code problem? The best solution seems like it should be for the constructor to return null or something so a test of goodness could be done at the point?

Any thoughts would be great. I am a bit new here in node land so I may need a bit of spoon feeding.
Thanks

Issue with installing via NPM

When I try to run NPM install serialport I get a failure with the error below. I am able to install other modules fine, just not serialport. I am relatively inexperienced with linux,node, and npm and need some guidance on this issue.

This is the command that fails in the package.json
"cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../"

I have node Version 0.4.9 and NPM version 1.0.15 and was trying to install serialport version 0.2.8

lseek() on serial port not allowed

I came here searching about node.js + serial port, so I'm a first-timer on node.js but I think there's a no-sense line on this file: serialport_native/serialport_native.cc

At line 47 you are using lseek() function on the serial port fd, and from "man lseek" I get this information:

ERRORS:
ESPIPE fildes is associated with a pipe, socket, or FIFO.

RESTRICTIONS:
Linux specific restrictions: using lseek on a tty device
returns ESPIPE.

Since serial ports are tty devices. What's the point on using lseek?

As far as I'm concerned, using read() on the serial port will empty the receive FIFO and you'll always get all the content.

Failed to exec install script

When trying to install the duino package on OS X, the installation fails from being unable to run the install script for node-serialport. Here is the log from the installation:

info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'duino' ]
info using [email protected]
info using [email protected]
verbose config file /Users/eli/.npmrc
verbose config file /usr/local/etc/npmrc
verbose config file /usr/local/lib/node_modules/npm/npmrc
verbose caching /Users/eli/git/node_modules/clean-css/package.json
verbose caching /Users/eli/git/node_modules/semver/package.json
verbose caching /Users/eli/git/node_modules/shelljs/package.json
verbose caching /Users/eli/git/node_modules/rimraf/package.json
verbose cache add [ 'duino', null ]
silly cache add: name, spec, args [ undefined, 'duino', [ 'duino', null ] ]
verbose parsed url { pathname: 'duino', path: 'duino', href: 'duino' }
verbose addNamed [ 'duino', '' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'duino', '', false ]
verbose raw, before any munging duino
verbose url resolving [ 'https://registry.npmjs.org/', './duino' ]
verbose url resolved https://registry.npmjs.org/duino
verbose etag "8C2ORIHX2MJN3BTDA10BBSPFA"
http GET https://registry.npmjs.org/duino
http 304 https://registry.npmjs.org/duino
silly get cb [ 304,
silly get cb   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
silly get cb     etag: '"8C2ORIHX2MJN3BTDA10BBSPFA"',
silly get cb     date: 'Sun, 29 Apr 2012 01:21:04 GMT',
silly get cb     'content-length': '0' } ]
verbose etag duino from cache
silly name, range, hasData 2 [ 'duino', '', true ]
silly versions [ 'duino',
silly versions   [ '0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6' ] ]
verbose bin dist [ '0.6-ares1.7.5-DEV-evundefined-openssl0.9.8r-v83.6.6.24-darwin-x64-11.3.0',
verbose bin dist   { shasum: '354fa29013f52ab5330edfbf56cbc1618c9e61ef',
verbose bin dist     tarball: 'http://registry.npmjs.org/duino/-/duino-0.0.6.tgz' } ]
verbose caching /Users/eli/.npm/duino/0.0.6/package/package.json
verbose loadDefaults [email protected]
silly resolved [ { author: 
silly resolved      { name: 'Cam Pedersen',
silly resolved        email: '[email protected]',
silly resolved        url: 'http://campedersen.com/' },
silly resolved     contributors: 
silly resolved      [ { name: 'Rick Waldron', email: '[email protected]' },
silly resolved        { name: 'Leonhardt Wille', email: '[email protected]' } ],
silly resolved     name: 'duino',
silly resolved     description: 'Arduino framework for mad scientists',
silly resolved     version: '0.0.6',
silly resolved     keywords: [ 'arduino', 'serial', 'framework' ],
silly resolved     repository: { type: 'git', url: 'git://github.com/ecto/duino.git' },
silly resolved     main: 'index.js',
silly resolved     engines: { node: '*' },
silly resolved     dependencies: { serialport: '*', colors: '*' },
silly resolved     devDependencies: {},
silly resolved     _id: '[email protected]',
silly resolved     optionalDependencies: {},
silly resolved     _engineSupported: true,
silly resolved     _npmVersion: '1.1.16',
silly resolved     _nodeVersion: 'v0.6.15',
silly resolved     _defaultsLoaded: true,
silly resolved     _from: 'duino',
silly resolved     scripts: {} } ]
info into /Users/eli/git [email protected]
info installOne [email protected]
verbose from cache /Users/eli/.npm/duino/0.0.6/package/package.json
info unbuild /Users/eli/git/node_modules/duino
verbose unpack /Users/eli/.npm/duino/0.0.6/package.tgz
silly gunzTarPerm modes [ '755', '644' ]
silly extracting entry .npmignore
silly extracting entry examples/
silly extracting entry examples/analogled.js
silly extracting entry examples/basic.js
silly extracting entry examples/button.js
silly extracting entry examples/combination.js
silly extracting entry examples/led.js
silly extracting entry examples/piezo.js
silly extracting entry examples/ping.js
silly extracting entry examples/pir.js
silly extracting entry examples/sensor-throttled.js
silly extracting entry examples/sensor.js
silly extracting entry examples/servo.js
silly extracting entry index.js
silly extracting entry lib/
silly extracting entry lib/board.js
silly extracting entry lib/button.js
silly extracting entry lib/led.js
silly extracting entry lib/piezo.js
silly extracting entry lib/ping.js
silly extracting entry lib/pir.js
silly extracting entry lib/sensor.js
silly extracting entry lib/servo.js
silly extracting entry package.json
silly extracting entry README.md
silly extracting entry src/
silly extracting entry src/du.ino
verbose caching /Users/eli/git/node_modules/duino/package.json
verbose loadDefaults [email protected]
info preinstall [email protected]
verbose from cache /Users/eli/git/node_modules/duino/package.json
verbose readDependencies: using package.json deps
verbose from cache /Users/eli/git/node_modules/duino/package.json
verbose readDependencies: using package.json deps
verbose cache add [ 'serialport@*', null ]
silly cache add: name, spec, args [ undefined, 'serialport@*', [ 'serialport@*', null ] ]
verbose parsed url { pathname: 'serialport@*',
verbose parsed url   path: 'serialport@*',
verbose parsed url   href: 'serialport@*' }
silly cache add: name, spec, args [ 'serialport', '*', [ 'serialport', '*' ] ]
verbose parsed url { pathname: '*', path: '*', href: '*' }
verbose addNamed [ 'serialport', '*' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'serialport', '', false ]
verbose raw, before any munging serialport
verbose url resolving [ 'https://registry.npmjs.org/', './serialport' ]
verbose url resolved https://registry.npmjs.org/serialport
verbose etag "CU3K8FUYQMAZJPF1SFAC2K0Q2"
http GET https://registry.npmjs.org/serialport
verbose cache add [ 'colors@*', null ]
silly cache add: name, spec, args [ undefined, 'colors@*', [ 'colors@*', null ] ]
verbose parsed url { pathname: 'colors@*', path: 'colors@*', href: 'colors@*' }
silly cache add: name, spec, args [ 'colors', '*', [ 'colors', '*' ] ]
verbose parsed url { pathname: '*', path: '*', href: '*' }
verbose addNamed [ 'colors', '*' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'colors', '', false ]
verbose raw, before any munging colors
verbose url resolving [ 'https://registry.npmjs.org/', './colors' ]
verbose url resolved https://registry.npmjs.org/colors
verbose etag "E67K86DW20A25PWKB29742EU5"
http GET https://registry.npmjs.org/colors
http 304 https://registry.npmjs.org/serialport
silly get cb [ 304,
silly get cb   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
silly get cb     etag: '"CU3K8FUYQMAZJPF1SFAC2K0Q2"',
silly get cb     date: 'Sun, 29 Apr 2012 01:21:05 GMT',
silly get cb     'content-length': '0' } ]
verbose etag serialport from cache
silly name, range, hasData 2 [ 'serialport', '', true ]
silly versions [ 'serialport',
silly versions   [ '0.1.0',
silly versions     '0.1.1',
silly versions     '0.1.3',
silly versions     '0.2.0',
silly versions     '0.2.2',
silly versions     '0.2.3',
silly versions     '0.2.4',
silly versions     '0.2.5',
silly versions     '0.2.6',
silly versions     '0.2.7',
silly versions     '0.2.8',
silly versions     '0.2.9',
silly versions     '0.3.0',
silly versions     '0.6.0',
silly versions     '0.6.1',
silly versions     '0.6.2',
silly versions     '0.6.3',
silly versions     '0.6.5',
silly versions     '0.6.6',
silly versions     '0.6.7',
silly versions     '0.7.0',
silly versions     '0.7.1',
silly versions     '0.7.2',
silly versions     '0.7.3' ] ]
verbose bin dist [ '0.6-ares1.7.5-DEV-evundefined-openssl0.9.8r-v83.6.6.24-darwin-x64-11.3.0',
verbose bin dist   { shasum: 'dae69a5455bb4fa95f844aa643d1c9da89949e92',
verbose bin dist     tarball: 'http://registry.npmjs.org/serialport/-/serialport-0.7.3.tgz' } ]
verbose caching /Users/eli/.npm/serialport/0.7.3/package/package.json
verbose loadDefaults [email protected]
http 304 https://registry.npmjs.org/colors
silly get cb [ 304,
silly get cb   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
silly get cb     etag: '"E67K86DW20A25PWKB29742EU5"',
silly get cb     date: 'Sun, 29 Apr 2012 01:21:05 GMT',
silly get cb     'content-length': '0' } ]
verbose etag colors from cache
silly name, range, hasData 2 [ 'colors', '', true ]
silly versions [ 'colors', [ '0.3.0', '0.5.0', '0.5.1', '0.6.0', '0.6.0-1' ] ]
verbose bin dist [ '0.6-ares1.7.5-DEV-evundefined-openssl0.9.8r-v83.6.6.24-darwin-x64-11.3.0',
verbose bin dist   { shasum: '6dbb68ceb8bc60f2b313dcc5ce1599f06d19e67a',
verbose bin dist     tarball: 'http://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz' } ]
verbose caching /Users/eli/.npm/colors/0.6.0-1/package/package.json
verbose loadDefaults [email protected]
silly resolved [ { name: 'serialport',
silly resolved     version: '0.7.3',
silly resolved     description: 'Welcome your robotic javascript overlords. Better yet, program them!',
silly resolved     author: { name: 'Chris Williams', email: '[email protected]' },
silly resolved     main: './serialport',
silly resolved     repository: 
silly resolved      { type: 'git',
silly resolved        url: 'git://github.com/voodootikigod/node-serialport.git' },
silly resolved     scripts: { install: 'cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../' },
silly resolved     engines: { node: '0.6' },
silly resolved     _id: '[email protected]',
silly resolved     contributors: 
silly resolved      [ { name: 'Chris Williams', email: '[email protected]' },
silly resolved        { name: 'Esa-Matti Suuronen', email: '[email protected]' },
silly resolved        { name: 'Nathan Rajlich', email: '[email protected]' },
silly resolved        { name: 'Rick Waldron', email: '[email protected]' },
silly resolved        { email: 'w1nk' },
silly resolved        { name: 'Georges-Etienne Legendre', email: 'legege' },
silly resolved        { name: 'Duane Johnson', email: '[email protected]' } ],
silly resolved     dependencies: {},
silly resolved     devDependencies: {},
silly resolved     optionalDependencies: {},
silly resolved     _engineSupported: true,
silly resolved     _npmVersion: '1.1.16',
silly resolved     _nodeVersion: 'v0.6.15',
silly resolved     _defaultsLoaded: true,
silly resolved     _from: 'serialport@*' },
silly resolved   { name: 'colors',
silly resolved     description: 'get colors in your node.js console like what',
silly resolved     version: '0.6.0-1',
silly resolved     author: { name: 'Marak Squires' },
silly resolved     repository: { type: 'git', url: 'git://github.com/Marak/colors.js.git' },
silly resolved     engines: { node: '>=0.1.90' },
silly resolved     main: 'colors',
silly resolved     _id: '[email protected]',
silly resolved     dependencies: {},
silly resolved     devDependencies: {},
silly resolved     optionalDependencies: {},
silly resolved     _engineSupported: true,
silly resolved     _npmVersion: '1.1.16',
silly resolved     _nodeVersion: 'v0.6.15',
silly resolved     _defaultsLoaded: true,
silly resolved     _from: 'colors@*',
silly resolved     scripts: {} } ]
info into /Users/eli/git/node_modules/duino [email protected]
info into /Users/eli/git/node_modules/duino [email protected]
info installOne [email protected]
info installOne [email protected]
verbose from cache /Users/eli/.npm/serialport/0.7.3/package/package.json
info unbuild /Users/eli/git/node_modules/duino/node_modules/serialport
verbose from cache /Users/eli/.npm/colors/0.6.0-1/package/package.json
info unbuild /Users/eli/git/node_modules/duino/node_modules/colors
verbose unpack /Users/eli/.npm/serialport/0.7.3/package.tgz
verbose unpack /Users/eli/.npm/colors/0.6.0-1/package.tgz
silly gunzTarPerm modes [ '755', '644' ]
silly gunzTarPerm modes [ '755', '644' ]
silly extracting entry .npmignore
silly extracting entry colors.js
silly extracting entry AUTHORS
silly extracting entry changelog.md
silly extracting entry example.html
silly extracting entry example.js
silly extracting entry MIT-LICENSE.txt
silly extracting entry package.json
silly extracting entry ReadMe.md
silly extracting entry test.js
silly extracting entry examples/
silly extracting entry examples/logger.js
silly extracting entry LICENSE
silly extracting entry Makefile
silly extracting entry package.json
silly extracting entry README.md
silly extracting entry sampleport
silly extracting entry serialport.js
silly extracting entry serialport_native/
silly extracting entry serialport_native/serialport_native.cc
silly extracting entry serialport_native/serialport_native.h
silly extracting entry serialport_native/wscript
silly extracting entry tests/
silly extracting entry tests/arduino-ldr-read.js
silly extracting entry tests/arduino-ldr-read.pde
silly extracting entry tests/test_read.js
silly extracting entry tests/test_write.js
silly extracting entry tests/test_zwave.js
verbose caching /Users/eli/git/node_modules/duino/node_modules/colors/package.json
verbose loadDefaults [email protected]
info preinstall [email protected]
verbose from cache /Users/eli/git/node_modules/duino/node_modules/colors/package.json
verbose readDependencies: using package.json deps
verbose from cache /Users/eli/git/node_modules/duino/node_modules/colors/package.json
verbose readDependencies: using package.json deps
silly resolved []
verbose about to build /Users/eli/git/node_modules/duino/node_modules/colors
info build /Users/eli/git/node_modules/duino/node_modules/colors
verbose from cache /Users/eli/git/node_modules/duino/node_modules/colors/package.json
verbose linkStuff [ false,
verbose linkStuff   false,
verbose linkStuff   false,
verbose linkStuff   '/Users/eli/git/node_modules/duino/node_modules' ]
info linkStuff [email protected]
verbose linkBins [email protected]
verbose linkMans [email protected]
verbose rebuildBundles [email protected]
info install [email protected]
info postinstall [email protected]
verbose caching /Users/eli/git/node_modules/duino/node_modules/serialport/package.json
verbose loadDefaults [email protected]
info preinstall [email protected]
verbose from cache /Users/eli/git/node_modules/duino/node_modules/serialport/package.json
verbose readDependencies: using package.json deps
verbose from cache /Users/eli/git/node_modules/duino/node_modules/serialport/package.json
verbose readDependencies: using package.json deps
silly resolved []
verbose about to build /Users/eli/git/node_modules/duino/node_modules/serialport
info build /Users/eli/git/node_modules/duino/node_modules/serialport
verbose from cache /Users/eli/git/node_modules/duino/node_modules/serialport/package.json
verbose linkStuff [ false,
verbose linkStuff   false,
verbose linkStuff   false,
verbose linkStuff   '/Users/eli/git/node_modules/duino/node_modules' ]
info linkStuff [email protected]
verbose linkBins [email protected]
verbose linkMans [email protected]
verbose rebuildBundles [email protected]
info install [email protected]
verbose unsafe-perm in lifecycle true
silly exec sh "-c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../"
silly spawning [ 'sh',
silly spawning   [ '-c',
silly spawning     'cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../' ],
silly spawning   '/Users/eli/git/node_modules/duino/node_modules/serialport' ]
info [email protected] Failed to exec install script
info unbuild /Users/eli/git/node_modules/duino/node_modules/serialport
verbose from cache /Users/eli/git/node_modules/duino/node_modules/serialport/package.json
info preuninstall [email protected]
info uninstall [email protected]
verbose unbuild [email protected] [ false,
verbose unbuild [email protected]   '/Users/eli/git/node_modules',
verbose unbuild [email protected]   '/Users/eli/git/node_modules/duino/node_modules' ]
info postuninstall [email protected]
verbose about to build /Users/eli/git/node_modules/duino
info unbuild /Users/eli/git/node_modules/duino
verbose from cache /Users/eli/git/node_modules/duino/package.json
info preuninstall [email protected]
info uninstall [email protected]
verbose unbuild [email protected] [ true,
verbose unbuild [email protected]   '/Users/eli/git/node_modules',
verbose unbuild [email protected]   '/Users/eli/git/node_modules' ]
info postuninstall [email protected]
ERR! [email protected] install: `cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../`
ERR! `sh "-c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../"` failed with 1
ERR! 
ERR! Failed at the [email protected] install script.
ERR! This is most likely a problem with the serialport package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR!     cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../
ERR! You can get their info via:
ERR!     npm owner ls serialport
ERR! There is likely additional logging output above.
ERR! 
ERR! System Darwin 11.3.0
ERR! command "node" "/usr/local/bin/npm" "install" "duino"
ERR! cwd /Users/eli/git/arduino
ERR! node -v v0.6.15
ERR! npm -v 1.1.16
ERR! code ELIFECYCLE
ERR! message [email protected] install: `cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../`
ERR! message `sh "-c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../"` failed with 1
ERR! errno {}
verbose exit [ 1, true ]

Bindings failing on OS X 10.8

I have xcode installed with command line tools and did node-gyp configure build on node_modules/serialport which also succeeded.

Error: Could not load the bindings file. Tried:

Issue

I'm using node 0.2.0

I know it's failing at serialport.js within method SerialPort.prototype.read

data_read = serialport_native.read(this.fd, buff);

Assertion failed: (handle->InternalFieldCount() > 0), function Unwrap, file /usr/local/include/node/node_object_wrap.h, line 28

Most likely related to Node version.

Error: global leak detected: closing

When running a Mocha unit test against a library that uses node-serialport, I hit this error when calling serialPort.close(callback). Mocha has a nice side effect that in addition to being a nice unit test framework, it finds these issues.

May I submit a pull request with a fix?

Problems installing?

using
node 0.6.6
npm 1.1.0-beta-4

npm install :

npm ERR! [email protected] install: cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../
npm ERR! sh "-c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../" failed with 1

npm link:

npm ERR! [email protected] install: cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../
npm ERR! sh "-c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../" failed with 1

node-waf configure build:

Traceback (most recent call last):
File "/opt/local/bin/node-waf", line 14, in
import Scripting
ImportError: No module named Scripting

undefined symbol: ev_rt_now error running tests

Have installed serialport using Node v0.7.8 on Ubuntu 10.04.

Installation is fine. When running the tests I get an error

Error: /home/anand/node-serialport/build/default/serialport_native.node: undefined symbol: ev_rt_now

Opening SerialPort on BeagleBone causes Fatal Error

I'm trying to use the serial ports on a BeagleBone. When I create a new serail port object it immediately crashes with
FATAL ERROR: v8::HandleScope::Close() Local scope has already been closed.

I have run my code on a regular machine and it works properly. So this seems to be an architecture issue (BeagleBone runs on an arm7). I'm not sure where to begin to look for the issue, but I would gladly accept some pointers.

Here is the function where it is failing:

var openSerialPort = function () {
    port = new serialPort.SerialPort (UART_CONFIG.uart1.path, {
        baudRate : 9600,
        parser : serialPort.parsers.raw
    });
    console.log ("Serial Port setup and running...");
    port.on ("data", function (data) {
        port.write (data);  
            console.log (data);
    });
    port.on ('close', function (data) {
        console.log ('serialport closed');
    });
};

If you are interested, this is the rest of the file containing the function.

Request API for DTR

Please consider adding support for changing DTR. DTR is used to reset Arduino. Would be nice to soft reset Arduino when things go wrong. Thanx.

confusion between option names

Unable to set baudrate correctly because option is named "baudrate" but internally in serialport.js, "baudRate" is used. This is the same for other options. Choosing between camelCase or lower case is needed.

Personnally, I'd prefer plain lower case.

serialport_native - "no suitable image found" on OSX

I'm getting the following on OSX 10.7.4, Macbook Pro Retina, Node 0.8.0:
Error while loading the serial port module [Error: dlopen(/Users/jyoung/node_modules/serialport/build/Release/serialport_native.node, 1): no suitable image found. Did find:
/Users/jyoung/node_modules/serialport/build/Release/serialport_native.node: mach-o, but wrong architecture]

Ran LIPO:
lipo -info /Users/jyoung/node_modules/serialport/build/Release/serialport_native.node
Non-fat file: /Users/jyoung/node_modules/serialport/build/Release/serialport_native.node is architecture: i386

It's working fine on an iMac that had Node 0.6.0 and the serialport package previously installed and then upgraded.

not working on OSX

Hi, running test_read.js on OSX 10.6, using an Arduino, crashes/freezes the machine, which makes me to reboot.

variable 'me' is not defined in read()

diff --git a/serialport.js b/serialport.js
index d4c8370..0daab31 100644
--- a/serialport.js
+++ b/serialport.js
@@ -55,6 +55,7 @@ function SerialPort(path) {
sys.inherits(SerialPort, events.EventEmitter);

SerialPort.prototype.read = function () {

  • var me = this;
    if (this.fd) {
    sys.puts("callback");
    var buff = new Buffer(65535);
    @@ -83,4 +84,4 @@ SerialPort.prototype.write = function (buffer) {
    }

-exports.SerialPort = SerialPort;
\ No newline at end of file
+exports.SerialPort = SerialPort;

npm install fails (node 0.8)

10.7 OSX, any hints? :-(

// Okay, i saw 0.8 was released yesterday. i am new to node.js and didn't know it. :)

wiesel:duino arnewiese$ npm install serialport
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport

> [email protected] install /Users/arnewiese/Sites/noduino/duino/node_modules/serialport
> cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../

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 node path                   : not found 
Checking for node prefix                 : ok /usr/local 
'configure' finished successfully (0.066s)
Waf: Entering directory `/Users/arnewiese/Sites/noduino/duino/node_modules/serialport/serialport_native/build'
[1/2] cxx: serialport_native.cc -> build/Release/serialport_native_1.o
In file included from ../serialport_native.cc:3:
../serialport_native.h:6:25: error: node_events.h: No such file or directory
Waf: Leaving directory `/Users/arnewiese/Sites/noduino/duino/node_modules/serialport/serialport_native/build'
Build failed:  -> task failed (err #1): 
    {task: cxx serialport_native.cc -> serialport_native_1.o}
cp: build/default/serialport_native.node: No such file or directory
npm ERR! [email protected] install: `cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../`
npm ERR! `sh "-c" "cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../
npm ERR! You can get their info via:
npm ERR!     npm owner ls serialport
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" "serialport"
npm ERR! cwd /Users/arnewiese/Sites/noduino/duino
npm ERR! node -v v0.8.0
npm ERR! npm -v 1.1.32
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../`
npm ERR! message `sh "-c" "cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../"` failed with 1
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/arnewiese/Sites/noduino/duino/npm-debug.log
npm ERR! not ok code 0

failed to install on mac os x 10.8

I am getting the following error when installing with npm:

npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.

serialport installation failed - The system cannot find the path specified.

I am running nodejs on windows 7, version for nodejs is v0.6.9 and version for npm is 1.1.0-3.

The error is :

[email protected] install C:\Program Files\nodejs\node_modules\serialport
cd serialport_native;node-waf configure build;cp build/Release/serialport_nati
ve.node ../

The system cannot find the path specified.
npm ERR! error installing [email protected]

npm ERR! [email protected] install: cd serialport_native;node-waf configure buil d;cp build/Release/serialport_native.node ../
npm ERR! cmd "/c" "cd serialport_native;node-waf configure build;cp build/Relea se/serialport_native.node ../" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cd serialport_native;node-waf configure build;cp build/Release/seri
alport_native.node ../
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "serialport"
npm ERR! cwd C:\Program Files\nodejs
npm ERR! node -v v0.6.9
npm ERR! npm -v 1.1.0-3
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: cd serialport_native;node-waf config ure build;cp build/Release/serialport_native.node ../
npm ERR! message cmd "/c" "cd serialport_native;node-waf configure build;cp bui ld/Release/serialport_native.node ../" failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Program Files\nodejs\npm-debug.log
npm not ok

How can I fix it

Unable to load shared library ... serialport_native.node

I'm flummoxed. I think I have everything set up correctly, but I keep getting an error when I try to load the serialport module. (I'm using Ubuntu 11.10)

jeff@mega:/storage/projects/tempbrain$ npm rebuild serialport

[email protected] install /storage/projects/tempbrain/node_modules/serialport
cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../

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 node path : ok /home/jeff/local/lib
Checking for node prefix : ok /home/jeff/local
'configure' finished successfully (0.213s)
Waf: Entering directory /storage/projects/tempbrain/node_modules/serialport/serialport_native/build' Waf: Leaving directory/storage/projects/tempbrain/node_modules/serialport/serialport_native/build'
'build' finished successfully (0.054s)
[email protected] /storage/projects/tempbrain/node_modules/serialport

jeff@mega:/storage/projects/tempbrain$ cat barebones.js
var serialport = require("serialport");

jeff@mega:/storage/projects/tempbrain$ node barebones.js

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Unable to load shared library /storage/projects/tempbrain/node_modules/serialport/serialport_native.node
at Object..node (module.js:463:11)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object. (/storage/projects/tempbrain/node_modules/serialport/serialport.js:11:28)
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)

jeff@mega:/storage/projects/tempbrain$ node --version
v0.6.1

jeff@mega:/storage/projects/tempbrain$ npm --version
1.1.1

I'm not sure what else to try. Is there some other part of my environment that's not set up correctly? Any ideas would be greatly appreciated.

Raw Data Timer

Hello, apologies, this is not an issue but a question. I cannot find a forum on node-serialport, so I'm hoping for some guidance here. The trouble I am having is that the node-serialport is too fast! Does anyone know where and how the raw parser decides when it should output a buffer? For me, it seems good at detecting the interval between different 'messages' however on occasion it will split the message into two buffered 'data' events. I'm not sure how the serialport decides when to output the buffer, but I'm hoping to increase the interval --- I'll certainly need to build my own parser, but this would help with some stability and testing. Thank you! Graeme

Is SerialPort.prototype.write non-blocking?

Hi Chris,

Apologies, I'm not familiar with C bindings and just learning nodejs, but from the source I do not see callbacks and am not familiar with the underlying C write() operation being used to know if it is non-blocking. Can you confirm?

For interest, I have an insteon PLM (home automation) parser working that I will contribute alongside the z-wave example once I am confident it is written correctly :)

Thanks

How to install serialport on node.js Beaglebone, Ångström

Hello

I'm trying to install serialport on the Beagle Bone with Ångström distribution but get the following error on installation

root@beaglebone:~# npm install -f serialport
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/serialport/-/serialport-1.0.3.tgz
npm http 200 https://registry.npmjs.org/serialport/-/serialport-1.0.3.tgz
npm http GET https://registry.npmjs.org/bindings/0.3.0
npm http GET https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/sf/0.1.3
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/async/-/async-0.1.18.tgz
npm http 304 https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/optimist/-/optimist-0.3.4.tgz
npm http 304 https://registry.npmjs.org/bindings/0.3.0
npm http GET https://registry.npmjs.org/bindings/-/bindings-0.3.0.tgz
npm http 304 https://registry.npmjs.org/sf/0.1.3
npm http GET https://registry.npmjs.org/sf/-/sf-0.1.3.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.1.18.tgz
npm http 200 https://registry.npmjs.org/bindings/-/bindings-0.3.0.tgz
npm http 200 https://registry.npmjs.org/optimist/-/optimist-0.3.4.tgz
npm http 200 https://registry.npmjs.org/sf/-/sf-0.1.3.tgz
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz

[email protected] install /home/root/node_modules/serialport
node-gyp rebuild

info it worked if it ends with ok
spawn python [ '/home/root/.node-gyp/0.6.18/tools/gyp_addon',
'binding.gyp',
'-I/home/root/node_modules/serialport/build/config.gypi',
'-f',
'make' ]
Traceback (most recent call last):
File "/home/root/.node-gyp/0.6.18/tools/gyp_addon", line 14, in
import gyp
File "/home/root/.node-gyp/0.6.18/tools/gyp/pylib/gyp/init.py", line 8, in
import gyp.input
File "/home/root/.node-gyp/0.6.18/tools/gyp/pylib/gyp/input.py", line 5, in
from compiler.ast import Const
ImportError: No module named compiler.ast
ERR! Error: gyp_addon failed with exit code: 1
at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:226:16)
at ChildProcess.emit (events.js:70:17)
at maybeExit (child_process.js:362:16)
at Process.onexit (child_process.js:398:5)
ERR! not ok
npm ERR! forced, continuing Error: [email protected] install: node-gyp rebuild
npm ERR! forced, continuing sh "-c" "node-gyp rebuild" failed with 1
npm ERR! forced, continuing at ChildProcess. (/usr/lib/node_modules/npm/lib/utils/exec.js:58:20)
npm ERR! forced, continuing at ChildProcess.emit (events.js:70:17)
npm ERR! forced, continuing at maybeExit (child_process.js:362:16)
npm ERR! forced, continuing at Process.onexit (child_process.js:398:5)
[email protected] ./node_modules/serialport
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])

Node exit after new SerialPort()

A bit stumped, node script is causing exit without error on Windows, even when trying to capture unhandled exceptions using the "process.on" trick. Narrowed this behavior down to when I create a new SerialPort object.

System is Windows 7 Pro x64, using latest Node 0.8.3. Built libs using VS Express 2010.

Script works on Mac using same libraries without issue. Removing the new SerialPort() line resolves the issue, script works fine otherwise.

Here is sample program to repro and debug info. I'm not sure where else to look - maybe it's a bad compile, or some kind of 64-bit issue? It seems like the OS might be killing it but I don't see anything in Event Viewer (maybe I need to turn on more options in there?) Any troubleshooting help appreciated.

repro:

var connect = require('connect');
var SerialPort = require('serialport').SerialPort;
var argv = process.argv;

process.on('uncaughtException', function(err) {
console.log(err);
});

var serialPort = new SerialPort();

connect.createServer(
connect.static(__dirname)
).listen(argv[2] || 8082);

debug:

C:\Users\Steve\src\glomo>node debug wtf.js
< debugger listening on port 5858
connecting... ok
break in C:\Users\Steve\src\glomo\wtf.js:1
1 var connect = require('connect');
2 var SerialPort = require('serialport').SerialPort;
3 var argv = process.argv;
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:2
1 var connect = require('connect');
2 var SerialPort = require('serialport').SerialPort;
3 var argv = process.argv;
4
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:2
1 var connect = require('connect');
2 var SerialPort = require('serialport').SerialPort;
3 var argv = process.argv;
4
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:3
1 var connect = require('connect');
2 var SerialPort = require('serialport').SerialPort;
3 var argv = process.argv;
4
5 process.on('uncaughtException', function(err) {
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:5
3 var argv = process.argv;
4
5 process.on('uncaughtException', function(err) {
6 console.log(err);
7 });
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:9
7 });
8
9 var serialPort = new SerialPort();
10
11 connect.createServer(
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:12
10
11 connect.createServer(
12 connect.static(__dirname)
13 ).listen(argv[2] || 8082);
14
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:11
9 var serialPort = new SerialPort();
10
11 connect.createServer(
12 connect.static(__dirname)
13 ).listen(argv[2] || 8082);
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:16
14
15
16 });
debug> n
break in module.js:450
448 var args = [self.exports, require, self, filename, dirname];
449 return compiledWrapper.apply(self.exports, args);
450 };
451
452
debug> n
break in module.js:468
466 var content = NativeModule.require('fs').readFileSync(filename, 'utf8');
467 module._compile(stripBOM(content), filename);
468 };
469
470
debug> n
break in module.js:357
355 if (!Module._extensions[extension]) extension = '.js';
356 Module._extensions[extension](this, filename);
357 this.loaded = true;
358 };
359
debug> n
break in module.js:358
356 Module._extensions[extension](this, filename);
357 this.loaded = true;
358 };
359
360
debug> n
break in module.js:313
311 try {
312 module.load(filename);
313 hadException = false;
314 } finally {
315 if (hadException) {
debug> n
break in module.js:315
313 hadException = false;
314 } finally {
315 if (hadException) {
316 delete Module._cache[filename];
317 }
debug> n
break in module.js:320
318 }
319
320 return module.exports;
321 };
322
debug> n
break in module.js:321
319
320 return module.exports;
321 };
322
323 Module._resolveFilename = function(request, parent) {
debug> n
break in module.js:493
491 // Load the main module--the command line argument.
492 Module._load(process.argv[1], null, true);
493 };
494
495 Module._initPaths = function() {
debug> n
break in timers.js:106
104 process.emit('uncaughtException', e);
105 }
106 if (first.domain) first.domain.exit();
107 }
108 }
debug> n
break in timers.js:78
76
77 var first;
78 while (first = L.peek(list)) {
79 var diff = now - first._idleStart;
80 if (diff + 1 < msecs) {
debug> n
break in timers.js:110
108 }
109
110 debug(msecs + ' list empty');
111 assert(L.isEmpty(list));
112 list.close();
debug> n
break in timers.js:111
109
110 debug(msecs + ' list empty');
111 assert(L.isEmpty(list));
112 list.close();
113 delete lists[msecs];
debug> n
break in timers.js:112
110 debug(msecs + ' list empty');
111 assert(L.isEmpty(list));
112 list.close();
113 delete lists[msecs];
114 };
debug> n
break in timers.js:114
112 list.close();
113 delete lists[msecs];
114 };
115 }
116
debug> n
program terminated
debug>

Please add opened callback parameter to ctor

I'm writing a library that consumes node-serialport. I've found that if I call serialport.write(...) prior to receiving serialport.on('open') the data is lost without error. Fair enough.

The workaround is to wait for the open event to be received before calling write. This leads to an API design similar in pattern to the jQuery.ready(callback) approach. In node terms, my API looks like:

var serialPortClient = new SerialPortClient(path, options, callback);

internally map callback using:

var serialPort = new SerialPort(path, options);
if (callback) serialPort.once('open', callback);

This solves much of the issue. However it leave in place a potential race condition. What if SerialPort is so fast that the port gets opened between the new SerialPort ctor and the next line of code that hooks the open event?

imho, the best design would be if SerialPort had an API just like SerialPortClient above -- aka that it took as a 3rd parameter a callback function which is called once when the open event is fired. Internally SerialPort should ensure the callback is hooked prior to performing the C++ port open call.

If this design looks reasonable, I'm happy to fork and implement and submit a pull request.

Support for timeout

I would appreciate support for timeout so that the buffer content is sent it the timeout is reached.

Thanks,
David

OpenIndiana Development oi_151.1.5 X86 Build Failure

Hi
Putting this in as a note for others.
If you have any ideas great but I will look at it at the weekend

make: Entering directory `/home/anton/dev/arduino/noduino/node_modules/serialport/build'
  CXX(target) Release/obj.target/serialport/src/serialport.o
  CXX(target) Release/obj.target/serialport/src/serialport_unix.o
../src/serialport_unix.cpp: In function ‘int ToBaudConstant(int)’:
../src/serialport_unix.cpp:41:25: error: ‘B500000’ was not declared in this scope
../src/serialport_unix.cpp:42:25: error: ‘B576000’ was not declared in this scope
../src/serialport_unix.cpp:44:26: error: ‘B1000000’ was not declared in this scope
../src/serialport_unix.cpp:45:26: error: ‘B1152000’ was not declared in this scope
../src/serialport_unix.cpp:46:26: error: ‘B1500000’ was not declared in this scope
../src/serialport_unix.cpp:47:26: error: ‘B2000000’ was not declared in this scope
../src/serialport_unix.cpp:48:26: error: ‘B2500000’ was not declared in this scope
../src/serialport_unix.cpp:49:26: error: ‘B3000000’ was not declared in this scope
../src/serialport_unix.cpp:50:26: error: ‘B3500000’ was not declared in this scope
../src/serialport_unix.cpp:51:26: error: ‘B4000000’ was not declared in this scope
../src/serialport_unix.cpp: In function ‘void EIO_Open(uv_work_t*)’:
../src/serialport_unix.cpp:109:22: error: ‘FASYNC’ was not declared in this scope
make: *** [Release/obj.target/serialport/src/serialport_unix.o] Error 1
make: Leaving directory `/home/anton/dev/arduino/noduino/node_modules/serialport/build'
gyp ERR! rebuild error Error: `make` failed with exit code: 2
gyp ERR! rebuild error     at ChildProcess.onExit (/home/anton/github/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:214:23)
gyp ERR! rebuild error     at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error     at Process._handle.onexit (child_process.js:674:10)

Error Building on Windows XP

So I'm running from the Visual Studio Command Prompt. When I npm install serialport, I get this error:

C:\Documents and Settings\Administrator\serial-test>npm install serialport
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/sf/0.1.3
npm http GET https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/bindings/0.3.0
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/bindings/0.3.0
npm http 304 https://registry.npmjs.org/async/0.1.18
npm http 304 https://registry.npmjs.org/sf/0.1.3
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/wordwrap

> [email protected] install C:\Documents and Settings\Administrator\serial-test\n
ode_modules\serialport
> node-gyp rebuild


C:\Documents and Settings\Administrator\serial-test\node_modules\serialport>node
 "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\
node-gyp\bin\node-gyp.js" rebuild
info it worked if it ends with ok
spawn python [ 'C:\\Documents and Settings\\Administrator\\.node-gyp\\0.6.15\\to
ols\\gyp_addon',
  'binding.gyp',
  '-IC:\\Documents and Settings\\Administrator\\serial-test\\node_modules\\seria
lport\\build\\config.gypi',
  '-f',
  'msvs',
  '-G',
  'msvs_version=2010' ]
  File "C:\Documents and Settings\Administrator\.node-gyp\0.6.15\tools\gyp_addon
", line 40
    print 'Error running GYP'
                            ^
SyntaxError: invalid syntax
ERR! Error: `gyp_addon` failed with exit code: 1
    at Array.0 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\l
ib\configure.js:196:18)
    at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Windows_NT 5.1.2600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "serialport"
npm ERR! cwd C:\Documents and Settings\Administrator\serial-test
npm ERR! node -v v0.6.15
npm ERR! npm -v 1.1.16
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-gyp rebuild`
npm ERR! message `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Documents and Settings\Administrator\serial-test\npm-debug.log
npm not ok

I've tried a couple different builds of python (stackless and whatever the default one is).

Am I missing something here?

Failed to install on ARM/Raspberry Pi

I tried installing node-gyp globally but no dice. I got it working before with Raspbian/v0.6.9 with @paultag's help but can't get it working with Bodhi + v0.8.7.

Any suggestions?

pi@raspberrypi ~/foo $ sudo npm install serialport
[sudo] password for pi:
npm http GET https://registry.npmjs.org/serialport
npm http 200 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/bindings/0.3.0
npm http GET https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/sf/0.1.3
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/node-gyp/0.6.2
npm http 200 https://registry.npmjs.org/bindings/0.3.0
npm http 200 https://registry.npmjs.org/sf/0.1.3
npm http 200 https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/bindings/-/bindings-0.3.0.tgz
npm http GET https://registry.npmjs.org/sf/-/sf-0.1.3.tgz
npm http 200 https://registry.npmjs.org/node-gyp/0.6.2
npm http 200 https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/node-gyp/-/node-gyp-0.6.2.tgz
npm http GET https://registry.npmjs.org/async/-/async-0.1.18.tgz
npm http 200 https://registry.npmjs.org/sf/-/sf-0.1.3.tgz
npm http 200 https://registry.npmjs.org/node-gyp/-/node-gyp-0.6.2.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.1.18.tgz
npm http 200 https://registry.npmjs.org/bindings/-/bindings-0.3.0.tgz
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/glob
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/minimatch
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/nopt
npm http GET https://registry.npmjs.org/npmlog
npm http GET https://registry.npmjs.org/osenv
npm http GET https://registry.npmjs.org/request
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/which
npm http 200 https://registry.npmjs.org/graceful-fs
npm http 200 https://registry.npmjs.org/fstream
npm http 200 https://registry.npmjs.org/wordwrap
npm http 200 https://registry.npmjs.org/mkdirp
npm http 200 https://registry.npmjs.org/glob
npm http 200 https://registry.npmjs.org/minimatch
npm http 200 https://registry.npmjs.org/npmlog
npm http 200 https://registry.npmjs.org/nopt
npm http 200 https://registry.npmjs.org/rimraf
npm http 200 https://registry.npmjs.org/osenv
npm http 200 https://registry.npmjs.org/tar
npm http 200 https://registry.npmjs.org/semver
npm http 200 https://registry.npmjs.org/request
npm http 200 https://registry.npmjs.org/which
npm http GET https://registry.npmjs.org/ansi
npm http GET https://registry.npmjs.org/abbrev
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/block-stream
npm http 200 https://registry.npmjs.org/inherits
npm http 200 https://registry.npmjs.org/ansi
npm http 200 https://registry.npmjs.org/abbrev
npm http 200 https://registry.npmjs.org/lru-cache
npm http 200 https://registry.npmjs.org/block-stream
npm http 200 https://registry.npmjs.org/inherits
npm http 200 https://registry.npmjs.org/inherits

[email protected] install /home/pi/foo/node_modules/serialport
node-gyp rebuild

gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES, stat '/root/.node-gyp/0.8.7'
gyp ERR! System Linux 3.1.9+
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/foo/node_modules/serialport
gyp ERR! node -v v0.8.7
gyp ERR! node-gyp -v v0.6.8
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.1.9+
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "serialport"
npm ERR! cwd /home/pi/foo
npm ERR! node -v v0.8.7
npm ERR! npm -v 1.1.49
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/foo/npm-debug.log
npm ERR! not ok code 0

slash

In node-serialport / serialport_native / serialport_native.cc

include <node.h> /* Includes for JS, node.js and v8 *//

please delete 2 slash

include <node.h> /* Includes for JS, node.js and v8 */

Serial port disconnect throws a non-catchable fatal error

... or I don't know how to catch it.

How to reproduce : plug an arduino in at /dev/ttyACM1 , begin reading data, disconnect the arduino.

I get :

Error: ENODEV, No such device
at
var bytes_read = serialport_native.read(file_id,buffer);

Installation Error

I've been trying for a few hours now to get this installed under Ubuntu 10.04. I've updated Node, NPM (at first NPM didn't want to acknowledge the existence of the serialport package). Now I'm just starting to get confused, and frustrated.

robot@RobotTestSystem:~/code$ sudo npm install serialport
[sudo] password for robot:
npm WARN [email protected] dependencies field should be hash of : pairs
npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url']
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport

[email protected] install /home/robot/code/node_modules/serialport
cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../

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 node path : not found
Checking for node prefix : ok /usr/local
'configure' finished successfully (0.192s)
Waf: Entering directory /home/robot/code/node_modules/serialport/serialport_native/build' [1/2] cxx: serialport_native.cc -> build/Release/serialport_native_1.o In file included from ../serialport_native.cc:3: ../serialport_native.h:6:25: error: node_events.h: No such file or directory ../serialport_native.cc:11:59: warning: extra tokens at end of #include directive Waf: Leaving directory/home/robot/code/node_modules/serialport/serialport_native/build'
Build failed: -> task failed (err #1):
{task: cxx serialport_native.cc -> serialport_native_1.o}
cp: cannot stat build/default/serialport_native.node': No such file or directory npm ERR! error installing [email protected] npm ERR! [email protected] install:cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../ npm ERR!sh "-c" "cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../"failed with 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is most likely a problem with the serialport package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../ npm ERR! You can get their info via: npm ERR! npm owner ls serialport npm ERR! There is likely additional logging output above. npm ERR! npm ERR! System Linux 2.6.32-33-generic-pae npm ERR! command "node" "/usr/local/bin/npm" "install" "serialport" npm ERR! cwd /home/robot/code npm ERR! node -v v0.7.0-pre npm ERR! npm -v 1.1.0-beta-10 npm ERR! code ELIFECYCLE npm ERR! message [email protected] install:cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../ npm ERR! messagesh "-c" "cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../"` failed with 1
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/robot/code/npm-debug.log
npm not ok

What is the issue? Am I missing something simple?

Thanks!

Node exit after new SerialPort()

A bit stumped, node script is causing exit without error on Windows, even when trying to capture unhandled exceptions using the "process.on" trick. Narrowed this behavior down to when I create a new SerialPort object.

System is Windows 7 Pro x64, using latest Node 0.8.3. Built libs using VS Express 2010.

Script works on Mac using same libraries without issue. Removing the new SerialPort() line resolves the issue, script works fine otherwise.

Here is sample program to repro and debug info. I'm not sure where else to look - maybe it's a bad compile, or some kind of 64-bit issue? It seems like the OS might be killing it but I don't see anything in Event Viewer (maybe I need to turn on more options in there?) Any troubleshooting help appreciated.

repro:

var connect = require('connect');
var SerialPort = require('serialport').SerialPort;
var argv = process.argv;

process.on('uncaughtException', function(err) {
  console.log(err);
});

var serialPort = new SerialPort();

connect.createServer(
    connect.static(__dirname)
).listen(argv[2] || 8082);

debug:

C:\Users\Steve\src\glomo>node debug wtf.js
< debugger listening on port 5858
connecting... ok
break in C:\Users\Steve\src\glomo\wtf.js:1
  1 var connect = require('connect');
  2 var SerialPort = require('serialport').SerialPort;
  3 var argv = process.argv;
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:2
  1 var connect = require('connect');
  2 var SerialPort = require('serialport').SerialPort;
  3 var argv = process.argv;
  4
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:2
  1 var connect = require('connect');
  2 var SerialPort = require('serialport').SerialPort;
  3 var argv = process.argv;
  4
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:3
  1 var connect = require('connect');
  2 var SerialPort = require('serialport').SerialPort;
  3 var argv = process.argv;
  4
  5 process.on('uncaughtException', function(err) {
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:5
  3 var argv = process.argv;
  4
  5 process.on('uncaughtException', function(err) {
  6   console.log(err);
  7 });
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:9
  7 });
  8
  9 var serialPort = new SerialPort();
 10
 11 connect.createServer(
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:12
 10
 11 connect.createServer(
 12     connect.static(__dirname)
 13 ).listen(argv[2] || 8082);
 14
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:11
  9 var serialPort = new SerialPort();
 10
 11 connect.createServer(
 12     connect.static(__dirname)
 13 ).listen(argv[2] || 8082);
debug> n
break in C:\Users\Steve\src\glomo\wtf.js:16
 14
 15
 16 });
debug> n
break in module.js:450
 448   var args = [self.exports, require, self, filename, dirname];
 449   return compiledWrapper.apply(self.exports, args);
 450 };
 451
 452
debug> n
break in module.js:468
 466   var content = NativeModule.require('fs').readFileSync(filename, 'utf8');
 467   module._compile(stripBOM(content), filename);
 468 };
 469
 470
debug> n
break in module.js:357
 355   if (!Module._extensions[extension]) extension = '.js';
 356   Module._extensions[extension](this, filename);
 357   this.loaded = true;
 358 };
 359
debug> n
break in module.js:358
 356   Module._extensions[extension](this, filename);
 357   this.loaded = true;
 358 };
 359
 360
debug> n
break in module.js:313
 311   try {
 312     module.load(filename);
 313     hadException = false;
 314   } finally {
 315     if (hadException) {
debug> n
break in module.js:315
 313     hadException = false;
 314   } finally {
 315     if (hadException) {
 316       delete Module._cache[filename];
 317     }
debug> n
break in module.js:320
 318   }
 319
 320   return module.exports;
 321 };
 322
debug> n
break in module.js:321
 319
 320   return module.exports;
 321 };
 322
 323 Module._resolveFilename = function(request, parent) {
debug> n
break in module.js:493
 491   // Load the main module--the command line argument.
 492   Module._load(process.argv[1], null, true);
 493 };
 494
 495 Module._initPaths = function() {
debug> n
break in timers.js:106
 104             process.emit('uncaughtException', e);
 105           }
 106           if (first.domain) first.domain.exit();
 107         }
 108       }
debug> n
break in timers.js:78
  76
  77       var first;
  78       while (first = L.peek(list)) {
  79         var diff = now - first._idleStart;
  80         if (diff + 1 < msecs) {
debug> n
break in timers.js:110
 108       }
 109
 110       debug(msecs + ' list empty');
 111       assert(L.isEmpty(list));
 112       list.close();
debug> n
break in timers.js:111
 109
 110       debug(msecs + ' list empty');
 111       assert(L.isEmpty(list));
 112       list.close();
 113       delete lists[msecs];
debug> n
break in timers.js:112
 110       debug(msecs + ' list empty');
 111       assert(L.isEmpty(list));
 112       list.close();
 113       delete lists[msecs];
 114     };
debug> n
break in timers.js:114
 112       list.close();
 113       delete lists[msecs];
 114     };
 115   }
 116
debug> n
program terminated
debug>

serialport_native.node: wrong ELF class: ELFCLASS32

Hi,

I installed the serialport module via npm on an Ubuntu 11.04 64bit machine:
$ uname -a
Linux x-machine 2.6.38-11-generic #48-Ubuntu SMP Fri Jul 29 19:02:55 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
$ node --version
v0.5.4
$ npm --version
1.0.26

but when trying to use the module it throws an error "wrong ELF class: ELFCLASS32"

Error: /home/.../node/node_modules/serialport/serialport_native.node: wrong ELF class: ELFCLASS32

Is there a workaround to compile as ELFCLASS64 (I presume) or does the serial port module not work on 64bit?

Thanks

not installing in Win 7

Should node-serialport work in Windows? npm installation in Windows 7 fails. Here is my npm-debug info:

info it worked if it ends with ok
verbose cli [ 'C:\Program Files (x86)\nodejs\node.exe',
verbose cli 'C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js',
verbose cli 'install',
verbose cli 'serialport' ]
info using [email protected]
info using [email protected]
verbose config file C:\Users\Administrator.npmrc
verbose config file C:\Program Files (x86)\nodejs\etc\npmrc
verbose config file C:\Program Files (x86)\nodejs\node_modules\npm\npmrc
verbose mkdir done: C:\Users\Administrator\Documents\Arduino-JS\server 755
verbose caching C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\socket.io\package.json
verbose loadDefaults [email protected]
verbose caching C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\websocket\package.json
verbose loadDefaults [email protected]
verbose into C:\Users\Administrator\Documents\Arduino-JS\server [ 'serialport' ]
verbose cache add serialport
verbose cache add [ 'serialport', null ]
silly cache add: name, spec, args [ undefined, 'serialport', [ 'serialport', null ] ]
verbose parsed url { pathname: 'serialport',
verbose parsed url path: 'serialport',
verbose parsed url href: 'serialport' }
info addNamed [ 'serialport', '' ]
verbose addNamed [ null, '' ]
verbose GET serialport
verbose raw, before any munging serialport
verbose url resolving [ 'https://registry.npmjs.org/', './serialport' ]
verbose url resolved https://registry.npmjs.org/serialport
verbose etag "DM3DFXDG0DTMYOPAYPUUBWEDE"
silly get cb [ 304,
silly get cb { server: 'CouchDB/1.1.0 (Erlang OTP/R14B04)',
silly get cb etag: '"DM3DFXDG0DTMYOPAYPUUBWEDE"',
silly get cb date: 'Sat, 03 Dec 2011 18:12:50 GMT',
silly get cb 'content-length': '0' } ]
verbose etag serialport from cache
verbose mkdir done: C:\Users\Administrator\AppData\Roaming\npm-cache\serialport 755
verbose GET serialport/0.6.3
verbose raw, before any munging serialport/0.6.3
verbose url resolving [ 'https://registry.npmjs.org/', './serialport/0.6.3' ]
verbose url resolved https://registry.npmjs.org/serialport/0.6.3
verbose etag "DM3DFXDG0DTMYOPAYPUUBWEDE"
silly get cb [ 304,
silly get cb { server: 'CouchDB/1.1.0 (Erlang OTP/R14B04)',
silly get cb etag: '"DM3DFXDG0DTMYOPAYPUUBWEDE"',
silly get cb date: 'Sat, 03 Dec 2011 18:12:50 GMT',
silly get cb 'content-length': '0' } ]
verbose etag serialport/0.6.3 from cache
verbose mkdir done: C:\Users\Administrator\AppData\Roaming\npm-cache\serialport\0.6.3 755
verbose bin dist [ '0.6-ares1.7.5-DEV-evundefined-openssl0.9.8r-v83.6.6.8-win32-ia32-6.1.7601',
verbose bin dist { shasum: '4ddcbaa239da037ddeb01866b46bb13d46892c28',
verbose bin dist tarball: 'http://registry.npmjs.org/serialport/-/serialport-0.6.3.tgz' } ]
verbose caching C:\Users\Administrator\AppData\Roaming\npm-cache\serialport\0.6.3\package\package.json
verbose loadDefaults [email protected]
silly resolved [ { name: 'serialport',
silly resolved version: '0.6.3',
silly resolved description: 'Welcome your robotic javascript overlords. Better yet, program them!',
silly resolved author: { name: 'Chris Williams', email: '[email protected]' },
silly resolved main: './serialport',
silly resolved repository:
silly resolved { type: 'git',
silly resolved url: 'git://github.com/voodootikigod/node-serialport.git' },
silly resolved scripts: { install: 'cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../' },
silly resolved engines: { node: '0.6' },
silly resolved _id: '[email protected]',
silly resolved contributors:
silly resolved [ { name: 'Chris Williams', email: '[email protected]' },
silly resolved { name: 'Esa-Matti Suuronen', email: '[email protected]' },
silly resolved { name: 'Nathan Rajlich', email: '[email protected]' },
silly resolved { name: 'Rick Waldron', email: '[email protected]' },
silly resolved { email: 'w1nk' } ],
silly resolved dependencies: {},
silly resolved devDependencies: {},
silly resolved _engineSupported: true,
silly resolved _npmVersion: '1.1.0-alpha-6',
silly resolved _nodeVersion: 'v0.6.4',
silly resolved defaultsLoaded: true } ]
info into C:\Users\Administrator\Documents\Arduino-JS\server [email protected]
info installOne [email protected]
info unbuild C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport
verbose from cache C:\Users\Administrator\AppData\Roaming\npm-cache\serialport\0.6.3\package\package.json
verbose mkdir (expected) error ENOENT, no such file or directory 'C:\Users\Administrator\Documents\Arduino-JS\server\node_modules___serialport.npm'
verbose mkdir done: C:\Users\Administrator\Documents\Arduino-JS\server\node_modules___serialport.npm 755
verbose unpack
uid, gid [ undefined, undefined ]
verbose unpackTarget C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport
silly gunzTarPerm modes [ '755', '644' ]
silly afterUntar undefined
verbose gunzed C:\Users\Administrator\Documents\Arduino-JS\server\node_modules___serialport.npm\package
verbose rm'ed C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport
verbose renamed [ 'C:\Users\Administrator\Documents\Arduino-JS\server\node_modules___serialport.npm\package',
verbose renamed 'C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport' ]
verbose caching C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport\package.json
verbose loadDefaults [email protected]
info preinstall [email protected]
verbose from cache C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport\package.json
verbose into C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport []
silly resolved []
verbose about to build C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport
info build C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport
verbose from cache C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport\package.json
verbose linkStuff [ false,
verbose linkStuff false,
verbose linkStuff false,
verbose linkStuff 'C:\Users\Administrator\Documents\Arduino-JS\server\node_modules' ]
info linkStuff [email protected]
verbose linkBins [email protected]
verbose linkMans [email protected]
verbose rebuildBundles [email protected]
info install [email protected]
verbose unsafe-perm in lifecycle true
silly exec cmd "/c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../"
silly spawning [ 'cmd',
silly spawning [ '/c',
silly spawning 'cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../' ],
silly spawning 'C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport' ]
info [email protected] Failed to exec install script
ERR! error installing [email protected] Error: [email protected] install: cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../
ERR! error installing [email protected] cmd "/c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../" failed with 1
ERR! error installing [email protected] at ChildProcess. (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\exec.js:49:20)
ERR! error installing [email protected] at ChildProcess.emit (events.js:70:17)
ERR! error installing [email protected] at maybeExit (child_process.js:359:16)
ERR! error installing [email protected] at Process.onexit (child_process.js:395:5)
info unbuild C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport
verbose from cache C:\Users\Administrator\Documents\Arduino-JS\server\node_modules\serialport\package.json
info preuninstall [email protected]
info uninstall [email protected]
verbose unbuild [email protected] [ true,
verbose unbuild [email protected] 'C:\Users\Administrator\Documents\Arduino-JS\server\node_modules',
verbose unbuild [email protected] 'C:\Users\Administrator\Documents\Arduino-JS\server\node_modules' ]
info postuninstall [email protected]
verbose installOne cb [email protected]
ERR! [email protected] install: cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../
ERR! cmd "/c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../" failed with 1
ERR!
ERR! Failed at the [email protected] install script.
ERR! This is most likely a problem with the serialport package,
ERR! not with npm itself.
ERR! Tell the author that this fails on your system:
ERR! cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../
ERR! You can get their info via:
ERR! npm owner ls serialport
ERR! There is likely additional logging output above.
ERR!
ERR! System Windows_NT 6.1.7601
ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install" "serialport"
ERR! cwd C:\Users\Administrator\Documents\Arduino-JS\server
ERR! node -v v0.6.4
ERR! npm -v 1.1.0-alpha-6
ERR! code ELIFECYCLE
ERR! message [email protected] install: cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../
ERR! message cmd "/c" "cd serialport_native;node-waf configure build;cp build/Release/serialport_native.node ../" failed with 1
verbose exit [ 1, true ]

SerialPort.close() throws error

When calling SerialPort.close() an error is thrown in serialport.js on line 98:

TypeError: Object [object Object] has no method 'close'

98 line is:

this.readStream.close();

but readable streams do not have close() method, only destroy().

Intermittent crashes on Win7, exit code -1073741819

It hasn't failed to crash within 5-10 minutes yet, usually faster. No stack trace is printed, node just shuts down with the exit code -1073741819. When you google for it, you'll find that it's Windows code for Access Violation Error. ( 0xC0000005 in hex )

I've been working on a Node.JS module for the RFXtrx433, an USB device that lets you talk to home appliances on the 433.33Mhz frequency. I have no problem with crashes when I'm using the VB.NET code that comes with the device SDK.

See also: https://github.com/joeferner/node-serialport2/issues/8

Things I've tried:

Run as Administrator
Compatibility mode set to Windows XP / 98
Unplug the FTDI USB com port, and just use the com port on my motherboard

No luck, node still crashes within a couple of minutes.

Does it work without crashing for anyone else on Windows 7 64bit?

multiple ports

i experienced problems while reading from multiple ports simultaneously.
up to 4 ports everything worked fine, when adding a fifth port reading is strange.

Data is only received after another port sent data as well.

Some quick code to test:

var sp = new SerialPort("/dev/tty.USA49Wfd1P1.1", global.serialOptions);
sp.on("data", datalistener);

var sp2 = new SerialPort("/dev/tty.USA49Wfd1P2.2", global.serialOptions);
sp2.on("data", datalistener);

var sp3 = new SerialPort("/dev/tty.USA49Wfd2P1.1", global.serialOptions);
sp3.on("data", datalistener);

var sp4 = new SerialPort("/dev/tty.USA49Wfd2P2.2", global.serialOptions);
sp4.on("data", datalistener);

var sp5 = new SerialPort("/dev/tty.USA49Wfd1P3.3", global.serialOptions);
sp5.on("data", datalistener);

Did anyone got similiar results or got an idea how to fix this? thank you.

npm install error - serialport_native

Hey!

I get the following error:

I have tried, reinstalling node, npm but i get the same result.

Ahmed:npm ahmed$ npm install serialport


> [email protected] install /Users/ahmed/local/npm/node_modules/serialport
> cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../

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 node path                   : not found 
Checking for node prefix                 : ok /Users/ahmed/local 
'configure' finished successfully (0.062s)
Waf: Entering directory `/Users/ahmed/local/npm/node_modules/serialport/serialport_native/build'
[1/2] cxx: serialport_native.cc -> build/Release/serialport_native_1.o
In file included from ../serialport_native.cc:3:
../serialport_native.h:6:25: error: node_events.h: No such file or directory
Waf: Leaving directory `/Users/ahmed/local/npm/node_modules/serialport/serialport_native/build'
Build failed:  -> task failed (err #1): 
    {task: cxx serialport_native.cc -> serialport_native_1.o}
cp: build/default/serialport_native.node: No such file or directory
npm ERR! error installing [email protected] Error: [email protected] install: `cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../`
npm ERR! error installing [email protected] `sh "-c" "cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../"` failed with 1
npm ERR! error installing [email protected]     at ChildProcess.<anonymous> (/Users/ahmed/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected]     at ChildProcess.emit (events.js:70:17)
npm ERR! error installing [email protected]     at maybeExit (child_process.js:359:16)
npm ERR! error installing [email protected]     at Process.onexit (child_process.js:395:5)
npm ERR! [email protected] install: `cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../`
npm ERR! `sh "-c" "cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cd serialport_native;node-waf configure build;cp build/default/serialport_native.node ../
npm ERR! You can get their info via:
npm ERR!     npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 11.2.0
npm ERR! command "node" "/Users/ahmed/local/bin/npm" "install" "serialport"
npm ERR! cwd /Users/ahmed/local/npm
npm ERR! node -v v0.6.2-pre
npm ERR! npm -v 1.0.105
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/ahmed/local/npm/npm-debug.log
npm not ok

When i run the tests, I get this:

Ahmed:tests ahmed$ node test_write.js 
The "sys" module is now called "util". It should have a similar interface.

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module 'serialport_native'
    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.<anonymous> (../node-serialport/serialport.js:11:28)
    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)

What should i do next?

win7 install failed when node-gyp rebuild

node -v v0.8.2
npm -v 1.1.36

[email protected] install D:\nodetest\node_modules\serialport
node-gyp rebuild

D:\nodetest\node_modules\serialport>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild
serialport_unix.cpp
serialport_win.cpp
d:\nodetest\node_modules\serialport\src\serialport.h(5): fatal error C1083: Cannot open include file:“node.h”: No such file or directory [D:\nodetest\node_modules\serialport\build\serialport.vcxproj]
serialport.cpp
d:\nodetest\node_modules\serialport\src\serialport.h(5): fatal error C1083: Cannot open include file:“node.h”: No such file or directory [D:\nodetest\node_modules\serialport\build\serialport.vcxproj]

binding file could not be found

If i start my app including serialport var sp = require('serialport').SerialPort; i get an error from bindings that the bindings file could not be found. Is there a configuration error? It's a fresh install.

xxx@ubuntu:~/Arbeitsfläche/node/firstapp$ node app

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Could not load the bindings file. Tried:
 -> /home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/build/Debug/serialport.node
 -> /home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/build/Release/serialport.node
 -> /home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/out/Debug/serialport.node
 -> /home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/Debug/serialport.node
 -> /home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/out/Release/serialport.node
 -> /home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/Release/serialport.node
 -> /home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/build/default/serialport.node
 -> /home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/compiled/0.6/linux/ia32/serialport.node
    at bindings (/home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/node_modules/bindings/bindings.js:82:13)
    at Object.<anonymous> (/home/xxx/Arbeitsfläche/node/firstapp/node_modules/serialport/serialport.js:7:44)
    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)
    at require (module.js:370:17)
    at Object.<anonymous> (/home/xxx/Arbeitsfläche/node/firstapp/app.js:20:10)
    at Module._compile (module.js:441:26)

npm install fails in ubuntu

Ubuntu 11.10
Node 0.4.12
npm 1.0.106

Waf: Leaving directory `/home/santiago/Projects/unloquer/sequencer/node_modules/serialport/serialport_native/build'
'build' finished successfully (0.373s)
cp: cannot stat `build/default/serialport_native.node': No such file or directory
npm ERR! error installing [email protected] Error: [email protected] install: `cd serialport_native;node-waf configure     build;cp build/default/serialport_native.node ../`
npm ERR! error installing [email protected] `sh "-c" "cd serialport_native;node-waf configure build;cp     build/default/serialport_native.node ../"` failed with 1
npm ERR! error installing [email protected]     at ChildProcess.<anonymous>     (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected]     at ChildProcess.emit (events.js:67:17)
npm ERR! error installing [email protected]     at ChildProcess.onexit (child_process.js:192:12)

Problem installing on Windows 7

I have problem installing on Windows 7 what can be the problem?

c:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin>npm install -f s
erialport
npm http GET https://registry.npmjs.org/serialport
npm http 200 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/serialport/-/serialport-1.0.2.tgz
npm http 200 https://registry.npmjs.org/serialport/-/serialport-1.0.2.tgz
npm http GET https://registry.npmjs.org/bindings/0.3.0
npm http GET https://registry.npmjs.org/sf/0.1.3
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/sf/0.1.3
npm http GET https://registry.npmjs.org/sf/-/sf-0.1.3.tgz
npm http 304 https://registry.npmjs.org/bindings/0.3.0
npm http GET https://registry.npmjs.org/bindings/-/bindings-0.3.0.tgz
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/async/0.1.18
npm http GET https://registry.npmjs.org/optimist/-/optimist-0.3.4.tgz
npm http GET https://registry.npmjs.org/async/-/async-0.1.18.tgz
npm http 200 https://registry.npmjs.org/sf/-/sf-0.1.3.tgz
npm http 200 https://registry.npmjs.org/bindings/-/bindings-0.3.0.tgz
npm http 200 https://registry.npmjs.org/async/-/async-0.1.18.tgz
npm http 200 https://registry.npmjs.org/optimist/-/optimist-0.3.4.tgz
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz

[email protected] install c:\Program Files (x86)\nodejs\node_modules\npm\node_m
odules\serialport
node-gyp rebuild

c:\Program Files (x86)\nodejs\node_modules\npm\node_modules\serialport>node "C:
Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules
\node-gyp\bin\node-gyp.js" rebuild
gyp http GET http://nodejs.org/dist/v0.8.2/node-v0.8.2.tar.gz
gyp http 200 http://nodejs.org/dist/v0.8.2/node-v0.8.2.tar.gz
gyp http GET http://nodejs.org/dist/v0.8.2/x64/node.lib
gyp http GET http://nodejs.org/dist/v0.8.2/node.lib
gyp http 200 http://nodejs.org/dist/v0.8.2/x64/node.lib
gyp http 200 http://nodejs.org/dist/v0.8.2/node.lib
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(29
6,5): warning MSB8003: Could not find VCInstallDir variable from the registry.
TargetFrameworkVersion or PlatformToolset may be set to an invalid version num
ber. [c:\Program Files (x86)\nodejs\node_modules\npm\node_modules\serialport\bu
ild\serialport.vcxproj]
TRACKER : error TRK0005: Failed to locate: "CL.exe". Det gÕr inte att hitta fil
en. [c:\Program Files (x86)\nodejs\node_modules\npm\node_modules\serialport\bui
ld\serialport.vcxproj]

gyp ERR! rebuild error Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msb uild.exe failed with exit code: 1
gyp ERR! rebuild error at ChildProcess.onExit (C:\Program Files (x86)\nodejs
\node_modules\npm\node_modules\node-gyp\lib\build.js:214:23)
gyp ERR! rebuild error at ChildProcess.EventEmitter.emit (events.js:91:17)
gyp ERR! rebuild error at Process._handle.onexit (child_process.js:674:10)
gyp ERR! not ok
[email protected] ....\node_modules\serialport
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])

c:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin>

Request for SerialPort.flush

I'm working with a device that needs flushed (input and output) after some writes, any chance having a flush() method added?

I'll look into this myself, but I've never worked on a Node extension before.

thanks

Cant find module after npm install

Node.js version : v0.4.0-pre
NPM version: 0.13.15

After installing serialport with npm the module cant be found when its "required"..

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.