FreeBSD 9.0 + CUPS + HPLIP + HP Deskjet F2200 = no success yet.

I am using FreeBSD 9.0 + CUPS + HPLIP + HP Deskjet F2200. I have compiled everything from ports, found my printer via the CUPS web interface, all without any obvious problems.

However, when I click "Print test page" nothing happens. Here is what /var/log/cups/error_log says:
Code:
X [12/Jul/2012:15:26:18 +0200] kevent() returned Bad file descriptor
E [12/Jul/2012:15:41:34 +0200] Returning IPP client-error-not-authorized for Print-Job.
Here are the contents of my /etc/devfs.rules:
Code:
[system=10]
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
add path 'usb*' mode 0770 group cups
add path 'ugen*' mode 0660 group cups

#the following didnt work either
#add path 'usb/3.2' mode 0660 group cups

Both my root and regular users are members of the cups and wheel groups.

I am starting cupsd and my devfs(8) ruleset at startup:
Code:
#invoke local devfs rule
devfs_system_ruleset="system"
#start cups
cupsd_enable="YES"
I have read CUPS on FreeBSD numerous times. What am I missing?

Any help would be greatly appreciated.
 
Oh and I should have mentioned that my /var/log/cups/access_log says:
Code:
localhost - - [12/Jul/2012:16:27:07 +0200] "POST /printers/HP_Deskjet_F2200_series HTTP/1.1" 200 464 Print-Job successful-ok

And sorry for the lack of formatting, I am writing using elinks, and I haven't worked out how to do formatting with it yet :/
 
I think its /usr/local/etc/cups/cupsd.conf

Code:
# Restrict access to the server...
<Location />
  Order allow,deny
</Location>

Try adding an Allow your subnet to this section.
 
Sorry, this might seem dumb, but I'm quite bad at networking:

What exactly is my subnet?

% ifconfig
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether b0:48:7a:d0:df:c9
inet6 fe80::b248:7aff:fed0:dfc9%wlan0 prefixlen 64 scopeid 0xa 
inet 192.168.1.8 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g
status: associated
ssid DumbDumb channel 1 (2412 MHz 11g) bssid f4:3e:61:29:8e:08
regdomain 32924 country CN indoor ecm authmode WPA2/802.11i
privacy ON deftxkey UNDEF TKIP 2:128-bit txpower 20 bmiss 7
scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7
roam:rate 5 protmode CTS wme burst roaming MANUAL

And after looking at /usr/local/etc/cups/cupsd.conf I can see that
Code:
# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
</Location>

doesn't stop me from viewing the admin pages, so I'm wondering if it is the problem which you suggest.

As soon as I work out my subnet, however, I will try what you've suggested.

Thanks
 
Thanks for the subnet. I'll be sure to go and work out how you worked that out :)

I've added
Code:
# Restrict access to the server...
<Location />
  Allow 192.168.1.0/24
  Order allow,deny
</Location>

to my /usr/local/etc/cups/cupsd.conf

then

% /usr/local/etc/rc.d/cupsd restart

After that, I tried once again to print a test page, but nothing. Here is what's written in /var/log/error_log:

Code:
X [13/Jul/2012:11:16:32 +0200] kevent() returned Bad file descriptor

In /var/log/access_log it just says "print job successful" or something like that.
 
Is it safe to assume that you have Foomatic (Foomatic filters) installed? I can't remember if CUPS automatically installs it.

Well anyway .... try this ....

See if you have a /usr/local/etc/foomatic directory. If so, take a look at the file filter.conf.

Edit it to make sure that the following line is uncommented...

Code:
cupsfilterpath: /usr/local/lib/cups/filter:/usr/local/lib/cups/filter:/usr/local/libexec/cups/filter:/opt/cups/filter:/usr/lib/cups/filter

Save the file, then restart CUPS again.

See if that works. If it doesn't, post your complete /usr/local/etc/cups/cupsd.conf file.
 
Might check to see that all the settings match between your computer and the printer. I have a brother all-in-one...and its set with US Letter size pages. But, when I built things from ports the first time, I didn't catch that you have to pick US Letter size in some of the configuration screens. And, my printer will just quietly accept print jobs for wrong size paper and give no indication of error.

The other possibility is that the printer is advertising capabilities it doesn't have. Since my printer is physically the same as a higher end model, but the firmware makes it the lower-end model. It stumped me that my printer was reporting that it was capable of Postscript, when it wasn't. Again, it would just quietly /dev/null things sent to its IPP/Postscript queue....

The Dreamer.
 
I have uncommented the line you mentioned, restarted cupsd, and tried again, but no luck.

