node package manager



If you want to get some information from your Indigo/DFE, you can always send it a JMF. But if you are actively monitoring the status of the device, you're better off with a JMF subscription which will notify an HTTP endpoint when something changes. Below you'll find an example on how to implement a basic JMF subscription endpoint using Node.


npm install jmf-subscription -g
jmf-spy --action=[action]


Use this script to search and subscribe to your JMF devices. Takes two arguments. '--idp' is the URL to your IDP worker (on your DFE) and should end with /jmf/. '--server' is the IP and port of your JMF server (see server.js).

dominick$ jmf-spy --action=subscribe --idp --server
info: Found Device ID:
info: Found Device ID: HP-Indigo-BUDPB
info: 2 two presses found.
info:  http=
info:  http=
info:  result=HP-Indigo-BUDPB subscribed successfully.
info:  result= subscribed successfully.


This simple server opens a port and listens for subscription events from the JMF devices. Takes one argument. '--port' is the port the server should listen on.

dominick$ jmf-spy --action=server --port=9090
Server listening on: http://localhost:9090
info:  DeviceID=HP-Indigo-BUDPB, DeviceStatus=Running, StatusDetails=Indigo: Printing, ProductionCounter=49942091
info:  DeviceID=HP-Indigo-BUDPB, DeviceStatus=Running, StatusDetails=Indigo: Printing, ProductionCounter=49942098
info:  DeviceID=HP-Indigo-BUDPB, DeviceStatus=Running, StatusDetails=Indigo: Printing, ProductionCounter=49942109
info:  DeviceID=HP-Indigo-BUDPB, DeviceStatus=Idle, StatusDetails=Indigo: Ready, ProductionCounter=49942109
info:  DeviceID=, DeviceStatus=Idle, StatusDetails=Indigo: Ready, ProductionCounter=35089299
info:  DeviceID=, DeviceStatus=Running, StatusDetails=Indigo: Printing, ProductionCounter=35089299

The server also saves the JMF details in a simple nebd database. You can use pm2 to start the server on boot:

pm2 start /var/node/JMF-Subscription/src/js/interface.js -- --action server --port 9090
pm2 save


This script reads the JMF updates from the server above from the database and converts them to usable time ranges that can be reported upon. It also posts those ranges in a JSON request to another endpoint and if successful, deletes them from the local data store. It will always leave the last update so the next range has something to start with. Takes one argument. '--range-endpoint' is the URI of the endpoint that accepts the ranges.

dominick$ node jmf-spy --action=interpreter --range-endpoint=
[ '': 1, 'HP-Indigo-BUDPB': 1 ]
info:  press=, updates=563, ranges=178, totalRemoved=561
info:  press=HP-Indigo-BUDPB, updates=276, ranges=165, totalRemoved=275

Here is an example HTTP request the interpreter would send to the range-endpoint:

    { "statusDetails": "Indigo: Ready",
    "elapsedClicks": 0,
    "diffMs": 60000,
    "start": 1452006000000,
    "end": 1452006060000,
    "press": "HP-Indigo-BUDPB" }

You'll want to run the interpreter in an interval using something like cron, like so:

*/30 * * * * node /var/node/JMF-Subscription/src/js/interface.js --action=interpreter --range-endpoint= >/dev/null 2>&1

Reporting Example

Here are some example reports you can use this data for. You'll have to put these together yourself.

Hours printing per day


For more information, see this post for now:


  • Cancel subscriptions
  • Different type of subscriptions (QueueStatus)