0

How to read the meter reading of printer?

WMI- Verified every property of it still no answer. must be something else..

Manufacturer - Doesn't provide solution since they own different tools/ products for this. but I think this must be a simple for a programmer to find it out..

Anything in

System.Drawing.Printing? (winforms/Console)
System.Printing ? (WPF)

preferably - FujiXerox and KonicaMinolta

[UPDATE] I have seen an example of SNMP communication with printer using OLEPRNLib ,sample code is given below

 string[] ErrorMessageText = new string[8];
        ErrorMessageText[0] = "service requested";
        ErrorMessageText[1] = "offline";
        ErrorMessageText[2] = "paper jammed";
        ErrorMessageText[3] = "door open";
        ErrorMessageText[4] = "no toner";
        ErrorMessageText[5] = "toner low";
        ErrorMessageText[6] = "out of paper";
        ErrorMessageText[7] = "low paper";
        int DeviceID = 1;
        int Retries = 1;
        int TimeoutInMS = 2000;
        string CommunityString = "public";
        string IPAddressOfPrinter = "192.168.1.110";
        // Create instance of COM object
        OLEPRNLib.SNMP snmp = new OLEPRNLib.SNMP();
        // Open the SNMP connect to the printer
        snmp.Open(IPAddressOfPrinter, CommunityString, Retries, TimeoutInMS);
        // The actual Warning/Error bits
        uint WarningErrorBits = snmp.GetAsByte(String.Format("25.3.5.1.2.{0}", DeviceID));
        // The actual Status           
        uint StatusResult = snmp.GetAsByte(String.Format("25.3.2.1.5.{0}", DeviceID));
        // uint Result2 = snmp.GetAsByte(String.Format("25.3.5.1.1.{0}", DeviceID));



        string Result1Str = "";
        switch (StatusResult)
        {
            case 2: Result1Str = "OK";
                break;
            case 3: Result1Str = "Warning: ";
                break;
            case 4: Result1Str = "Being Tested: ";
                break;
            case 5: Result1Str = "Unavailable for any use: ";
                break;
            default: Result1Str = "Unknown Status Code : " + StatusResult;
                break;
        }
        string Str = "";
        if ((StatusResult == 3 || StatusResult == 5))
        {
            int Mask = 1;
            int NumMsg = 0;
            for (int i = 0; i < 8; i++)
            {
                if ((WarningErrorBits & Mask) == Mask)
                {
                    if (Str.Length > 0)
                        Str += ", ";
                    Str += ErrorMessageText[i];
                    NumMsg = NumMsg + 1;
                }
                Mask = Mask * 2;
            }
        }
        Console.WriteLine(Result1Str + Str);

The above is working and able to get a bit of printer information, so I am hoping to get Meter reading passing correct OID.

To find out the OID , I used iReasoning MIB Browser.. but could not get what I want here.. any thoughts?

Jay
  • 1,869
  • 3
  • 25
  • 44

0 Answers0