michaelrsweet / lprint

A Label Printer Application
https://www.msweet.org/lprint
Apache License 2.0
227 stars 31 forks source link

Support for Brother label printers #15

Open cdplayer opened 4 years ago

cdplayer commented 4 years ago

I'd like support for PT-P700 and QL700 models. Is there ability to help financially for these units. https://atyourside.brother.co.uk/developer-centre/labelling-solutions

michaelrsweet commented 4 years ago

I don't have anything set up for this at the moment, but I'll see what options there are.

(But honestly I'm not looking to turn LPrint into a commercial product - this is just a side project for me...)

cdplayer commented 4 years ago

Just looking to help out our local hackerspace. The Brother models are considerably more popular in Australia but lack good support for linux. Thanks for your work on cups, and starting lprint.

andreas-gruenbacher commented 4 years ago

There's actually pretty decent documentation for those printers in the form of the Raster Command Reference manuals at https://www.brother.co.jp/eng/dev/command/reference/.

The upstream location for the current foomatic based driver is at https://github.com/philpem/printer-driver-ptouch, and I've recently started updating that driver when in need for decent support for PT-P700 printers: https://github.com/trialinfo/ptouch-driver. I wasn't aware of LPrint when I started working on this, so that's unfortunate timing.

michaelrsweet commented 4 years ago

@andreas-gruenbacher Thanks for the reference documentation, that'll be exactly what I'd need to develop a driver. A lot of the newer Brother label printers actually support IPP and AirPrint - those will work out-of-the-box with CUPS, sans drivers... :)

andreas-gruenbacher commented 4 years ago

My PT-P900W seems to implement that, but it's currently worthless to me because I can't integrate the printer into my wireless network: that requires either Wi-Fi Protected Setup or using a Windows utility, and I can use neither.

Also, for the application I need the PT-P700 support for, the most I can expect of users is to know how to plug both the USB and the power cable in and to find the ON button. So if I were to use PT-P900Ws for that application instead, they would surely also be plugged in over USB.

Another aspect is network security: Enabling IPP support in the printer means putting trust in Brother's IPP implementation. And believe it or not, there are actually people who would rather use something like LPrint for that reason alone ;)

andreas-gruenbacher commented 4 years ago

@michaelrsweet If you end up implementing this yourself, have a look at the ptexplain utility for debugging printer command streams in my ptouch-driver repository. It's as much a work in progress as these things always are, but it was extremely helpful to me already.

michaelrsweet commented 4 years ago

@andreas-gruenbacher The AirPrint certification process puts the IPP stack through some fairly rigorous testing, so I personally wouldn't worry about the quality of the IPP implementation. And we can even do IPP over USB these days...

andreas-gruenbacher commented 4 years ago

Just as a data point, PT-P900W advertise with bInterfaceProtocol 2, so no IPP over USB.

michaelrsweet commented 4 years ago

@cdplayer @andreas-gruenbacher FWIW, I'm now setup with the Github sponsors program. Will convert this bug into an enhancement request to support Brother label printers...

cdplayer commented 4 years ago

Sponsoring sorted! Thanks Michael.

andreas-gruenbacher commented 4 years ago

I've added support for PT-P900W and QL-820NWB (monochrome only) to ptouch-driver in the meantime, so we have reasonably well-working code and some implementation experience.

The QL-820NWB is supposed to support IPP natively as well. The printer does show up, but I couldn't get it to print anything so far.

philpem commented 4 years ago

It'd be nice to see support for the PT/QL series in Lprint; issues with CUPS setup have historically been the largest source of support requests. Not least of all because of the history and quirks of the P-Touch CUPS driver (which I currently maintain).

We have a fairly large amount of accrued information about the Brother printers in that repo, mostly the differences are slight ones in command support and more major ones in things like print-head width. The QL series paper-label printers are in general very consistent, the PT (plastic tape) are far less so.

I developed a library to talk to the PT series printers some years ago, including tools to decode the printer control language back into images and textual descriptions: https://github.com/philpem/libptouch

Testing wise I have a PT-2450DX, a QL-500 and QL-570.

@michaelrsweet The Dymo driver looks simple to use as a base for a new driver. Are there any gotchas I need to be aware of when adding new drivers?

michaelrsweet commented 4 years ago

@philpem Not a lot of gotchas, the main thing is that I'm planning on updating LPrint to use PAPPL which has a slightly different driver model (very similar to what is in LPrint, just updated to support more kinds of printers and be more general purpose) so at some point in the next 6 months you can expect some code churn...

cdplayer commented 4 years ago

@andreas-gruenbacher, are your changes likely to give support for the PT-P700 that I have. I can do testing for you or give you ssh/nomachine access to a pi/arm_sbc connected to it if that is helpful. Also have QL-500 & QL-700.

