Choose style:

Author Topic: Querying Ink level using Ink and libinklevel ( solved )  (Read 3054 times)

0 Members and 1 Guest are viewing this topic.

Offline Grem41

  • nOOb
  • *
  • Posts: 21
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
Querying Ink level using Ink and libinklevel ( solved )
« on: August 14, 2014, 12:36:15 pm »
Hi all, hope someone can help.

I'm trying to query the level of ink (Remanufactured ink cartridge) in my HP printer C4585.
Through various research ( http://libinklevel.sourceforge.net/ )I found and installed the 2 programs to obtain this detail. These being 

1.           Ink  installed using sudo apt-get install ink

2.          Libinklevel ( an associated library install in turn by Ink


However when I run ink -p usb it responds as follows

Could not access '/dev/usb/lp0' or '/dev/usblp0'.
Could not get ink level.

I know I need to change the permissions somewhere but how ?

Thanks
« Last Edit: August 29, 2014, 04:52:55 pm by Grem41 »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Querying Ink level using Ink and libinklevel
« Reply #1 on: August 14, 2014, 01:49:30 pm »
Doesn't hplip-gui give ink levels for Printers ?

What's the output from:
Code: [Select]
ls -l /dev/usb
and
Code: [Select]
groups

WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline Grem41

  • nOOb
  • *
  • Posts: 21
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
Re: Querying Ink level using Ink and libinklevel
« Reply #2 on: August 16, 2014, 07:12:56 am »
Hi PCNetSpec

In response to your questions

 1.   Doesn't hplip-gui give ink levels for Printers ?
      Unfortunately it only gives approximate value ie very low low etc  not percentages that I want

2.   
Code: [Select]
ls -l /dev/usb
yields the following results yesterday

      total 0
      crw-rw---- 1 root lp 180, 0 Aug 15 21:07 lp0
     
3.   
Code: [Select]
groups
yields
      steve adm cdrom sudo dip plugdev lpadmin sambashare

4.   Followed the video, it solved the problem  :) by showing at around 1.00 - 2.34 in I found I needed to change the permissions for everyone using 
Code: [Select]
  sudo chmod 666 /dev/usb/lp0

As an aside what is lp0 I take its the line printer but I use usb ?

Lastly I found Ink doesn't support HP C4500 series and only shows 0% for the black cartridge but that cannot be since its a new remanufactured cartridge was just installed but not HP genuine. Very frustrating

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Querying Ink level using Ink and libinklevel
« Reply #3 on: August 16, 2014, 12:09:11 pm »
Can't really help if it's not supported ;)
(or the chip added in the re-manufacture process isn't supported)

You'll find ink levels are quess work anyway .. and AFAIK based on number of pages printed, and a guess based on average coverage.

No ink cartridges actually contain a float like a petrol tank as the ink is absorbed in foam.

There's no such thing as an accurate ink level monitor (irrespective of OS).
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline Grem41

  • nOOb
  • *
  • Posts: 21
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
Re: Querying Ink level using Ink and libinklevel
« Reply #4 on: August 18, 2014, 07:47:41 am »
As mentrioned in my last post with your help was able to run ink -p usb without the error message (see 1st post)

Below is a terminal copy to resolve this issue which works fine

steve@steve-Packard-Bell-EasyNote ~ $ ls -l /dev/usb
total 0
crw-rw-rw- 1 root lp 180, 0 Aug 18 11:43 lp0
steve@steve-Packard-Bell-EasyNote ~ $ groups
steve adm cdrom sudo dip plugdev lpadmin sambashare
steve@steve-Packard-Bell-EasyNote ~ $ sudo chmod 666 /dev/usb/lp0
[sudo] password for steve:
steve@steve-Packard-Bell-EasyNote ~ $ ink -p usb
ink 0.5.1 (c) 2010 Markus Heinz

HP Photosmart C4500 series

Black:                          0%
Color:                          0%

However on reboot it fails to run ink -p usb and I get the original error message

Could not access '/dev/usb/lp0' or '/dev/usblp0'.
Could not get ink level.

Why ?

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Querying Ink level using Ink and libinklevel
« Reply #5 on: August 21, 2014, 12:27:23 pm »
The usb device gets recreated every boot, so without adding a custom udev rule you'll have to change permissions or owner every boot.

try adding yourself to the "lp" group.
« Last Edit: August 21, 2014, 12:29:26 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline Grem41

  • nOOb
  • *
  • Posts: 21
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
Re: Querying Ink level using Ink and libinklevel
« Reply #6 on: August 26, 2014, 11:19:30 am »
I see why now. so attempting to learn about groups --- You said
Quote
try adding yourself to the "lp" group.
How do I go about this

I found a mention of this, in a ubuntu forum see http://ubuntuforums.org/showthread.php?t=1928567
From that I believe I need to enter 
Code: [Select]
sudo adduser steve lp 
Is this correct?

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Querying Ink level using Ink and libinklevel
« Reply #7 on: August 26, 2014, 11:42:15 am »
as both the user and group already exist, the command would be:
Code: [Select]
sudo usermod -a -G lp steve
but be VERY careful with the syntax.



A MUCH safer way to add the user "steve" to the gropup "lp" would be to go to:-

menu > System Tools > Users and Groups

Click the "Manage Groups" button

Scroll down and hightlight "lp" in the list of groups .. then click the "Properties" button.

Then make sure there's a tick next to "steve" .. then click "OK"

Then log off/on again. (or reboot) <-- IMPORTANT

Once logged back on you can see which groups "steve" belongs to with:
Code: [Select]
groups steve
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline Grem41

  • nOOb
  • *
  • Posts: 21
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
Re: Querying Ink level using Ink and libinklevel
« Reply #8 on: August 29, 2014, 04:52:11 pm »
Your advice worked a treat. Will mark the topic solved.
Thanks

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26126
  • Karma: 2845
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Querying Ink level using Ink and libinklevel ( solved )
« Reply #9 on: August 29, 2014, 05:19:05 pm »
No problem, and thanks for marking the topic solved :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec