b455x
Posts: 16
Joined: Sat May 19, 2012 6:40 pm

Raspbian and CUPS

Tue Jul 24, 2012 10:39 pm

Hi everyone,

I'm having a problem with my Raspberry Pi, the Raspbian Image and Cups.
I installed cups on the pi with

Code: Select all

sudo apt-get install cups
and after installing it I entered

Code: Select all

sudo cupsctl --share-printers  --remote-admin --remote-printers
to make the printer accessible via network and to administrate it by another computer.

Now I can't add a printer in the webinterface of my notebook, I always get an error message, saying that the printer could not be added because it was "forbidden". Before trying this, I login with my account and password, the same I use for root on the pi.
If I enter a wrong password, the popup window comes again, so that's not the reason.

With the Image I used before, Debian Wheezy, everything worked fine...

Is it a problem with the image or am I doing something wrong?
Has anyone the same problem?
Can someone help me?

My /etc/cups/cupsd.conf:
</Limit>
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-He$
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
<Limit Cancel-Job CUPS-Authenticate-Job>
AuthType Default
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>
<Limit All>
Order deny,allow
</Limit>
</Policy>
and the CUPS Error-Log
E [25/Jul/2012:00:28:02 +0200] Returning HTTP Forbidden for CUPS-Get-Devices (no URI) from localhost
E [25/Jul/2012:00:28:02 +0200] [CGI] CUPS-Get-Devices request failed with status 401: Verboten
E [25/Jul/2012:00:36:48 +0200] Returning HTTP Forbidden for CUPS-Get-Devices (no URI) from localhost
E [25/Jul/2012:00:36:48 +0200] [CGI] CUPS-Get-Devices request failed with status 401: Verboten
("Verboten" means forbidden - I'm from Germany)

Any help would be appreciated!
I already did read a lot of stuff on the internet, but can't figure out my problem...

KameSense
Posts: 3
Joined: Wed Jul 25, 2012 12:33 am

Re: Raspbian and CUPS

Wed Jul 25, 2012 12:37 am

Hello,

You spotted the wrong lines in your /etc/cups/cupsd.conf

Try to edit your cupsd.conf according to this :

Code: Select all

<Location />
  # Allow remote administration...
  Order allow,deny
  Allow all
</Location>
<Location /admin>
  # Allow remote administration...
  Order allow,deny
  Allow all
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  # Allow remote access to the configuration files...
  Order allow,deny
  Allow all
</Location>

b455x
Posts: 16
Joined: Sat May 19, 2012 6:40 pm

Re: Raspbian and CUPS

Wed Jul 25, 2012 1:44 pm

Hey KameSense,

Thanks a lot for your help!
Unfortunately, it still doesn't work...
Here's my complete cupsd.conf, in case I forgot to edit something else...

Code: Select all

LogLevel warn
MaxLogSize 0
SystemGroup lpadmin
#Allow remote access
Port 631
Listen /var/run/cups/cups.sock
# Enable printer sharing and shared printers.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseRemoteProtocols CUPS dnssd
BrowseAddress @LOCAL
BrowseLocalProtocols CUPS dnssd
DefaultAuthType Basic
WebInterface Yes
<Location />
  # Allow shared printing and remote administration...
  Order allow,deny
  Allow all
</Location>
<Location /admin>
  # Allow remote administration...
  Order allow,deny
  Allow all
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  # Allow remote access to the configuration files...
  Order allow,deny
  Allow all
</Location>
<Policy default>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <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-J$
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-D$
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printe$
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
<Policy authenticated>
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default
  <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-J$
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-D$
    AuthType Default
    Require user @SYSTEM
   Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printe$
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>



KameSense
Posts: 3
Joined: Wed Jul 25, 2012 12:33 am

Re: Raspbian and CUPS

Wed Jul 25, 2012 2:38 pm

Did you add the user to the lpadmin group ?

Code: Select all

sudo adduser pi lpadmin

b455x
Posts: 16
Joined: Sat May 19, 2012 6:40 pm

Re: Raspbian and CUPS

Thu Jul 26, 2012 11:08 am

Thank you very much, that solved my problem!!
I hope someone else will find this useful.

I think I added lpadmin to the wrong group...

Now I can add a printer via webinterface and print a testpage, allthouth the printer is extremely slow.
Anyway, thanks for your help :-)

KameSense
Posts: 3
Joined: Wed Jul 25, 2012 12:33 am

Re: Raspbian and CUPS

Thu Jul 26, 2012 12:38 pm

Yes, it's quite slow because CUPS can be very CPU-consuming, and the CPU of the Raspberry Pi hasn't the tenth of the computing performance of our computers' CPUs.

