Check the ink level of your printer with Linux or FreeBSD

Libinklevel


Description

Libinklevel is a library for checking the ink level of your printer on a system which runs Linux or FreeBSD. It supports printers attached via USB. Currently printers of the following brands are supported: HP, Epson and Canon. Canon BJNP network printers are supported too. A detailed list of supported printers is available. 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 or FreeBSD box. You can download the current version here.

News

28/12/2022 Release of version 0.9.5. This release adds support for Canon TS 200 series printers. Libxml2 has been added as a dependency.
15/07/2022 Release of version 0.9.4. This release fixes issues with newer autoconf versions and with newer libusb versions. Now on Linux systems libusb is required in at least version 1.0.22.
14/07/2018 Release of version 0.9.3. Support for parallel port printers and for the Solaris OS have been removed. A bug in the handling of multiple USB printers has been fixed. Detection of additional ink cartridges (e.g. orange) has been added. FreeBSD support has been improved.
16/05/2015 Release of version 0.9.2. This is a bugfix release. USB printer discovery has been fixed and optimized. Support for the Canon MP540 series has been added.
14/02/2015 Release of version 0.9.1. This is a bugfix release. It fixes the following issues: BJNP printer discovery on Linux and FreeBSD systems has been fixed. USB kernel driver handling on FreeBSD systems has been fixed.
06/02/2015 Release of version 0.9.0. The following changes are included: FreeBSD support has been added. On Linux and FreeBSD systems the communication with an USB printer is now handled by libusb-1.0. This should resolve compatibility issues with CUPS. The following printers are now supported too: Canon MP980, Canon S750, Canon MG7100 series and Canon MX870 series.
03/12/2014 I have setup a small survey regarding the use of libinklevel. Please take a minute and answer the questions. It will help me in the future development of libinklevel.
11/06/2009 Release of the new stable version 0.8.0. The following has changed compared to 0.7.3: Support for the following printers has been added: Canon MP530, Canon iP1600, Canon 860i, Canon S500, Canon iP2000, Canon S820, Canon Pixma 4000R, Canon MP600 and Epson Stylus DX7450. Additional Canon printers might be supported by a new ink cartridge auto detection. Libinklevel now also works on (Open)Solaris. The build system has been changed to autoconf and automake. Some bugs have been fixed too. And last but not least: It is now possible to query Canon Network printers via BJNP.
09/04/2009 Release of the second release candidate of version 0.8.0. Support for the Canon iP2000 and S500 printers has been added. The build system has been changed to autoconf and automake. If you try out this version, please consider subscribing to the new Libinklevel-Tester mailing list.
29/01/2009 Release of the first release candidate of version 0.8.0. Support for Solaris 10 and OpenSolaris has been added. Support for the following printers has been added: Canon MP530, Canon iP1600 and Canon 860i. Some more unlisted Canon printers should be supported by the new cartridge type auto detection. Additionally support for Canon network printers has been added (BJNP). If you try out this version, please consider subscribing to the new Libinklevel-Tester mailing list.
24/01/2009 Two new mailing lists have been set up: Libinklevel-Tester is for all who are willing to test libinklevel. Continuous tests with many different printers accompanying the development of libinklevel are very important to ensure its quality. Libinklevel-Frontend is for all who are developing software based on libinklevel. On this list new features and recent changes in libinklevel will be announced.
18/05/2008 Release of version 0.7.3. Support for the following printers has been added: Canon iP4300, Canon i950, Canon iP5200, Canon iP4500, Canon i965, Canon iP1800, Canon S520, Canon i960. Support for the Canon iP2200 has been fixed. Detection of empty catridges for old HP printers has been added.
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 iP3000 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

Stable release

Installation and usage

Many distributions (Debian, Ubuntu, Raspbian etc.) offer prebuilt packages of libinklevel.

If you intend to install from source you need to have gcc or another compiler installed. On Linux and FreeBSD you additionally need libusb-1.0 ≥ 1.0.22 and libxml2.

tar xzf libinklevel-0.9.5.tar.gz
cd libinklevel-0.9.5
./configure
make
make install

On RPM based systems with the rpmbuild command available you can create RPM packages (libinklevel and libinklevel-devel) by running:

tar xzf libinklevel-0.9.5.tar.gz
cd libinklevel-0.9.5
./configure
make rpm

This will create the RPM files for you.

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.

Mailing lists

There are two mailing lists for libinklevel:

Libinklevel-Tester is for people who want to test libinklevel.

Libinklevel-Frontend is for developers who develop software based on libinklevel.

Feedback

Send comments, suggestions, critics to Markus Heinz.