WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: CUPS extension?  (Read 10032 times)

Offline kabera

  • Newbie
  • *
  • Posts: 12
Re: CUPS extension?
« Reply #15 on: August 20, 2015, 03:50:02 PM »
Thanks bmarkus, let us know when you have something to try!
I have a printer I would love to hook to a tinycore rasp to turn it into a network printer for the whole household

Offline angryjack

  • Newbie
  • *
  • Posts: 22
Re: CUPS extension?
« Reply #16 on: September 01, 2015, 04:16:37 AM »
Hello bmarkus,

do you have any progess with this issue ?  ;)

Offline angryjack

  • Newbie
  • *
  • Posts: 22
Re: CUPS extension?
« Reply #17 on: September 12, 2015, 09:01:19 AM »
Hi there,

seems to be that bmarkus is very busy. Anybody here to help gettin CUPS working?

Offline angryjack

  • Newbie
  • *
  • Posts: 22
Re: CUPS extension?
« Reply #18 on: September 24, 2015, 08:01:18 AM »
I don't give up  ;)

Please make it possible to find the time to get CUPS running on PiCore !

Offline jncl

  • Newbie
  • *
  • Posts: 38
Re: CUPS extension?
« Reply #19 on: September 25, 2015, 08:10:39 PM »
Hi,

  I've done some work to get cups working on a Pi B+ with 7.0alpha6 (4.1.7-piCore+). It should work on other Pi h/w and earlier versions of piCore. I've made some assumptions, namely that the cups extension to be used is v2.0.4 and that both the cups and cups-doc extensions are available for the version of piCore you are intending to run.

  I have tested this on the h/w & s/w mentioned above and I am able to access the Web Interface successfully. I haven't tried to add any printers etc so don't know if there is anything else required, but at least it's a start ;)

Code: [Select]
#!/bin/sh

# get x86 version of cups
cd $HOME
wget -c http://repo.tinycorelinux.net/6.x/x86/tcz/cups.tcz
# mount it for access
sudo mkdir -p /tmp/tcloop/cups_x86
sudo mount cups.tcz /tmp/tcloop/cups_x86 -t squashfs -o loop,ro,bs=4096

# copy config files
sudo mkdir -p /usr/local/etc/cups
sudo cp /tmp/tcloop/cups_x86/usr/local/etc/cups/cups-files.conf /usr/local/etc/cups/cups-files.conf
sudo cp /tmp/tcloop/cups_x86/usr/local/etc/cups/cupsd.conf.default /usr/local/etc/cups/cupsd.conf

# edit the cups-files.conf to correct directory names and uncomment variables
sudo sed -i "s#/var/#/usr/local&#g; s/#CacheDir/CacheDir/; s/#RequestRoot/RequestRoot/; s/#StateDir/StateDir/; s/#TempDir/TempDir/" /usr/local/etc/cups/cups-files.conf

# copy startup script
sudo cp /tmp/tcloop/cups_x86/usr/local/etc/init.d/cups /usr/local/etc/init.d/cups

# add startup script to /opt/bootlocal.sh
echo -e "\n/usr/local/etc/init.d/cups start\n" >> /opt/bootlocal.sh

# unmount x86 version and remove file
sudo umount -d /tmp/tcloop/cups_x86
rm -f cups.tcz

# install missing doc files
tce-load -wi cups-doc

# since v1.7.4 of cups symlinks aren't allowed
# so replace them with the actual files
for f in apple-touch-icon.png cups-printable.css cups.css index.html; do
[ -h /usr/local/share/doc/cups/$f ] && sudo rm -f /usr/local/share/doc/cups/$f
sudo cp /tmp/tcloop/cups-doc/usr/local/share/doc/cups/$f /usr/local/share/doc/cups/$f
done

# make sure these files are backed up
echo usr/local/etc/cups >> /opt/.filetool.lst
echo usr/local/etc/init.d/cups >> /opt/.filetool.lst
echo usr/local/share/doc/cups >> /opt/.filetool.lst

