Re: lpd/samba printing with usb

2014-01-21 Thread Steven Drake
On Sun, 19 Jan 2014, pierre-philipp braun wrote:

 I do not get any USB printer option when adding a
 printer through the interface.  Yes, cups was compiled with the spl and libusb
 options by default.  The libusb option doesn't seem to be required anyway
 since we are using ulpt(4)/usblp devices.  According to `pkg_info -D cups`,
 the DeviceURI should be usb:/ (ulpt) instead of usb:// (libusb).

Sorry, the libusb part of the cups install-message is out-of-date.

When cups is built the libusb support it can not use ultp(4)/usblp
devices, because it's trying to 'talk' to the printer over usb.

I'd try disabling the ulpt(4)/usblp driver and trying again.

-- 
Steven


Re: lpd/samba printing with usb

2014-01-18 Thread Rhialto
On Fri 17 Jan 2014 at 20:16:51 +0100, pierre-philipp braun wrote:
My point being, is it truly mandatory
 for the printer to be postscript compatible to be able to do that (lptest 
 /dev/ulp{t,n}0) or LPD/samba with a raw printacap entry?

I don't think so, at least for plain text test printing. Most printers
that require funny drivers can print plain text using their own built-in
font, even if it's ugly.

I need to use Splix for my printer (a Samsung ML-1640) and the usb
connection is a bit funny there too. Sometines I need to unplug and
replug the printer between two print jobs, or it won't print the second
one.

