Check the ink level of your printer with linux

Libinklevel


Description

Libinklevel is a library for checking the ink level of your printer on a system which runs Linux. It supports printers attached via parallel port or usb. Currently printers of the following brands are supported: HP, Epson and Canon. A detailed list of supported printers can be found here. This is not official software from the printer manufacturers. The goal of this project is to create a vendor independent API for retrieving the ink level of a printer connected to a Linux box. You can download the current version from here.

News

28/07/2007 Release of version 0.7.2. Support for the following printers has been added: Canon i865, Canon iP3300 and Canon MP160.
18/03/2007 Release of version 0.7.1. Debugging messages have been fully disabled. The number of retries when reading from the printer has been reduced.
14/03/2007 Release of version 0.7.0. Changes to the last stable release include: Support for Canon printers has been added, support for HP and Epson printers has been improved, a new function to query the version of libinklevel has been added and it is now possible to directly specify the usb device node to which the printer is connected to.
09/03/2007 Release of version 0.6.6rc6. Support for Canon i9100 and i3000 added. Bugs in Canon code fixed. Code for HP printers updated. Should now support more HP printers than before. Hanging problem with Epson printers addressed.
05/10/2006 Release of version 0.6.6rc5. Support for the the following Canon printers has been added: BJC-6200, iP5000 and iP4000.
16/09/2006 Release of version 0.6.6rc4. The Epson code has been rewritten to support more recent printers and to get rid of a bug which caused blocking of libinklevel when one ink cartridge was completely empty. Support for the Canon MP360 has been added. An alternate device file location for USB printers has been added. Please test with all printers.
06/09/2006 Release of version 0.6.6rc3. The blocking problem with Canon printers has been addressed again and is hopefully resolved now. Detection of different ink cartridge types for certain Canon printers has been implemented. The interface of libinklevel has been made more flexible so that it can support any kind of ink catridge combination. The following Canon printers should now be supported: iP1000, ip2200, S300, i550, i560, i850, i860, i990, iP1500, iP4100, iP4200, iP3100.
20/08/2006 Release of version 0.6.6rc2. A problem with other printer programs being blocked after using libinklevel has been addressed. Code cleanup has been performed. Please test with all available Canon printers and report both success and failure to me. Please include full debugging output from ink.
16/08/2006 Release of version 0.6.6rc1. First version with Canon support. Please test with all available Canon printers and report both success and failure to me. Please include full debugging output from ink.
16/07/2006 Release of version 0.6.5. Functional identical to version 0.6.5rc2. Compiles with gcc ≥ 4.0.0 too.
03/04/2006 Release of version 0.6.5rc2. The compiler warnings with gcc4 have been fixed.
26/07/2005 Release of version 0.6.5rc1. This release also compiles with gcc 4.0.1.
01/02/2005 Release of version 0.6.4. Newly supported printers include the HP DeskJet 3320, HP DeskJet 3325, Epson Stylus C64, Epson Stylus C84 and Epson Stylus C86.
26/01/2005 Public test of version 0.6.4rc2. HP DeskJet 3320 and HP DeskJet 3325 equipped with only the tri-colour cartridge should now be supported.
16/01/2005 Public test of version 0.6.4rc1. The code for epson printers has been updated. Please report all successes and failures with epson printers including full debug output of ink to me.
01/07/2004 Release of version 0.6.3. Support for HP Business InkJet 1100 has been fixed. Minor bugfixes have been performed. The source code has been split into several files for better maintainability and extensibility.
26/02/2004 Project moved to Sourceforge.
10/01/2004 Release of version 0.6.2. Support for HP printers has been improved: Separate cartridges for each color and addon photo cartridges are now detected.
05/12/2003 Release of version 0.6.1. A segmentation fault when the printer did not terminate its device id with a semicolon has been fixed.
03/12/2003 Release of version 0.6. Error reporting is now much more verbose. The name of the printer is returned.
14/09/2003 Release of version 0.5. Support for Epson printers has been much improved.
07/09/2003 Release of version 0.4. Now with support for Epson printers.
27/08/2003 Release of version 0.3. Now the soname of the library is correctly set up.
27/08/2003 Release of version 0.2. Now also works if you do not use devfs.
25/08/2003 Initial version released and web page set up.

Printers supported

The following printers are supported by the current stable version:

Printers not supported

The following printers cannot be supported because they do not transmit their inklevel in a way known to me or they do not transmit it at all:

A note about Canon printers

Some Canon printers transmit their ink levels as a binary value. They report only that there is enough ink or not enough ink for a particular cartridge. Libinklevel then reports 100% or 20% respectively.

A note about Epson printers

Under some circumstances, especially when one ink catridge is completely empty, it may take about 20 to 30 seconds to detect the ink level. Please take this into account before submitting a bug report.

When you query the ink levels before the printer is fully initialized a sheet of paper will be drawn in. But nothing will be printed. To avoid this do not query the ink levels before the printer is fully initialized.

A note about unsupported printers

Support for most HP and Epson printers which transmit their ink level should now be included. Just give it a try and let me know the result so that I can add your printer to the appropiate list. Printers of other manufacturers will be supported when I can get information on how to retrieve their inklevel. If you have information on how to retrieve the ink level of a not yet supported printer, let me know.

License

This software is licensed under the GPL version 2. It comes with no warranty.

Download

Test releases

Stable releases

Installation and usage

You need gcc installed. libieee1284 ≥ 0.2.11 is required. You may have to edit the Makefile to suit your needs.

tar xzf libinklevel-0.7.2.tar.gz
cd libinklevel-0.7.2
make
make install
				

Users of programs which make use of libinklevel need read/write permission on the device the printer is connected to. For parallel port printers this is /dev/parport[portnumber] and /dev/lp[portnumber], for usb printers this is /dev/usb/lp[portnumber] or /dev/usblp[portnumber].

After that install some software which makes use of libinklevel. Currently there are the following options available:

If you have written some software which makes use of libinklevel, let me know so that I can add a link to it here.

Feedback

Send comments, suggestions, critics to Markus Heinz.