Saturday, January 5, 2008

Adding Printer To libinklevel

You might already know that there are libinklevel and ink that was developed by Markus Heinz that could help you detecting your ink level status for your printer. Too bad, the supported printer is limited currently, but you can make your printer supported by contacting the developer (Markus Heinz) and provide him with the information that he might need. On my cause, he asked about the ink cartridges type, how many cartridges can be inserted at one time, which color are in the cartridge, and also debugging output from libinklevel and ink application.

The debugging output can be done by:
1. Get libinklevel (0.72 or newer)
2. Extract them at some place
3. Open inklevel.h. Change line 12 into #define DEBUG 1
4. Compile and install libinklevel with make and make install (alternatively, you can use SlackBuild script to convert it to tgz).
5. Get ink, and compile it with the same command (make and make install)
6. Run the ink to produce the debugging information with ink -p usb > debug.txt 2>&1
7. Send this information to Markus and he will try to add your printer information on the next release of libinklevel and also ink (hopefully)

On my printer, it resulted in this outout:
ink v0.4.1 © 2007 Markus Heinz

Printer reported size 130, real size is 130
0: MFG:Canon
1: CMD:BJL,HAPS,BSCCe,PLI
2: MDL:iP1800 series
3: CLS:PRINTER
4: DES:Canon iP1800 series
5: VER:1.11
6: STA:10
7: CHD:BK,CL
8: HRI:ASI
9: MSI:E3
10: Aü·7¿
11:
12:
13:
14:
The "MFG:" tag has number 0
The "MDL:" tag has number 2
No "S:" tag found
No "VSTATUS:" tag found
Device file: /dev/usb/lp0
Command:
\x1b[K<\x00\x00\x1e\x00:SSR=BST,SFA,CHD,CIL,CIR,HRI,DBS,DWS,DOC,DSC,DJS,CTK,HCF; Command Response: \x00wBST:00;CHD:BK,CL;HRI:ASI;CIL:ON;CTK:BK,SET,/,CL,SET;CIR:BK=100,CL=070;HCF:NO;DJS:NO;DBS:NO;DOC:4,00,NO;DWS:NO;DSC:NO; Printer not supported. Could not get ink level.

Update (23:44): After giving my debugging information, Markus Heinz sent me updated libinklevel (called 0.7.3rc5) and i tried compiling it and here are the updated results
ink v0.4.1 © 2007 Markus Heinz

Printer reported size 130, real size is 130
0: MFG:Canon
1: CMD:BJL,HAPS,BSCCe,PLI
2: MDL:iP1800 series
3: CLS:PRINTER
4: DES:Canon iP1800 series
5: VER:1.11
6: STA:10
7: CHD:BK,CL
8: HRI:ASI
9: MSI:E3
10: AÈû·HÒ¿
11:
12:
13:
14:
The "MFG:" tag has number 0
The "MDL:" tag has number 2
No "S:" tag found
No "VSTATUS:" tag found
Device file: /dev/usb/lp0
Command:
\x1b[K<\x00\x00\x1e\x00:SSR=BST,SFA,CHD,CIL,CIR,HRI,DBS,DWS,DOC,DSC,DJS,CTK,HCF; Command Response: \x00wBST:00;CHD:BK,CL;HRI:ASI;CIL:ON;CTK:BK,SET,/,CL,SET;CIR:BK=100,CL=070;HCF:NO;DJS:NO;DBS:NO;DOC:4,00,NO;DWS:NO;DSC:NO;
1 colors found
Ink levels :
Level 1 = 100
Canon iP1800 series

Black: 100%

Now it can find the black cartridge, but we are missing the color one (actually, if you look on the bold string above, you will notice that's the information that were used to gather information about the ink level. It said 100% on black and 70% on color). It will be updated again soon again big grin

Update (06/01/2008: 00:08): libinklevel-0.7.3rc6 works like charm and here's the updated results:
ink v0.4.1 © 2007 Markus Heinz

Printer reported size 130, real size is 130
0: MFG:Canon
1: CMD:BJL,HAPS,BSCCe,PLI
2: MDL:iP1800 series
3: CLS:PRINTER
4: DES:Canon iP1800 series
5: VER:1.11
6: STA:10
7: CHD:BK,CL
8: HRI:ASI
9: MSI:E3
10: AHô·(Ñ¿
11:
12:
13:
14:
The "MFG:" tag has number 0
The "MDL:" tag has number 2
No "S:" tag found
No "VSTATUS:" tag found
Device file: /dev/usb/lp0
Command:
\x1b[K<\x00\x00\x1e\x00:SSR=BST,SFA,CHD,CIL,CIR,HRI,DBS,DWS,DOC,DSC,DJS,CTK,HCF;
Command Response:
\x00wBST:00;CHD:BK,CL;HRI:ASI;CIL:ON;CTK:BK,SET,/,CL,SET;CIR:BK=100,CL=070;HCF:NO;DJS:NO;DBS:NO;DOC:4,00,NO;DWS:NO;DSC:NO;
2 colors found
Ink levels :
Level 1 = 100
Level 2 = 70
Canon iP1800 series

Black: 100%
Color: 70%

Markus also told me that Canon printers report their ink levels not in a continuous fashion, like 70%, 69%, 68% etc but in greater steps like 100%, 70%, 50 % etc. So don't be surprised if your ink level dropped so quick (for example from 70% to 50%), because they don't dropped gradually, but they will be updated when it has reached some points.

I think i have to sleep for now.... sleepy