Ticket #53 (accepted enhancement)

Opened 14 years ago

Last modified 14 years ago

SNMP accounter for HP designjet

Reported by: bse Owned by: jerome
Priority: minor Milestone:
Component: pykota Version: development
Keywords: Cc:

Description

HP Designjet har the ability to report paper and ink usage.
The attached diff shows how I read the used paper area (in square inch) and convert to A4 pages.

//Bse


diff /usr/lib/python2.4/site-packages/pykota/accounters/snmp.py snmp_designjet.py.work.without_extra_sleepdelay
56a57

pageAreaOID = "1.3.6.1.4.1.11.2.3.9.4.2.1.4.1.12.2.5.1.0 "

94c95,96
< defaultErrorMask = 0x4fcc # [ 'No Paper',
---

#defaultErrorMask = 0x4fcc # [ 'No Paper',
defaultErrorMask = 0x0 # [ 'No Paper',

285c287
< tuple([int(i) for i in pageCounterOID.split('.')]), \
---

tuple([int(i) for i in pageAreaOID.split('.')]), \

320c322
< req.apiAlphaGetPdu().apiAlphaSetVarBindList((pageCounterOID, ver.Null()), \
---

req.apiAlphaGetPdu().apiAlphaSetVarBindList((pageAreaOID, ver.Null()), \

400c402
< return acc.protocolHandler.retrieveInternalPageCounter()
---

return int ( acc.protocolHandler.retrieveInternalPageCounter() / 96.7 )

410c412,413
< print "Internal page counter's value is : %s" % pagecounter
---

#print "Internal page counter's value is : %s" % pagecounter
print "%s" % pagecounter

Change History

Changed 14 years ago by bse

  • priority changed from major to minor
  • type changed from defect to enhancement
  • milestone deleted

Changed 14 years ago by jerome

  • status changed from new to accepted

I don't have any designjet available unfortunately. Could you check for me if the 96.7 divisor is listed somewhere when you do an snmpwalk over your printer, or if it's retrievable through SNMP (even under a different form) ? Also if you change the default settings for language and/or dimensions in your printer, does it still account in square inches or square meters (or centimeters) ?
The best would be to always try to retrieve such an OID, but I'm reluctant to hardcode the divisor, and putting it in the configuration file smells bad.

Or maybe the easiest would be for the configuration file to contain something like "units : inch|feet|cm|m|etc...|none"

If set to "none" or not set at all, the page count wouldn't be divised by anything, like with the actual behaviour, so this wouldn't break anything. If set, the page count would be divised by the appropriate value.

Thanks for your help and comments.

Changed 14 years ago by bse

Agree.

The OID is documented in "HP Designjet Status Interface", version 5.2 February 2007.

The 96.7 divisor is not documented there (or anywhere else). I calculated that as (210*297) / (25.4*25.4)

The OID is documented to return accumulated media consumption in square feet, but in reality
return square inches.

I have not tried to set any other languages. Will do and see what happends,

The area is calculated as (media width * used length).
If you print a 10 cm wide, 1 meter high plot on a plotter with 1.2 m wide media, it is reported as 1.2 square meters of media, if you turn it sideways it will be reported as 0.12 square meters.

//Bse


Changed 14 years ago by bse

Preliminary patches posted to pykota-devel today (20100727)
//Bse

Note: See TracTickets for help on using tickets.