Giter VIP home page Giter VIP logo

nodejs-brothermfc's Introduction

brothermfc

Access Brother MFC web UI details with node.js

npm Build Status Coverage Status

Example

var brother = require ('brothermfc') ({
  hostname: 'myprinter.lan'
});

brother.current (function (err, data) {
  console.log (err || data);
});

Installation

npm install brothermfc

Configuration

param type default description
hostname string Printer hostname or IP
[port] number 80 Printer web UI port
[protocol] string http Printer web UI protocol, http or https
[prefix] string Printer web UI prefix
[ippPort] number 631 Printer IPP service port
[timeout] number 5000 Web require time out in ms, 1000 = 1 sec

Example

var brother = require ('brothermfc') ({
  hostname: 'printer.lan',
  protocol: 'https'
});

current

( callback )

Get current information, like display text and ink levels, directly from the IPP interface. This is the most accurate information compared to the general.status method which is a calculation.

Note: this method may also work with other models and brands.

param type required description
callback function yes see Usage.

Example

brother.current (callback);

Output

{ state: 'idle',
  stateReasons: 'none',
  jobs: 0,
  uptime: 613845,
  uptimeDate: Tue Nov 18 2014 03:47:22 GMT+0100 (CET),
  ink: {
    magenta: 100,
    cyan: 100,
    yellow: 98,
    black: 86
  }
}
property description
state short status message
stateReasons more descriptive status message
jobs print tasks running and queued
uptime seconds since last boot
uptimeDate Date object from uptime
ink inklevels in %, colors depend in model

general.status

( callback )

Get basic status details, like display text and ink levels.

Note: ink levels are less accurate then the .current method.

param type description
callback function see Usage.

Example

brother.general.status (callback);

Output

{ model: 'MFC-J4710DW',
  status: 'moniOk',
  message: 'Gereed',
  ink: { magenta: 100, cyan: 100, yellow: 100, black: 91 },
  contact: 'Franklin',
  location: 'Here' }

general.information

( callback )

Get information specific to the device, i.e. IP-address and serialnumber.

param type description
callback function see Usage.
brother.general.information (callback);

Output

{ node_name: 'BRA123BC456DE78',
  model_name: 'Brother MFC-J4710DW',
  location: 'Here',
  contact: 'Franklin',
  ip_address: '192.168.1.158',
  serial_no: 'A12345B678',
  firmware_version: 'H',
  page_counter: 26 }

general.sleep

( [preset], callback )

Get or change the device's sleep timeout.

param type required description
preset number no Preset number corresponding to minutes
callback function yes see Example

Get

brother.general.sleep (callback);

Output

{
  presets: {
    1: 2,
    2: 3,
    3: 5,
    4: 10,
    5: 30,
    6: 60
  ],
  value: {
    key: 4, minutes: 10
  }
}

The presets property are the predefined minutes you can choose from. The value property is the current setting.

Change

// set to key `5` = 30 minutes
brother.general.sleep (5, callback);

Output

  • OK: data is true (boolean)
  • Fail: err is Error: POST failed with err.error

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to https://unlicense.org

Author

Franklin | Buy me a coffee

nodejs-brothermfc's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

nodejs-brothermfc's Issues

An in-range update of dotest is breaking the build 🚨

Version 1.14.0 of dotest just got published.

Branch Build failing 🚨
Dependency dotest
Current Version 1.13.6
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As dotest is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • βœ… bitHound - Code No failing files. Details

  • βœ… bitHound - Dependencies No failing dependencies. Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 6 commits .

  • 95b4cc8 1.14.0
  • ec13722 Docs(changelog): Update changelog
  • 92b2211 Refactor(runner): Prettier commits report
  • e81f2c4 Fix(runner): Properly quote bin paths
  • 87e6ecb Feat(runner): Print GitHub compare URL
  • 97e762a Fix(runner): Fixed binary operator on condition

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of dotest is breaking the build 🚨

Version 1.15.0 of dotest just got published.

Branch Build failing 🚨
Dependency dotest
Current Version 1.14.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As dotest is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ bitHound - Dependencies Details

  • ❌ bitHound - Code Details

  • βœ… dependency-ci Dependencies checked Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

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.