Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: Falco on February 11, 2015, 08:42:31 AM

Title: CUPS USB Printing Issues
Post by: Falco on February 11, 2015, 08:42:31 AM
Hello, I am working on integrating a Citrix Receiver installation with TinyCorePlus and hit a snag where I can't print to any printers that are connected via USB (NOTE: They are detected on USB). I have installed the printer drivers, via the instructions from here: *link omitted* In addition to trying the PPD, and official Brother (HL-220DW) LPR drivers.

To further clarify, I am not looking for network printing functionality as this is not the issue. USB local printing is the only thing that doesn't seem to work with this CUPS setup. Is there any additional steps that might help in this endeavor?

Thanks.
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 11, 2015, 10:20:19 AM
What does the cups error log say?

It might be worth trying ldd on any brother printer executables to see if there are any missing deps.
Title: Re: CUPS USB Printing Issues
Post by: Falco on February 16, 2015, 11:04:18 AM
What I did to get my Brother HL-2270DW printer working in Tiny Core 6.x. I believe this method will work for a variety of other printers as well.
*** Strongly recommend you read the entire solution before making an attempt. ***

I used the "Apps" application (6.x repository) to install the required base for general printing:
- cups
- foomatic-rip
- firefox
- bash

For me, this is where the trick came into play. I had to use a browser to navigate to the 2.x/3.x TinyCore repository and manually download the hpijs-dynppds.tcz file.
- Download hpijs-dynppds.tcz
- "tce-load -i hpijs-dynppds.tcz" (without the '-w' so you don't need to worry about the wget or checksum)
- "mv hpijs-dynppds.tcz /mnt/sda1/tce/optional/" (to keep is persistent for future boots)
- Add "hpijs-dynppds.tcz" into /mnt/sda1/tce/onboot.lst (to load on future boots)

Adjust the permissions for CUPS. I was consistently warned about permissions issues)
- "chown root:root /usr/local/lib/cups/*"

I copied all of the symbolic links directly into the folders. It was only required for backend and filter.
- "cd /usr/local/lib/cups/backend/"
- "cp -rfH /usr/local/lib/cups/backend/* ."

- "cd /usr/local/lib/cups/filter/"
- "cp -rfH /usr/local/lib/cups/filter/* ."

The CUPS logs, complained about a missing symbolic link "libpoppler.so.37". I was unable to find this library in Tiny Core.
- "cd /usr/lib/" (the directory that needs to contain the library)
- "ln -s /usr/local/lib/libpoppler.so.50" (create a symbolic link to a similar library)
- "mv libpoppler.so.50 libpoppler.so.37" (rename the link so CUPS can find it)

Set the root password to gain easy access to the CUPS server.
- "sudo su" (to get root)
- "passwd" (once root has been obtained)

Set CUPS to start on boot
- "cd /home/tce/X.d/"
- "touch my-init"
- "chmod a+x my-init"
- Add to "my-init"
-- "#!/bin/sh"
-- "sudo /usr/local/etc/init.d/cups start"

Adjusted the list so all of my changes would persist for future boots.
Added to /opt/.filetool.lst:
- "etc/shadow" (saves the root password that is used to gain access to the CUPS server)
- "usr/lib/libpoppler.so.37" (save the missing library for CUPS)
- "usr/local/etc/init.d/cups" (not sure if this persists, I thought I would be safe)
- "usr/local/etc/init.d/dbus" (not sure if this persists, I thought I would be safe)
- "usr/local/etc/cups" (saves CUPS & printer configurations)
- "usr/local/lib/cups" (saves the permissions changes and all of the symbolic link modifications)


A couple last notes:
- I added my printer through the CUPS server, "localhost:631".
- I used "root" + whatever password I set earlier.
- After it was added, I set it to be the sever default printer.
- In Tiny Core 6.x it would never appear under the firefox -> print menu. However, LPR would use the CUPS server default printer.
- Attempting to print a test page through CUPS never worked. There was always some sort of issue. All other forms of printing were successful.

I would be very interested in anyones feedback.
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 16, 2015, 11:22:08 AM
I'm not too sure why firefox is part of the "required base for general printing"  :o

I'd guess that either the brother printer drivers or hpijs-dynppds is looking for libpoppler.so.37 rather than cups itself.

I'm also not sure why you need to overwrite the backend and filters symlinks?

To start the cups daemon on boot, put "/usr/local/etc/init.d/cups start" in bootlocal.sh, not ~/X.d

/usr/local/etc/init.d/cups and /usr/local/etc/init.d/dbus are part of the cups and dbus extensions, so no need to add these to your backup.

'Glad you got it working  :)

BTW, I deleted your other identical post.
Title: Re: CUPS USB Printing Issues
Post by: Falco on February 16, 2015, 11:42:00 AM
Firefox was only used to access CUPS as well as download the additional tcz package that I needed.

I am not certain what exactly was looking for the "libpoppler.so.37", however I tried with many different drivers and this missing library was still one link in the chain. In my solution path, I fixed this error before the hpijs-dynppds addition was involved.

I overwrote the symlinks in backend and filter because there were complaints about insecure permissions. I was not able to change them at the source due to the read-only file system. As a result, I just copied all of the symlinks directly into those folder and there were no more complaints.

I adjusted the init script as per your suggestion. TY.

Sorry for the duplicate post.


I am now onto the next challenge of getting scanners to function with the Tiny Core 6.x environment.
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 16, 2015, 11:53:19 AM
I've only ever used hp printer/scanners and they've always worked fine with cups/hplip/sane.

Once or twice I've tried to help out with printer/scanner drivers for other manufacturers and it's always been difficult because they are usually pre-built and thus reliant on libs not necessarily present in tinycore.