And I am pretty sure my printer is capable of printing a test page. It was working under PC-BSD with HPLIP and CUPS.

The /var/log/error_log syill shows:

Code:
X [14/Jul/2012:15:41:00 +0200] kevent() returned Bad file descriptor

and my /var/log/access_log still shows:

Code:
ocalhost - - [14/Jul/2012:15:46:01 +0200] "POST /printers/HP_Deskjet_F2200_series HTTP/1.1" 200 464 Print-Job successful-ok

So here is my cupsd.conf

Code:
#
# "$Id: cupsd.conf.in 9407 2010-12-09 21:24:51Z mike $"
#
# Sample configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn

# Administrator user group...
SystemGroup wheel


# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Web interface setting...
WebInterface Yes

# Restrict access to the server...
<Location />
  Allow 192.168.1.0/24
  Order allow,deny
</Location>

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>

# Set the default printer/job policies...
<Policy default>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

# Set the authenticated printer/job policies...
<Policy authenticated>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>

  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  # All administration operations require an administrator to authenticate...
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # All printer operations require a printer operator to authenticate...
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  # Only the owner or an administrator can cancel or authenticate a job...
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

#
# End of "$Id: cupsd.conf.in 9407 2010-12-09 21:24:51Z mike $".
#
 
Well, I guess since it was only listen localhost:631, the Allow 192.168.1.0/24 was unnecessary.

Though you first reported the message:

Code:
E [12/Jul/2012:15:41:34 +0200] Returning IPP client-error-not-authorized for Print-Job.

Which made me think that it was an IP restriction.

I think print/hplip includes print/foomatic-filters as a dependency.

An HP Deskjet F2200 is USB only right? Having a hard time finding out what the specs are on it online. Personally, I'm using an HP Photosmart 8450xi...but I'm using its network interface....oh, and I'm using the HP Photosmart 7550 driver in CUPS.

How do you have you're printer configured in CUPS?

Also how does the printer show up? ugen or ulpt

Seem to recall that it has to be ugen, which meant you couldn't use the GENERIC kernel.

The Dreamer
 
Thanks for the continuing help and support! Perhaps the
Code:
Allow 192.168.1.0/24
was unnecessary, but thanks anyway. I haven't had that IPP client error again, it may have been something that happened when I tried reinstalling the printer.

And at the risk of creating a wave of facepalms and anger, I have to say I was told that HPLIP could be used with the GENERIC kernel on FreeBSD 9.0, and that the HPLIP documentation [which I have read, I promise!] was simply out-of-date.

So yes, I am using the GENERIC kernel. I guess I'll get on and recompile my kernel then, as soon as my blood returns from my face to my fingers, that is.
 
nickednamed said:
And at the risk of creating a wave of facepalms and anger, I have to say I was told that HPLIP could be used with the GENERIC kernel on FreeBSD 9.0, and that the HPLIP documentation [which I have read, I promise!] was simply out-of-date.

Well, that could be the case. I don't have a USB printer handy to try at the moment. Though seems finding a new network AIO inkjet printer that'll print onto CDs is hard.
 
Where do you get this information that you need to recompile the kernel to use an USB printer with CUPS? And what kind of changes do you need to do the kernel configuration? To me it sounds like bogus information.
 
I have no information as to whether CUPS requires kernel modification, but I have read in many places including http://freebsd.kde.org/howtos/hplip.php that HPLIP requires such modification.

The HPLIP documentation has it somewhere, although I can't find it now. If I do, I will edit this post. There are also warning message following the installation of HPLIP.

However, as I said, I am now unclear as to the accuracy of even the documentation of HPLIP. Once I connected my PC I got a message to the effect:

Code:
ugen3.2: <HP>
ulpt0: <HP Deskject F2280>

Or something very similar, which was in line with what I was told - specifically that FreeBSD 9.0 can be configured to set the printer as ugen without removing ulpt from the kernel.

I may be very wrong on this.
 
For HPLIP, you are correct: your printer needs to be a ugen device. The newest / newish usb stack provides multiple nodes for usb devices, to aid in scenarios where more than one driver would like to use a device. If that came with 9.0 or eometime in 8.x, I can't remember.
What happens if you do
$ ls -l /dev/ugen3.2 /dev/ulpt0
do they point to the same device / link?
 
tingo said:
For HPLIP, you are correct: your printer needs to be a ugen device. The newest / newish usb stack provides multiple nodes for usb devices, to aid in scenarios where more than one driver would like to use a device. If that came with 9.0 or eometime in 8.x, I can't remember.
What happens if you do
$ ls -l /dev/ugen3.2 /dev/ulpt0
do they point to the same device / link?

$ > ls -l /dev/ugen3.2 /dev/ulpt0 gives me

