Trouble printing with my HP Deskjet printer using CUPS/hplip

Plugging in devices such as LAN adapters, Wi-Fi cards, printers, etc. to Arch Linux ARM.

Trouble printing with my HP Deskjet printer using CUPS/hplip

Postby nick761 » Wed Jul 11, 2012 4:18 pm

tl;dr This 1,646 word post describes my frustration with CUPS and hplip. I cannot get my HP Deskjet F4400 set up with CUPS, and all the solutions I've tried don't work. It was also posted to the Arch Linux forum here.

I'm running Arch Linux ARM on my Seagate DockStar, a small ARM-based "plug computer" that I use as a home server. My printer is the HP Deskjet F4480, which is part of the HP Deskjet F4400 series.

I previously had CUPS set up to share my printer with my home network, using hplip for the printer driver. I never upgraded CUPS or hplip because those versions worked fine, and I didn't want to break anything avoid breaking anything. The versions that I was using had to have been at least one to two years old.

Everything was working very smoothly... until a few days ago. The drive I was running Arch Linux ARM on became corrupt, so I had to install a fresh copy of the operating system. That meant losing all of the working versions and configuration files each application I had installed, including CUPS. I thought I had a backup image of the drive, but it didn't work when I tried to restore it. (Yes, it was stupid of me not to test my backup.)

Setting up CUPS was one of the first things that I wanted to do after reinstalling, since my family depends on the network printing functionality almost daily. Unfortunately, I could not get CUPS to work with my printer correctly. It wouldn't be able to display a list of drivers, HP's setup utility encountered an error adding it, and it threw various errors when I tried to print test pages. I ended up reading hundreds of forum posts, wiki articles, and CUPS/hplip tutorials to try to figure out how to properly set it up. I ended up spending a total of nearly ten hours trying to get the printer to print with CUPS, and it's still not working after all that work.

I'm going to explain in this post some of the many things that I've tried so far. I just removed all of the printing packages from my system and any extra files that were left behind. I'm now going to be installing all of the packages again and documenting everything that I have been trying to do to get it to work. I'll try to include exact error messages and logs where necessary.

1. I first found this article on the Arch Linux ARM website on how to set up a CUPS printer. I didn't really want to use webmin, but I did it anyway so that I could follow the guide. I installed all the packages mentioned except for cups-pdf, since I didn't need print to PDF support. Everything installed smoothly, and I configured CUPS and webmin to allow access to other computers on the network. I started to notice problems in the instructions - /etc/rc.d/cups was actually /etc/rc.d/cupsd, /etc/printers.conf was actually /etc/cups/printers.conf, and webmin didn't actually add anything to the printers.conf file. I uninstalled webmin at this point because I didn't need it, and I decided I wasn't going to follow that guide with incorrect information.

2. I then tried to set up the printer on my own using the CUPS web interface listening on port 631. I clicked the Add Printer button and it switched me to the HTTPS web interface. I then logged into the root account and was presented with the list of printers. My printer was listed as "HP Deskjet F4400 series (HP Deskjet F4400 series)", so I selected it and continued. I saw a list of printer models (PPD files) ending in CUPS+Gutenprint v5.2.9. There was no entry for my printer, so I tried the "HP DeskJet Series (en)" one. I set the default options and chose Maintenaince->Print test page. I then got a ridiculously simple error: "Unable to print test page: No such file or directory". How do I even know what file or directory it's referencing? I read online that it may be because I'm not in the lp group, but root is indeed in there. I saw in the error log "Avahi client failed: -26". I started dbus and avahi-daemon just in case, but I still got that silly error. I restarted cups and the same error message occured.

3. I researched online that pretty much the only way for my printer to have a driver would be to install hplip. Before installing hplip, I uninstalled CUPS, leaving cupsd.conf but deleting printers.conf. Then I installed CUPS and hplip together, with hplip requiring foomatic-db, foomatic-db-engine, and foomatic-filters. Everything seemed to install correctly. I started CUPS again and then ran hp-setup -i to try to install my printer. I selected USB and it found my printer, hp:/usb/Deskjet_F4400_series?serial=[printer serial number here]. I entered a simple name and then was told that no PPD file was found for the printer but that I could specify one manually. There were none I could find online; everywhere it just said to install hplip. I used the find command to find "f4400" and finally found 2 compressed PPDs located at /usr/share/ppd/HP/hp-deskjet_f4400_series-hpijs.ppd.gz and /usr/share/ppd/HP/hp-deskjet_f4400_series.ppd.gz. I gunzipped both of them and pointed hpsetup to the hpijs one, knowing that I was using the hpijs one when it was working before. It told me "Description for the file: HP Deskjet f4400 Series hpijs, 3.12.6". Hooray! I selected to use it, but then setup failed: "error: Printer queue setup failed. Please restart CUPS and try again." Ugh!