Good luck with the scanners.
Title: Re: CUPS USB Printing Issues
Post by: Falco on February 16, 2015, 12:12:13 PM
I have never worked with scanners before in Linux. I have been doing plenty of reading, research and testing. I have had no luck with sane although I am still working on it.
On Tiny Core, I have installed the sane-backends, hplip, cups and a variety of other utilities to help my attempt at getting this scanner to work.

I feel as though I am still missing a large piece.

When I plug the scanner in there is not even an entry for it anywhere in the "/dev/".

Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 16, 2015, 12:17:15 PM
Is it a stand-alone scanner or is it part of a multifunction printer/scanner/fax device?

What interface does the scanner use - usb, scsi, parallel or network?

Note that hplip is only useful for hp devices.
Title: Re: CUPS USB Printing Issues
Post by: Falco on February 16, 2015, 12:23:30 PM
I have a variety of scanners that I can use to test. They are all stand-alone scanners.

My goal is to get the Fujitsu ScanSnap S1300 working locally. I have checked, and this scanner is covered by sane.
- Scanner: Fujitsu ScanSnap S1300
- Interface: USB 2.0
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 16, 2015, 12:34:16 PM
With the sane-backends extension loaded, what does "scanimage -L" give?

Did you look at the config file section of:

http://www.sane-project.org/man/sane-fujitsu.5.html

Title: Re: CUPS USB Printing Issues
Post by: Falco on February 16, 2015, 12:46:27 PM
scanimage -L output:
No scanners were identified. If you were expecting something different.
Check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate).
Please read the documentation which came with this software (README, FAQ, manpages).

I think that udev is not correctly picking up the scanner.

there is a sane-epjitsu that is said to work in place of the sane-fujitsu.

Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 16, 2015, 01:03:34 PM
Does this:
Code: [Select]
$ cat /usr/local/etc/sane.d/fujitsu.conf

..look like either of these:

"usb 0x04c5 0x1042" (or other vendor/product ids)
"usb /dev/usb/scanner0"

Does "lsusb" (with the usb-utils extension loaded) show the scanner?
Title: Re: CUPS USB Printing Issues
Post by: Falco on February 16, 2015, 01:11:16 PM
The exact model can be found under
/usr/local/etc/sane.d/epjitsu.conf

it shows up in lsusb with the proper hex as well.

Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 16, 2015, 11:50:18 PM
You could perhaps try this:
Code: [Select]
$ sudo rm /usr/local/etc/sane.d/*conf
$ sudo cp /tmp/tcloop/sane-backends/usr/local/etc/sane.d/epjitsu.conf /usr/local/etc/sane.d

..and then, looking for errors:
Code: [Select]
$ ldd /usr/local/lib/sane/libsane-epjitsu.so
$ SANE_DEBUG_EPJITSU=5 scanimage -L
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 17, 2015, 01:33:16 AM
I did some more checking - I rarely use the 32-bit version of tc - it's cups-filters that has the dep on libpoppler.so.37.

Note also that scanimage has a dep on libtiff.so.3

I'll look at this some more today
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 17, 2015, 05:12:11 AM
cups-filters and libsane/sane-backends recompiled and posted.

cups should not need libpoppler.so.37 (I had not realised the poppler extension was recently updated) and sane-backends should not need libtiff.so.3. It also looks like sane-backends used udev now.

Unfortunately the x86 version of hplip is too old for my printer so I cannot test - let me know how it goes...
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 17, 2015, 07:22:36 AM
I updated the hplip extension so I could print/scan in 32-bit tc-6.x

cups finds my network printer all on it's own, selects the correct driver and prints the test page without permissions errors, etc.

I need to use "xsane hpaio:/net/Officejet_6700?ip=192.168.1.170" for xsane to find the scanner, but otherwise it works fine.

I realise this is not the same as using a directly connected printer/scanner, but hopefully things will work.

Now I just need to recompile xsane as it has a dep on gimp2  :(
Title: Re: CUPS USB Printing Issues
Post by: Falco on February 17, 2015, 09:48:49 AM
Creating symlinks in /usr/lib/ for libpoppler.so.37 and libtiff.so.3 solves those issues.

Probably not the best solution,however, I have:
/usr/lib/libpoppler.so.37 -> /usr/local/lib/libpoppler.so.50
/usr/lib/libtiff.so.3 -> /usr/local/lib/libtiff.so.5


The problem I seem to be running into now, is with scanimage. If I plug the scanner in, run "scanimage -L" it shows me scanner. When I run the same command again, it tells me nothing can be found. It seems that the scanner can only be queried/used/scanned the very first time. I am capable of scanning with xsane as well. however if must be the query/use/scan the scanner, then if I close xsane and try to re-open it, it tells me that no device can be found. If I unplug then plug the scanner back in, this process restarts.
- I have added the epjitsu.conf
- I have added the .nal that the scanner is looking for

Any ideas?
Title: Re: CUPS USB Printing Issues
Post by: Falco on February 17, 2015, 09:54:13 AM
I will let you know how everything works out.

I did get xsane working only after I installed gimp.

Thank you, for the help.
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 17, 2015, 10:50:10 AM
xsane fixed, it will now work without gimp.
Title: Re: CUPS USB Printing Issues
Post by: Juanito on February 17, 2015, 10:53:25 AM
Ref libpoppler, etc - did you try updating cups-filters, libsane and sane-backends with the apps gui?

Those issues should be solved now.

Of course, you'll need to remove the symlinks.
Title: Re: CUPS USB Printing Issues
Post by: Falco on February 17, 2015, 12:29:49 PM
cups and xsane now work the way you had mentioned.

I am still running into the issue of the scanner device disappearing after it is used once.