# backup all the changes
filetool.sh -b

Then follow these steps:
1. Copy the code into a file, /home/tc/cups_fix.sh, on the Raspberry Pi and ensure it's executable.
Code: [Select]
chmod +x /home/tc/cups_fix.shcups_fix.sh2. Run /home/tc/cups_fix.shcups_fix.sh and Reboot the Pi when it completes.
3. For headless access from another computer
Code: [Select]
ssh tc@<ip_address_of_pi_with_cups> -T -L 3631:localhost:631
4. Point your Browser to localhost:631, or localhost:3631 if headless, and the Web Interface will appear.

If you have any issues with the code, or these instructions, I'll try to help.

  Jon

Offline boat-bum

  • Newbie
  • *
  • Posts: 5
Re: CUPS extension?
« Reply #20 on: October 10, 2015, 01:50:21 PM »
JNCL (Jon) thank you so much for this script.  I did each step manually and it worked great. 

I wanted to do remote administration so I did the
>sudo cupsctl --remote-admin

One issue I have is that any attempt to add a printer, I get "Forbidden".  I edited the cupsd.conf and cups-files.conf to allow pretty much everything and still get the issue.  I tried a bunch of stuff, including file permissions and groups until I looked in the /usr/local/var/log/cups/error_log

E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address [v1.::]:631 - Address family not supported by protocol.
E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address /var/run/cups/cups.sock:0 - No such file or directory.
E [09/Oct/2015:18:33:39 +0000] [Client 8] Returning HTTP Forbidden for CUPS-Get-Devices (no URI) from localhost
E [09/Oct/2015:18:33:39 +0000] [CGI] CUPS-Get-Devices request failed with status 401: Forbidden

I changed my cupsd.conf to point to localhost:631 but get:
E [10/Oct/2015:17:24:20 +0000] Unable to open listen socket for address [v1.::1]:631 - Address already in use.
E [10/Oct/2015:17:24:20 +0000] Unable to open listen socket for address 127.0.0.1:631 - Address already in use.
E [10/Oct/2015:17:25:02 +0000] [Client 6] Returning HTTP Forbidden for CUPS-Get-Devices (no URI) from localhost
E [10/Oct/2015:17:25:02 +0000] [CGI] CUPS-Get-Devices request failed with status 401: Forbidden

IP address or machine name result in the same address already in use

0.0.0.0 results in Duplicate listen address "0.0.0.0" ignored.

Any pointers on how to result this issue would be greatly appreciated.