(I had to make a small patch to it - some compression parameter wasn't
passed through from a configuration file and a code patch seemed simpler
than debugging where it got lost. Here it is; maybe it helps you:

I put this file in /usr/pkgsrc/localpatches/wip/splix/patch-za and it
automatically gets used when building via pkgsrc if you also have
LOCALPATCHES = /usr/pkgsrc/localpatches
in /etc/mk.conf.

--- src/document.cpp.dist   2010-02-05 20:59:41.0 +0100
+++ src/document.cpp2010-02-05 21:00:10.0 +0100
@@ -108,7 +108,11 @@
 page-setHeight(pageHeight);
 page-setColorsNr(colors);
 page-setPageNr(_currentPage);
-page-setCompression(header.cupsCompression);
+DEBUGMSG(header.cupsCompression=%d, (int)header.cupsCompression);
+if (header.cupsCompression != 0)
+page-setCompression(header.cupsCompression);
+else
+page-setCompression(17);
 page-setCopiesNr(header.NumCopies);
 
 // Calculate clippings and margins

 Pierre-Philipp
-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- The Doctor: No, 'eureka' is Greek for
\X/ rhialto/at/xs4all.nl-- 'this bath is too hot.'



pgpDNwPHcGxIU.pgp
Description: PGP signature


Re: lpd/samba printing with usb

2014-01-18 Thread pierre-philipp braun

Hi Olaf,


I don't think so, at least for plain text test printing. Most printers
that require funny drivers can print plain text using their own built-in
font, even if it's ugly.


Yes it was some kind of typewriter font with my laserjet.  The samsung 
scx-4200 seems to accept neither direct text nor raw relay for clients' 
drivers (at least not the way I used to configure it in the printcap). 
So this is confusing to me.



I need to use Splix for my printer (a Samsung ML-1640) and the usb
connection is a bit funny there too. Sometines I need to unplug and
replug the printer between two print jobs, or it won't print the second
one.


So I finally installed CUPS and wip/splix.  I am using binary packages 
as much as possible (2013Q4) so I only had to compile splix for myself 
using wip.


poppler-0.24.5  PDF rendering library
poppler-utils-0.24.5 PDF utilities (from poppler)
cups-1.5.4nb8   Common UNIX Printing System
splix-2.0.0nb3  Driver for SPL printers (Samsung and Xerox)

Note. The Splix ppds are supposed to work for the SCX-4200 printer 
according to the listing on their home page.


Beside the needed tweaks to the xml configuration to administer the 
thing remotely (Listen and Location/Allow directives), not mentioning 
the SSL stuff that needed to be configured manually --- by all means, 
LPD was much simpler to use and configure --- I do not get any USB 
printer option when adding a printer through the interface.  Yes, cups 
was compiled with the spl and libusb options by default.  The libusb 
option doesn't seem to be required anyway since we are using 
ulpt(4)/usblp devices.  According to `pkg_info -D cups`, the DeviceURI 
should be usb:/ (ulpt) instead of usb:// (libusb).


So I added the printer from the command line,

lpadmin -p scx1 -v usb:/dev/ulpt0 -P 
/usr/pkg/share/cups/model/samsung/scx4200.ppd
lpadmin -p scx2 -v usb:/dev/ulpn0 -P 
/usr/pkg/share/cups/model/samsung/scx4200.ppd


and Manage Printers in the web interface said,

scx1 (Paused, Rejecting Jobs, Shared)
scx2 (Paused, Rejecting Jobs, Shared)

so I resumed and enabled jobs on it with the web interface and then 
tried to print a test page, which gives,


Unsupported format application/vnd.cups-banner.
Unsupported format application/vnd.cups-banner.

which is odd because those mime types are enabled,

# grep banner /usr/pkg/share/cups/mime/mime.types
application/vnd.cups-banner string(0,'#CUPS-BANNER')

# grep banner /usr/pkg/share/cups/mime/mime.convs
application/vnd.cups-banner application/postscript  33 
bannertops


Let-alone the proprietary driver question for the text-or-raw/samba 
approach, the CUPS setup is really a pain.  The ideal deal would be to 
use LPD with Splix ppds, if such a thing was doable.  For today and as a 
conclusion here, the CUPS tryout with USB is far from being a success.


 (I had to make a small patch to it - some compression parameter wasn't
 passed through from a configuration file and a code patch seemed simpler
 than debugging where it got lost. Here it is; maybe it helps you:

I guess I am not even that far yet:-)  But thanks

pierre-philipp


Re: lpd/samba printing with usb

2014-01-17 Thread Jeremy C. Reed
On Fri, 17 Jan 2014, pierre-philipp braun wrote:

 When I try to print a job from a windows client, with the printer 
 configured and looking good, the printer spins on however nothing 
 happens, the jobs stays in the queue (saying it is still printing), no 
 page comes out and there is no log in /var/log/lpd-errs.  I can also 
 see the waiting jobs with lpq from the lpd and samba server,

Have you been able to print successfully to your Samsung SCX-4200 
printer via ulpt0 directly (without using samba)?

I think it uses a proprietary format. Some open source driver is at 
http://splix.ap2c.org/  but for CUPS. I didn't look at it, but maybe you 
can make that work so you can test locally.

Anyways, I have had ongoing problems trying to print via some ulpt0 
printers. There are a few threads about it.  I do have good success 
using a Brother HL 5150D Postscript printer over ulpt0 using lpd for 
several years now.  You may find that using a printer with a 
non-proprietary format may be easier.


Re: lpd/samba printing with usb

2014-01-17 Thread pierre-philipp braun

Hi Jeremy,

Have you been able to print successfully to your Samsung SCX-4200 
printer via ulpt0 directly (without using samba)?


The same happens whether I use lptest against the device or samba with 
the appropriate drivers: the laser printer starts to make some noise and 
warms up like it's going to print something, and doesn't print anything 
in the end.  I tried both, /dev/ulpt0 and /dev/ulpn0.


Before, I didn't see I was having those in the logs,

ulpt0: offline
ulpt0: output error

I've also seen this error below on another occasion, I cannot reproduce 
it.  It was probably caused by my attempt to reconnect the USB cable 
physically.


uhub0: device problem, disabling port 4

Anyway I've disabled ACPI at boot time and I don't get any of those for 
now anymore, while the main issue remains.


I think it uses a proprietary format. Some open source driver is at 
http://splix.ap2c.org/  but for CUPS. I didn't look at it, but maybe you 
can make that work so you can test locally.


Anyways, I have had ongoing problems trying to print via some ulpt0 
printers. There are a few threads about it.  I do have good success 
using a Brother HL 5150D Postscript printer over ulpt0 using lpd for 
several years now.  You may find that using a printer with a 
non-proprietary format may be easier.


Well I was using good old HP Laserjet 4L before, which I think, aren't 
postscript either, and it was still printing the text I sent to the 
device directly (even though there was some indentation issues, the 
drivers being mandatory to print other documents).  My point being, is 
it truly mandatory for the printer to be postscript compatible to be 
able to do that (lptest  /dev/ulp{t,n}0) or LPD/samba with a raw 
printacap entry?


Thanks

Pierre-Philipp




lpd/samba printing with usb

2014-01-16 Thread pierre-philipp braun

Hi,

I am using lpd instead of cups to provide a shared printer to some 
windows clients, and the result isn't as great with an USB (ulpt0) as 
with parallel (lpa0) printer.  The method I used implies that lpd uses a 
raw printcap entry and that the clients use the windows drivers which 
are delivered by samba, which I published there 
(http://pbraun.nethence.com/unix/print/samba-bsd.html).
Considering there is no need for drivers on the server side (as long all 
the clients are samba ones, which won't be the case ultimately, but 
let's keep things simple), should I use an alternate method with an USB 
printer or can I just proceed as if it was a parallel one by sending the 
output to the device directly?


Versions used,
NetBSD 6.1 (GENERIC) amd64
samba-3.6.15nb1

Here's the dmesg for that printer,

ulpt0 at uhub0 port 2 configuration 1 interface 1
ulpt0: Samsung SCX-4200 Series, rev 2.00/1.00, addr 2, iclass 7/1
ulpt0: using bi-directional mode

Here's the printcap entry I use,
scx4200|lp|Samsung SCX-4200 Series:\
 :sh:lp=/dev/ulpt0:sd=/var/spool/output/scx4200:lf=/var/log/lpd-errs:\
 :ff:

Here's the samba part I use (also see the link below),
...
security = user
guest account = nobody
load printers = yes
printing = bsd
printcap name = /etc/printcap
force printername = yes
...

[printers]
comment = Printers
printable = yes
browseable = yes
public = yes
read only = yes
use client driver = no
path = /var/spool/samba

[print$]
comment = Printer drivers
browseable = yes
public = yes
read only = yes
write list = root
printer admin = root
inherit permissions = yes
path = /var/samba/drivers

When I try to print a job from a windows client, with the printer 
configured and looking good, the printer spins on however nothing 
happens, the jobs stays in the queue (saying it is still printing), no 
page comes out and there is no log in /var/log/lpd-errs.  I can also see 
the waiting jobs with lpq from the lpd and samba server,


# lpq
scx4200 is ready and printing
Rank   Owner  Job  Files Total Size
active root   2smbprn.03018a 1567 bytes
1stelge   3smbprn.00515a 1583 bytes

Should I dig into LPD or into Samba? What do you think is wrong and 
preventing the job to be acknowledged by the printer?


Thank you

Pierre-Philipp