I'm trying to get a USB-connected Brother HL-2240 printer to work on Linux (Ubuntu Xenial with cups 2.1.3-4ubuntu0.3).
I turned debugging up to maximum and the cups error log very verbosely tells me everything succeeded. The page log simply lists the job as succeeded.
I generated the PCL file manually, ran /usr/lib/cups/backend/usb
under strace, and it said it succeeded, with no apparent errors in the ioctls (lots of USBDEVFS_REAPURBNDELAY
=> EAGAIN
, but that seems to be some sort of spinlock).
But nothing prints.
The printer physically works fine. I can print a test page by holding down the "go" button on the printer.
I've tried this with and without usblp. I don't have android-udev (one source thought that might be relevant). I tried re-installing cups.
It worked ages ago. I think I might have been on Precise Pangolin at the time. Yes, that's a long time to go without printing, and there may have been other relevant things in that time too.
I don't know for sure that the PCL documents I'm generating are correct. Is there a way to test those? Or a source of known-good documents for this printer?
But mostly, does anyone have any ideas how to fix this?
(I was going to post both the error_log and strace output here, but they're way too long. I've looked them over pretty thoroughly, but if there are strange things to look for, please suggest them.)
Edit to add:
I'm pretty sure it's finding the right printer because of lines in the log like:
D [28/Nov/2017:00:06:11 -0500] [Job 19] envp[23]="DEVICE_URI=usb://Brother/HL-2240%20series?serial=B3N746940"
That's the same serial number as in dmesg
.
Also, when I invoke /usb directly:
export DEVICE_URI=usb://Brother/HL-2240%20series?serial=B3N746940
/usr/lib/cups/backend/usb 25 dspeyer hello 1 "" < /etc/hosts
I get
DEBUG: Loading USB quirks from "/usr/share/cups/usb".
DEBUG: Loaded 131 quirks.
DEBUG: Printing on printer with URI: usb://Brother/HL-2240%20series?serial=B3N746940
DEBUG: libusb_get_device_list=13
STATE: +connecting-to-device
STATE: -connecting-to-device
DEBUG2: Printer found with device ID: MFG:Brother;CMD:PJL,HBP;MDL:HL-2240 series;CLS:PRINTER;CID:Brother Laser Type1; Device URI: usb://Brother/HL-2240%20series?serial=B3N746940
DEBUG: Device protocol: 2
INFO: Sending data to printer.
DEBUG: Read 195 bytes of print data...
DEBUG: Wrote 195 bytes of print data...
DEBUG: Sent 195 bytes...
DEBUG: Waiting for read thread to exit...
(And similar things if I use a PCL file instead of a text file, but longer.)
If I use any other DEVICE_URI, I get error messages.
And a strace on the usb command contains:
ioctl(10, USBDEVFS_GET_CAPABILITIES, 0xe4c198) = 0
write(2, "STATE: +connecting-to-device\n", 29STATE: +connecting-to-device
) = 29
ioctl(10, USBDEVFS_GETDRIVER, 0xbf941308) = -1 ENODATA (No data available)
timerfd_settime(9, TFD_TIMER_ABSTIME, {it_interval={0, 0}, it_value={3607344, 967184000}}, NULL) = 0
ioctl(10, USBDEVFS_SUBMITURB, 0xe65ea0) = 0
Which indicates pretty clearly data is going over USB.
lpr /etc/hosts
or something simple?texttopdf
and then the usual chain, so this isn't very interesting.