4. I restarted CUPS and went into the hp-setup process again. It gave me the same printer queue setup failed error. I don't know if these entries in the CUPS error log are related or not, but these errors relating to foomatic showed up. I restarted CUPS again and this time used the non-hpijs file with hp-setup. This one was called "Description for the file: HP Deskjet f4400 Series, hpcups 3.12.6". It failed again with the same error and the same entries in the error log. I found lots of posts online about this error, but none seemed to have a solution that would work for me. Now I tried running hp-setup in debug mode with -g. Here is what it said before the error. I then tried to Google "debug: addPrinter() returned (0, Unable to connect to CUPS server)". I saw on an Arch bug report to install dbus-python and python2-gobject, as well as create a symlink for /usr/bin/python2 to /usr/bin/python. It didn't work - same error.

5. I then tried to add the printer to CUPS via its web interface. Now there were two listed, HP Deskjet F4400 series (HP Deskjet F4400 series) and HP Deskjet F4400 series USB [printer serial number here] HPLIP (HP Deskjet F4400 series). So, hplip added the second one. I tried both of them, but after clicking Continue the page started to hang. I got another stupid, undescriptive error. "Unable to get list of printer drivers: Success". I saw the same foomatic errors in the error log as before. I then started reading the ArchWiki page on CUPS, located here. I tried the blacklisting usblp. I tried changing the permissions on the device node, although this starts to become ridiculous that it is even required to do that. Nothing was working; the printer installation still didn't work with hp-setup or with CUPS. Then, I found what I was looking for: the exact error I had on the wiki page! It said for "Unable to get list of printer drivers" you should "Try to remove Foomatic drivers." WTF? Foomatic is required for hplip, and hplip is required for my printer. I can't do that. Forum posts say to try that or do the permissions or usblp thing. Nothing is working.

6. I tried various other things to get it to work, even though I knew they probably wouldn't make it any different. I copied the PPDs from hplip to another folder and uninstalled hplip and foomatic. I then added them to /usr/share/cups/model and CUPS successfully found them and set up the printer. I reinstalled hplip and foomatic since they're needed for those PPDs to function, and I tried printing a test page. It failed. I tried using the CUPS web interface to modify the printer driver; nope, that wasn't going to happen: "Unable to get list of printer drivers: Success".

That concludes the list of some of the things that I have tried so far. I really want to get this printer working, but right now I am really fed up with CUPS and hplip. It's things like this that make me hesitant to recommend Linux to anyone else. So much manual configuration and tinkering the inner workings of things is required to do tasks that would be quite simple on Windows. For example, I can plug this printer into my Windows 7 machine right now, wait for the driver to automatically be installed and configured, and have a test page in my hands less than a minute after I first plugged in the USB cable. I can share the printer with any other Windows machine on the network by checking a single checkbox.

But back to my problem with getting the printer to work on my DockStar. I just uninstalled all of CUPS, hplip, and foomatic again and removed all of their files. I can walk through things to try that you guys post and then give you full logs of everything - just give me exactly what to do and install and the exact order to do it all in. I just don't know what to do at this point and am so frustrated with this that I'm about to give up.

Does anyone have any suggestions on how to get this printer working? I know this was a very long post, but I just wanted to explain everything that I've tried and how nothing worked. I really hope that we can figure this out so that I'll be able to print, and maybe it'll solve a few other people's problems with their printers, too. Thanks for reading, and thanks in advance for the help.
nick761
 
Posts: 5
Joined: Tue Jun 29, 2010 9:44 pm

Re: Trouble printing with my HP Deskjet printer using CUPS/h

Postby Kresimir » Sat Jul 21, 2012 8:27 pm

