Coder Social home page Coder Social logo

parport.js's Introduction

Parport.JS

Parport.js is a Node.JS addon you can use to access, control and communicate with parallel ports.
It uses the C++/Java library Parallel-Port to provide a high-level and cross-platformโœ interface.

npm install parport

License

As Parallel-Port is distributed under the GPL, I'm forced to do the same (which I perfectly agree). So, Parport.JS is distributed under the GPLv3.

Usage

var par = require('parport');

var port = new par.Port();
port.writeControl(241);
console.log('Data:', port.readData());
console.log('Status:', port.readStatus());

You can pass an ID to pick which port to open (useful if you have more than one):

var port = new par.Port(1);
port.writeData(110);

And remember:

Exceptions may be thrown
if something goes wrong.

Full documentation can be found under doc/.
More examples can be found under examples/.

Compatibility

Important: these are only the bindings to Node.JS. The common interface to the platform-dependent functions is in Parallel-Port.

Parallel-Port currently works on the following platforms:

  • Linux: through the parport driver (usually comes with kernel, see /dev/parport0).

  • Windows: through the Inpout32 library (free for non-commercial use only).
    It seems it doesn't work on 64-bit Windows, though.

Platforms with no (but planned) support:

  • Darwin (that is, Mac OSX and iOS) not supported.

parport.js's People

Contributors

mildsunrise avatar

Stargazers

TY avatar Angus H. avatar Stig Otnes Kolstad avatar Keyvan Fatehi avatar Jorgen Evens avatar

Watchers

James Cloos avatar  avatar

Forkers

jorgenevens

parport.js's Issues

parport.markdown file is empty

The only file under the doc folder is empty. The revision date is 2/3/2015 so we do appreciate the revision. Also I can't find the examples folder that was discussed.

readData() not useful.

I have the package installed and I can write the port just fine but I can't read data through the port. I can only read back what had been written. Not much value there. How do we get the ECP direction turned around so we can read data from the outside world? The port's output buffer needs to be tristated.

Once port is set to reverse (input) unable to set back to forward (output)

Upon startup the output port is working properly as an output. After setting the control register C5 to reverse then data can be read successfully on the port:

     port.writeControl(32);   // set C5
     var data = port.readData(); 

Now is the trouble:

     port.writeControl(0);   // clear C5
     port.writeData(255);

This does nothing. I can see from monitoring the external pins that the port is still in reverse mode/ tristated.

When I stop the process and restart then the port comes up in forward (output) direction until the C5 is set again.

node-gyp rebuild fails

Hi,
I am trying to install the package on a Windows 10, 64 bit system.

After I got a lot of (to me) cryptic error messages under the latest installation of Node.js, I tried to revert back to an earlier version of Node (5.0.0). There the error appears more clear:

npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild

Do you have some idea what could resolve this?

Thank you!
Nico

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.