Thanks
Brent

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11512
Re: CUPS extension?
« Reply #21 on: October 10, 2015, 09:14:44 PM »
Hi boat-bum
Quote
E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address [v1.::]:631 - Address family not supported by protocol.
Just a guess on my part, but that looks like an IP6 address it's complaining about. Maybe you need to install ipv6?

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: CUPS extension?
« Reply #22 on: October 10, 2015, 11:21:21 PM »
No idea but this is from the cups info file. Did you 'sudo passwd'?

                howto:
                $ sudo /usr/local/etc/init.d/cups [start|stop|restart|status]
                the root password needs to be set perform admin tasks with..
                ..the browser interface
                $ sudo passwd
                http://localhost:631 will start the browser interface
                To persist across boots, add the following to your backup (remove leading "/"):
                /usr/local/etc/cups/ppd/HP_OfficeJet_G85.ppd [for example]
                /usr/local/etc/cups/printers.conf
                /usr/local/etc/cups/cupsd.conf (only if you changed it)
                /etc/shadow (if you want to save to root password

Offline boat-bum

  • Newbie
  • *
  • Posts: 5
Re: CUPS extension?
« Reply #23 on: October 11, 2015, 11:44:03 PM »
nitram - I didn't see that so that definitely got me further.  Thank you very much.  I saw in one of the other cupsd.conf that you weren't supposed to use a userid with a uid of 0.

I was not able to get it to recognize any network printers and now get:
 CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: CUPS extension?
« Reply #24 on: October 12, 2015, 12:46:34 AM »
// ...that definitely got me further.  Thank you very much.
No problem, sorry i can't help more. Have yet to set up a printer myself in TC, will learn from you :)

Forgot to mention from one of your posts above:
E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address [v1.::]:631 - Address family not supported by protocol.

Odd date, maybe confirm the output of 'date & cal' is OK.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14750
Re: CUPS extension?
« Reply #25 on: October 12, 2015, 02:32:27 AM »
CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files

Quote
E [01/Jan/1970:00:00:47 +0000] Unable to open listen socket for address [v1.::]:631 - Address family not supported by protocol.

You can ignore both of these messages (unless you use ipv6).

What make and model of printer do you have and how is it connected to your network?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14750
Re: CUPS extension?
« Reply #26 on: October 12, 2015, 03:13:56 AM »
As a test, albeit using corepure64:
Code: [Select]
$ tce-load -i hplip [loads cups, ghostscript, libusb, net-snmp, dbus-python, libsane, libavahi, cups-filters and a few others]

$ sudo passwd [set root password]
$ sudo /usr/local/etc/init.d/cups start

then:
* open fifth browser, enter http://localhost:631/
* click "administration" [asks for username(root)/password]
* click "add printer" [shows "Discovered Network Printers: Officejet 6700 Premium e-All-in-One (HP Officejet 6700)"]
[Connection: socket://192.168.1.170:9100]
click "add" [proposes driver for model HP Officejet 6700, hpcups 3.13.11 (en)]
click "add"
click "Maintenance/"Print Test Page"

Entire contents of log:
Code: [Select]
$ cat /var/log/cups/error_log
E [12/Oct/2015:10:41:39 +0000] Unable to open listen socket for address [v1.::1]:631 - Address family not supported by protocol.
E [12/Oct/2015:10:43:46 +0000] [cups-deviced] PID 4887 (dnssd) stopped with status 1!
E [12/Oct/2015:10:43:47 +0000] [cups-deviced] PID 4877 (hpfax) stopped with status 1!
W [12/Oct/2015:10:47:20 +0000] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files

/usr/local/etc/cups/{cups-browserd.conf, cups-files.conf, cupsd.conf} are all unchanged defaults

I'm not sure if the Raspberry Pi cups was compiled with support for libavahi, with cups-filters or configured with "--with-cups-user=tc --with-cups-group=staff", all of which might make a difference?

Offline boat-bum

  • Newbie
  • *
  • Posts: 5
Re: CUPS extension?
« Reply #27 on: October 12, 2015, 10:24:57 AM »
nitram - yes some of the messages have the old date but others have the correct one.

Juanito - thank you for the info.  Since I am not using IPv6, it is nice to know I don't have to worry about those messages.

hplip was not found so I tried to load the packages individually.  libsane, libavahi, cups-filter were also not found so it looks like tiny core might have limitations.  That is a shame since piCore would make the perfect Airprint server.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14750
Re: CUPS extension?
« Reply #28 on: October 12, 2015, 10:56:49 AM »
You'll only need hplip if you have an hp printer and only need libsane if you use hplip.

cups might need to be compiled against libavahi and require cups-filters for automatic network printer browsing to be enabled, but you should still be able to connect directly without them by entering an address of the form "socket://192.168.1.170:9100" or similar.

Offline boat-bum

  • Newbie
  • *
  • Posts: 5
Re: CUPS extension?
« Reply #29 on: October 12, 2015, 11:25:16 AM »
I have an HP Laserjet 4050 printer.  Corporate downsizing does have some benefits.

Doing Appsocket/JetDirect (socket://192.168.1.40:9100) with several different options for configuring the printer, but always get:
Unsupported format "application/vnd.cups-banner"

In error log:
E [12/Oct/2015:15:19:34 +0000] [Client 26] Returning IPP client-error-document-format-not-supported for Print-Job (ipp://localhost:631/printers/Brd) from localhost