andreas-gruenbacher commented 4 years ago

The old cups + foomatic based ptouch-driver does support PT-P700 and QL-500 printers. For QL-700, we'd need a printer description file. Note that this discussion doesn't really belong here, so if you have further questions, maybe we can move them to printer-driver-ptouch or ptouch-driver.

smurfix commented 3 years ago

The CUPS driver model is somewhat unsuited to those label printers. One example: you can ask the printer which label size is currently loaded but there's no way for the driver to print only those documents which can actually be printed. Wrong size? cryptic error, please reset CUPS and/or the printer.

So yes I'd love to have decent support for ptouch in lprint. Would pay $$$. Would also write myself but way not enough free time for that.

peanutlasko commented 1 year ago

Sponsored @michaelrsweet ! Hopefully you can add support for PT-P700 :)

michaelrsweet commented 10 months ago

OK, so this will actually be like two different series of printers. I have a QL-600 and a PT-P700 coming to test things...

smurfix commented 10 months ago

Great something's happening, finally. I have two QL-series printers (500 and 550 I think – they're in the basement and I'm lazy) I can help test with.

philpem commented 10 months ago

I'll have a look at adding support for a few of the other printers supported by the existing P-touch driver. Once the basics are in, adding new printers mostly just involves setting the appropriate feature flags and the print-head width.

I have a PT-2450DX, a QL-500 and a QL-570 to test with.

michaelrsweet commented 10 months ago

@smurfix @philpem Thanks both of you; I'll be pushing more to the repository as soon as I get my printers. The language support itself doesn't look too challenging (the minor difference in the raster graphics commands between the QL and PT printers is frustrating but easy enough to work around), but properly detecting the printers and handling the status responses will require a bit of play, otherwise I'd push what I have already...

michaelrsweet commented 8 months ago

Current master is not working; in the interests of getting a new release out, I'm going to pull the Brother drivers for now and I'll keep working on it for 1.4.x.

abishekCodebase commented 7 months ago

Could anyone provide brother HL-B2000D driver for arm64 raspberry pi

michaelrsweet commented 7 months ago

@abishekCodebase Sorry, this project only supports label or receipt printers, not regular laser printers.

Looking at the technical specifications, that printer supports PCL6, so any of the PCL6 drivers/printer applications should mostly work with it.

realcanadrian commented 6 months ago

Could I just send a friendly query on the status of P-Touch printers with LPrint? I noted the main application page says "Brother: Experimental support for QL- and PT-series printers", but I can't seem to find a driver in the list that would obviously support my PT-P750W. Greatly looking forward to trying out this awesome app. :)

michaelrsweet commented 6 months ago

@realcanadrian I haven't gotten to finishing the PT-series driver quite yet; was focused on getting the QL-series printers working well first...

TafkaMax commented 6 months ago

I am looking into aquiring an labelmaker that would also work with linux. Does the PT-P550W also fall into this category of ptouch labelmakers that are supported? As I understand it needs to support IPP to be integrated into the lprint?

michaelrsweet commented 5 months ago

@TafkaMax Do you mean the PT-E550W? I don't currently have a driver in development for that model.

WRT what it supports, LPrint is for the non-IPP Brother printers - it provides an IPP "gateway" to older model printers.

TafkaMax commented 5 months ago

@TafkaMax Do you mean the PT-E550W? I don't currently have a driver in development for that model.

WRT what it supports, LPrint is for the non-IPP Brother printers - it provides an IPP "gateway" to older model printers.

OK thanks for the info.

andreas-gruenbacher commented 5 months ago

I've managed to get lprint to recognize my QL-802NWB label printer, but commands like ./lprint testsuite/sample-label.pwg only get the printer confused. That's not very surprising given that the driver isn't working yet, but how do I debug what's going wrong now?

I assume that lprint_brother_get_status() does get called, but I don't see the output of the LPRINT_DEBUG() statements even after adding -DDEBUG to CPPFLAGS and rebuilding lprint. Does that kind of output go anywhere?

Is there a way to capture what lprint is sending to the printer? For debugging, I'd like to be able to tell lprint to send its output to a file instead of sending it to the printer so that I can check what it's trying to do.

Are there any other debugging instructions? Thanks a lot!

michaelrsweet commented 5 months ago

@andreas-gruenbacher LPRINT_DEBUG statements are logged to stderr.

You can configure a printer with file:///path/to/file as the device URI to send the output to a file and then inspect it.

Pastitas commented 1 month ago

Has the brother support gotten any further? I cannot seem to find any changes lately. Thanks for your work!

michaelrsweet commented 1 month ago

No, I haven't had time to do any more work on the Brother drivers.