Hello,
I seem to have had similar problems as you for the past 3 days.
Wanted to setup AirPrint via my RaspberryPi following http://archlinuxarm.org/support/guides/applications/cups-apple-airprint using my HP Photosmart D7260 connected via network.
Run into the same problem like you when running "hp-setup":
1)
Noticed same inconsistencies in instructions as you.
2)
"hp-setup" was not able to locate a suitable PPD for my printer.
After several attempts to get things working, finaly decided to work around this issue by downloading hplip-3.12.6.tar.gz, extracting and copying the PPD for my printer ("hp-photosmart_d7200_series.ppd.gz") to folder /usr/share/cups/model.
During execution of "hp-setup" I gave a full-path reference to the file, it worked.
3)
Tried same suggestions as you regarding missing python packages, changing symlink /usr/bin/python from python3 to python2, etc. - no progress.
Btw. the symlink change should have no effect with the most recent hplip version as it referes explicitly to #!/usr/bin/python2 in its first line.
3)
After entering further information like location and additional info, "hp-setup" always failed with this two lines ...
$this->bbcode_second_pass_code('', '
...
hp-setup[989]: debug: addPrinter() returned (0, Unable to connect to CUPS server)
error: Printer queue setup failed. Please restart CUPS and try again.
')


I finaly solved my pain when I decided to digg into the /usr/bin/hp-setup (python) script itself.
Full path and actual filename are /usr/share/hplip/setup.py
I edited the file section starting at line 120, adding another section for restart of cupsd (new lines marked with ">>") ...
$this->bbcode_second_pass_code('', '
def restart_cups():
if os.path.exists('/etc/init.d/cups'):
return '/etc/init.d/cups restart'

elif os.path.exists('/etc/init.d/cupsys'):
return '/etc/init.d/cupsys restart'

>> elif os.path.exists('/etc/rc.d/cupsd'):
>> return '/etc/rc.d/cupsd restart'

else:
return 'killall -HUP cupsd'
')
After this last modification hp-setup went through without reporting any errors, added the printer to CUPS and printed a nice test-page.
Hope this might solve your problems.
Regards,
Kresimir
Kresimir
 
Posts: 7
Joined: Sat Jul 21, 2012 7:56 pm

Re: Trouble printing with my HP Deskjet printer using CUPS/h

Postby nick761 » Mon Jul 23, 2012 2:12 pm

$this->bbcode_second_pass_quote('Kresimir', 'H')ello,
I seem to have had similar problems as you for the past 3 days.
Wanted to setup AirPrint via my RaspberryPi following http://archlinuxarm.org/support/guides/applications/cups-apple-airprint using my HP Photosmart D7260 connected via network.
Run into the same problem like you when running "hp-setup":
1)
Noticed same inconsistencies in instructions as you.
2)
"hp-setup" was not able to locate a suitable PPD for my printer.
After several attempts to get things working, finaly decided to work around this issue by downloading hplip-3.12.6.tar.gz, extracting and copying the PPD for my printer ("hp-photosmart_d7200_series.ppd.gz") to folder /usr/share/cups/model.
During execution of "hp-setup" I gave a full-path reference to the file, it worked.
3)
Tried same suggestions as you regarding missing python packages, changing symlink /usr/bin/python from python3 to python2, etc. - no progress.
Btw. the symlink change should have no effect with the most recent hplip version as it referes explicitly to #!/usr/bin/python2 in its first line.
3)
After entering further information like location and additional info, "hp-setup" always failed with this two lines ...
$this->bbcode_second_pass_code('', '
...
hp-setup[989]: debug: addPrinter() returned (0, Unable to connect to CUPS server)
error: Printer queue setup failed. Please restart CUPS and try again.
')


I finaly solved my pain when I decided to digg into the /usr/bin/hp-setup (python) script itself.
Full path and actual filename are /usr/share/hplip/setup.py
I edited the file section starting at line 120, adding another section for restart of cupsd (new lines marked with ">>") ...
$this->bbcode_second_pass_code('', '
def restart_cups():
if os.path.exists('/etc/init.d/cups'):
return '/etc/init.d/cups restart'

elif os.path.exists('/etc/init.d/cupsys'):
return '/etc/init.d/cupsys restart'

>> elif os.path.exists('/etc/rc.d/cupsd'):
>> return '/etc/rc.d/cupsd restart'

else:
return 'killall -HUP cupsd'
')
After this last modification hp-setup went through without reporting any errors, added the printer to CUPS and printed a nice test-page.
Hope this might solve your problems.
Regards,
Kresimir


Thank you so much for taking the time to reply. That did fix the problem with adding the printer to CUPS, but it looks like there's another problem with hplip and foomatic for my printer. I'm getting the dreaded "/usr/lib/cups/filter/foomatic-rip failed" error that can have so many causes. I've tried tons more solutions online to try to fix it, but of course it won't work.

I wish an Arch developer would actually try to print something with a HP Deskjet USB printer that requires hplip's hpijs PPDs. It simply doesn't work. The packages really need to be fixed (but they never will be because no one cares) - I've now given up completely on running this printer on Arch. I've spent 20 HOURS on this now and I'm done. So ridiculous.
nick761
 
Posts: 5
Joined: Tue Jun 29, 2010 9:44 pm

Re: Trouble printing with my HP Deskjet printer using CUPS/h

Postby WarheadsSE » Mon Jul 23, 2012 7:15 pm

Have you contacted the maintainer of this package?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to Hardware

Who is online

Users browsing this forum: No registered users and 6 guests