Code:
lrwxr-xr-x  1 root  wheel            9 Jul 21 12:22 /dev/ugen3.2 -> usb/3.2.0
crw-r--r--  1 root  operator    0, 164 Jul 21 12:22 /dev/ulpt0

I don't know the significance of this information though. Is it good? :)
 
% > ls -l /dev/usb/3.2.0
Code:
crw-------  1 root  operator    0, 107 Jul 22 12:05 /dev/usb/3.2.0

% > ls -l /dev/ulpt0
Code:
crw-r--r--  1 root  operator    0, 164 Jul 22 11:56 /dev/ulpt0

I guess not.

Perhaps this is opening a whole new can of worms, but here goes: Before recompiling my kernel, I thought I would try the FreeBSD handbook one more time, from the beginning, this time using LDP as the handbook suggests.

I got as far as Checking Printer Communications but % lptest > /dev/ulpt0 did nothing. Neither did variants such as % cat file > /dev/ulpt0 or % lptest 20 5 | lpr etc. No printer noises, no flashing lights, nothing.

Perhaps the problem is much more basic than a CUPS / HPLIP problem. Although the printer was workin fine under Windows and PC-BSD so I know the hardware is in good working order.
 
If it works with PC-BSD, just copy that configuration. It may be as simple as using the non-resetting USB device, /dev/unlpt0.

lptest(1) or any ASCII output will only print on printers that understand plain ASCII. Many do not, the vendors having chosen to use proprietary page description languages, "host-based" printers, or hardware so cost-reduced it doesn't have ROM and must have firmware downloaded by the driver before use. Some have a combination of these misfeatures. The openprinting.org website shows this printer as using LIDIL, a proprietary page description language.
 
Thank you for the continuing help. I will have to re-install PC-BSD to get a look at the config, as I failed to take note of it as I was happy that it "just worked".

I did come across that openprinting.org link early on in my printing mission, but I wasn't sure how similar that model is to mine. Similar enough I guess.

Just my luck to get an HP printer that doesn't even speak PCL! You get what you pay for I guess.

Does anyone know if it would be worth my time setting up LPD + HPIJS instead of CUPS + HPLIP? My printing needs are quite basic I suppose: I need to print only a few pages of PDFs; the odd black and white, line-drawn image; text documents and things like that.

I am running a fairly "light" system, doing as much as possible from the command line [as the whole point of me using FreeBSD is to learn something], so I don't / won't use many / if any of the graphical aspects of CUPS + HPLIP.
 
I'm going to try LPD + HPIJS + Ghostscript. I have followed both the FreeBSD Printing and the guide just posted [thank you]. Here is my /etc/printcap:
Code:
hp|lp|f2280:\
        :sh:\
        :sd=/var/spool/lpd/f2280:\
        :lp=/dev/ulpt0:\
        :mx#0:\
        :lf=var/log/f2280.log:

But if I have understood correctly, this will not be enough for my needs [printing PDFs, images, the odd webpage, etc]. I believe I will need the print jobs translated into LIDIL.

Would I be correct in assuming for this I need the HPIJS driver? It lists my printer as supported. The requirements are listed as ghostscript9 and foomatic-filters. Is this sufficient?

If so, should I add the following to my /etc/printcap?
Code:
:if=/path/to/foomatic-rip:\
:af=/path/to/my/printer's/ppd:\
 
Can't speak to the specifics (haven't used HPIJS), but yes. The if= (input filter) is a filter to render incoming data into something the printer can understand. The lf= log file entry is not required. If you leave it out, errors go to /var/log/lpd-errs, which is usually adequate.
 
Ok so I have installed HPIJS + Ghostscript + Foomatic-Filters. Trouble is, there is no .ppd file for my printer despite the claim the my printer is supported: Supported Printers

A simple search for PPD files gives me:

# find / -name \*ppd\* gives me a long list ff ppd files, but none for my printer.

No 2200 series printers at all. I will perhaps try, by trial and error, to find the right PPD file, but in the meantime, does anyone know which might be best? And why mine isn't there!?

Also, HPIJS helpfully told me after the install that there is a sample printcap file located in the files directory. OK, I found it and it contains the line:
Code:
:if=/usr/local/etc/bin/ifhp
I also found the files it refers to so I will try with this line (and copy the files to apporpriate places, etc) and see how it goes.

But now I'm left with the question: Where do I reference foomatic-rip in printcap if not in the ":if" part?
 
There is a PPD for the F2200 in print/hplip. One of the IJS or HPLIP packages is the newer replacement, one is the older, I don't know which is which.

The ifhp script should handle calling the foomatic scripts.
 
Back
Top