But for those like me who don't print that often, and are not in a hurry to get their printings, it can be very satisfying, while saving very much power (~5W vs at least 300W).

v6ak
Posts: 9
Joined: Fri Aug 03, 2012 9:58 am

Re: Raspbian and CUPS

Tue Aug 28, 2012 9:06 pm

There is a simple solution for CPU load (with some restrictions):

1) Start adding a new printer on Raspberry PI.
2) Select manufacturer = Raw
3) Add the printer on local computers with appropriate drivers

This seems to let do the CPU intensive computations on clients, so CPU load on Raspberry PI is low and printing is fast.

User avatar
kbailey
Posts: 40
Joined: Fri Feb 08, 2013 6:22 am
Location: Largo Florida USA
Contact: ICQ Website

Re: Raspbian and CUPS

Wed Apr 17, 2013 4:29 am

Interesting, let the pi be a print server, and take that off a busy server or workstation, saving valued clock cycles. This is a very affordable way to add to office functionality.

I just instsalled cups and added my wifi networked printer, and it was EASY, like a trip to Venus...
:mrgreen:
-Cheers!
-_-=-_-=-_-=-_-=-_-=-_-=-_-=-_-=-
Computers are the new Logos.
Does this compute?

leopheard
Posts: 50
Joined: Thu Jun 27, 2013 5:34 pm

Re: Raspbian and CUPS

Fri Jan 03, 2014 1:48 am

I found the following helped the RPi find the printer automatically:
"If you have problems getting your USB printer to work, you can try blacklisting the usblp kernel module:"

Code: Select all

sudo nano /etc/modprobe.d/blacklistusblp.conf
blacklist usblp
as per the following great tutorial:

https://wiki.archlinux.org/index.php/CU ... leshooting

Thor17
Posts: 3
Joined: Tue Sep 17, 2013 2:34 pm

Re: Raspbian and CUPS

Sun Oct 05, 2014 3:47 pm

Hi!
I'm running minibian on my RPi. I've installed CUPS and the drivers (also the printer-driver-m2300w for my m2400W).
The webinterface of CUPS is running, I can open it, but I can't see any printers.

Output of dmesg:

Code: Select all

[  179.063638] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[  179.197228] usb 1-1.3: New USB device found, idVendor=132b, idProduct=2001
[  179.213362] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  179.230401] usb 1-1.3: Product: magicolor 2400W
[  179.244317] usb 1-1.3: Manufacturer: KONICA MINOLTA
[  179.305894] usblp 1-1.3:1.0: usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x132B pid 0x2001
[  179.336187] usbcore: registered new interface driver usblp
Blacklisting usblp didn't work for me.
If I connect the printer to my big NAS server that's running Ubuntu 14.04 and CUPS 1.72, everything works fine.
But with CUPS 1.53 on the RPi it won't work :(

fruitoftheloom
Posts: 21586
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Raspbian and CUPS

Sun Oct 05, 2014 4:20 pm

Thor17 wrote:Hi!
I'm running minibian on my RPi. I've installed CUPS and the drivers (also the printer-driver-m2300w for my m2400W).
The webinterface of CUPS is running, I can open it, but I can't see any printers.

Output of dmesg:

Code: Select all

[  179.063638] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
[  179.197228] usb 1-1.3: New USB device found, idVendor=132b, idProduct=2001
[  179.213362] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  179.230401] usb 1-1.3: Product: magicolor 2400W
[  179.244317] usb 1-1.3: Manufacturer: KONICA MINOLTA
[  179.305894] usblp 1-1.3:1.0: usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x132B pid 0x2001
[  179.336187] usbcore: registered new interface driver usblp
Blacklisting usblp didn't work for me.
If I connect the printer to my big NAS server that's running Ubuntu 14.04 and CUPS 1.72, everything works fine.
But with CUPS 1.53 on the RPi it won't work :(
Is the printer driver you installed comptable with the RPi's ARMv6 architecture ?? http://sourceforge.net/projects/m2300w
Retired disgracefully.....
......to a more gentile life !

Thor17
Posts: 3
Joined: Tue Sep 17, 2013 2:34 pm

Re: Raspbian and CUPS

Sun Oct 05, 2014 4:28 pm

It should. I just installed it with the command "sudo apt-get install printer-driver-m2300w"
apt-get should choose the right one, or am I wrong?

fruitoftheloom
Posts: 21586
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Raspbian and CUPS

Sun Oct 05, 2014 6:24 pm

Thor17 wrote:It should. I just installed it with the command "sudo apt-get install printer-driver-m2300w"
apt-get should choose the right one, or am I wrong?
Yes apt-get is correct.......
Retired disgracefully.....
......to a more gentile life !

Return to “Troubleshooting”