Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

SOLVED -- Brother PTouch QL-700 label printer 3.1.5-0

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
13 posts • Page 1 of 1
Author
Message
redwood
Guru
Guru
Posts: 306
Joined: Fri Jan 27, 2006 6:28 am

SOLVED -- Brother PTouch QL-700 label printer 3.1.5-0

  • Quote

Post by redwood » Thu Feb 27, 2020 10:47 pm

Just wondering if Gentoo users have the Brother PTouch QL-700 label printer working with cups?

I had it working with Brother's driver version 1.0.2-0 then one day it quit working. Not sure why.
Anyhow, too much has now changed on the system to backtrace when it quit working.
I think it was probably due to a change to udev/libudev

In any event, the usb printer wasn't showing up in

Code: Select all

lpinfo -lv
so I figured out that I now needed a usb rule for my printer /etc/udev/rules.d/

Code: Select all

cat /etc/udev/rules.d/42-brother-ql700.rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="2042", ATTRS{serial}=="000J5Z413036", MODE="0664", GROUP="lp",  SYMLINK+="usb/lp0"
After which the printer then showed up in "lpinfo -lv"

Code: Select all

Device: uri = usb://Brother/QL-700?serial=000J5Z413036
        class = direct
        info = Brother QL-700
        make-and-model = Brother QL-700
        device-id = MFG:Brother;CMD:PT-CBP;MDL:QL-700;CLS:PRINTER;
        location =
There are a couple of web pages dealing with linux drivers for the PTouch label printers:

Code: Select all


Blog for various PTouch printers:
https://blog.philippklaus.de/2015/09/brother-p-touch-ql-500-bw/

Ubuntu for the QL-700
https://forum.ubuntuusers.de/topic/installation-brother-ql-700/#post-6642132

Arch Linux for the QL-710w
https://aur.archlinux.org/packages/brother-ql710w/

Gentoo Documentation Tips & Tricks for the QL-570:
https://aur.archlinux.org/packages/brother-ql710w/

Also, there was some work on opensource drivers
http://etc.nkadesign.com/Printers/QL550LabelPrinterCUPS
In particular, Arne John Glenstrup but his webpage (http://www.diku.dk/~panic/P-touch/) is now gone.

The Brother drivers for the PTouch QL-700 are packaged as rpm files.
The current version on Brother's website is 3.1.5-0

There are quite a few differences between 1.0.2-0 and 3.1.5-0

Code: Select all

apps /opt/brother/PTouch # diff -r ql700-1.0.2-0 ql700-3.1.5-0 
Only in ql700-1.0.2-0/cupswrapper: brcupsconfpt1
Only in ql700-3.1.5-0/cupswrapper: brother_lpdwrapper_ql700
Only in ql700-3.1.5-0/cupswrapper: brother_ql700_printer_en.ppd
Only in ql700-3.1.5-0/cupswrapper: cupswrapperql700
Only in ql700-3.1.5-0/cupswrapper: cupswrapperql700.bak
Only in ql700-1.0.2-0/cupswrapper: cupswrapperql700pt1
Only in ql700-1.0.2-0/inf: brPrintListpt1
Only in ql700-1.0.2-0/inf: brql700init
diff -r ql700-1.0.2-0/inf/brql700rc ql700-3.1.5-0/inf/brql700rc
7,8c7,8
< Trimtape=OFF
< #Compress=OFF
---
> Trimtape=ON
> Compress=OFF
diff -r ql700-1.0.2-0/inf/ImagingArea ql700-3.1.5-0/inf/ImagingArea
1,38c1,40
< 17x54			:	4.32	8.4		43.92	144.24
< 17x87			:	4.32	8.4		43.92	237.84
< 23x23			:	4.32	8.4		60.96	56.88
< 29x42			:	4.32	8.4		77.76	110.64
< 29x90			:	4.32	8.4		77.76	246.24
< 38x90			:	4.32	8.4		103.44	246.24
< 39x48			:	4.32	8.4		106.32	127.20
< 52x29			:	4.32	8.4		143.04	73.44
< 60x86			:	4.32	8.4		165.6	234.96
< 62x29			:	4.32	8.4		171.36	73.44
< 62x100			:	4.32	8.4		171.36	274.56
< 12Dia			:	5.76	5.76	28.32	28.32
< 24Dia			:	5.76	5.76	62.4	62.4
< 58Dia			:	8.4		8.4		156.72	156.72
< 12X1			:	4.32	8.4		29.76	275.06
< 29X1			:	4.32	8.4		77.76	275.06
< 38X1			:	4.32	8.4		103.44	275.04
< 50X1			:	4.32	8.4		137.28	274.8
< 54X1			:	5.76	8.4		147.36	275.04
< 62X1			:	4.32	8.4		171.36	274.06
< 12X2			:	4.32	8.4		55.20	275.06
< 29X2			:	4.32	8.4		151.20	275.06
< 38X2			:	4.32	8.4		202.56	275.04
< 50X2			:	4.32	8.4		270.24	274.8
< 54X2			:	5.76	8.4		288.96	275.04
< 62X2			:	4.32	8.4		338.40	275.06
< 12X3			:	4.32	8.4		80.64	275.06
< 29X3			:	4.32	8.4		224.64	275.06
< 38X3			:	4.32	8.4		301.68	275.04
< 50X3			:	4.32	8.4		403.2	274.8
< 54X3			:	5.76	8.4		430.56	275.04
< 62X3			:	4.32	8.4		505.44	275.06
< 12X4			:	4.32	8.4		106.80	275.06
< 29X4			:	4.32	8.4		298.08	275.06
< 38X4			:	4.32	8.4		400.80	275.04
< 50X4			:	4.32	8.4		536.16	274.8
< 54X4			:	5.76	8.4		572.16	275.04
< 62X4			:	4.32	8.4		672.48	275.06
---
> 17x54:	4.32	8.4		43.92	144.24
> 17x87:	4.32	8.4		43.92	237.84
> 23x23:	4.32	8.4		60.96	56.88
> 29x42:	4.32	8.4		77.76	110.64
> 29x90:	4.32	8.4		77.76	246.24
> 38x90:	4.32	8.4		103.44	246.24
> 39x48:	4.32	8.4		106.32	127.20
> 52x29:	4.32	8.4		143.04	73.44
> 54x29:	4.32	8.4  	147.36	73.44
> 60x86:	4.32	8.4		165.6	234.96
> 62x29:	4.32	8.4		171.36	73.44
> 62x100:	4.32	8.4		171.36	274.56
> 12Dia:	5.76	5.76	28.32	28.32
> 24Dia:	5.76	5.76	62.4	62.4
> 58Dia:	8.4		8.4		156.72	156.72
> 12X1:	4.32	8.4		29.76	275.06
> 29X1:	4.32	8.4		77.76	275.06
> 38X1:	4.32	8.4		103.44	275.04
> 50X1:	4.32	8.4		137.28	274.8
> 54X1:	5.76	8.4		147.36	275.04
> 62X1:	4.32	8.4		171.36	274.06
> 12X2:	4.32	8.4		55.20	275.06
> 29X2:	4.32	8.4		151.20	275.06
> 38X2:	4.32	8.4		202.56	275.04
> 50X2:	4.32	8.4		270.24	274.8
> 54X2:	5.76	8.4		288.96	275.04
> 62X2:	4.32	8.4		338.40	275.06
> 12X3:	4.32	8.4		80.64	275.06
> 29X3:	4.32	8.4		224.64	275.06
> 38X3:	4.32	8.4		301.68	275.04
> 50X3:	4.32	8.4		403.2	274.8
> 54X3:	5.76	8.4		430.56	275.04
> 62X3:	4.32	8.4		505.44	275.06
> 12X4:	4.32	8.4		106.80	275.06
> 29X4:	4.32	8.4		298.08	275.06
> 38X4:	4.32	8.4		400.80	275.04
> 50X4:	4.32	8.4		536.16	274.8
> 54X4:	5.76	8.4		572.16	275.04
> 62X4:	4.32	8.4		672.48	275.06
> 
Only in ql700-3.1.5-0/inf: paperinfql700
Only in ql700-1.0.2-0/inf: paperinfql700pt1
diff -r ql700-1.0.2-0/inf/setupPrintcappt1 ql700-3.1.5-0/inf/setupPrintcappt1
4c4
< # Copyright (C) 2003-2015 Brother. Industries, Ltd.
---
> # Copyright (C) 2003-2016 Brother. Industries, Ltd.
37c37
< 	chmod 700 $SPOOLER_NAME
---
> 	chmod u+rwx,g+rwX,o+rx-w $SPOOLER_NAME
49c49
<         :if=/opt/brother/PTouch/${BRPRINTER_NAME}/lpd/filter$BRPRINTER_NAME:
---
>         :if=/opt/brother/PTouch/${BRPRINTER_NAME}/lpd/filter_$BRPRINTER_NAME:
54c54
< 	cat ${PRINTCAP_NAME}.tmp | eval sed "/${BRPRINTER_NAME}:/,/filter$BRPRINTER_NAME:/d" > ${PRINTCAP_NAME}
---
> 	cat ${PRINTCAP_NAME}.tmp | eval sed "/${BRPRINTER_NAME}:/,/filter_$BRPRINTER_NAME:/d" > ${PRINTCAP_NAME}
Only in ql700-3.1.5-0: LICENSE_ENG.txt
Only in ql700-3.1.5-0: LICENSE_JPN.txt
Binary files ql700-1.0.2-0/lpd/brpapertoolcups and ql700-3.1.5-0/lpd/brpapertoolcups differ
Only in ql700-3.1.5-0/lpd: brpapertoollpr_ql700
Only in ql700-3.1.5-0/lpd: brprintconfpt1_ql700
Only in ql700-3.1.5-0/lpd: filter_ql700
Only in ql700-1.0.2-0/lpd: filterql700
Only in ql700-3.1.5-0/lpd: i686
Only in ql700-1.0.2-0/lpd: psconvertpt1
Binary files ql700-1.0.2-0/lpd/rastertobrpt1 and ql700-3.1.5-0/lpd/rastertobrpt1 differ
Only in ql700-3.1.5-0/lpd: x86_64
I'm currently trying to get the latest 3.1.5-0 version working.
There's a perl file /usr/lib64/cups/filter/brother_lpdwrapper_ql700 -> /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700

in which I've enabled debugging:

Code: Select all

$LOGFILE="/tmp/br_cupswrapper_ink.log";
$LOGLEVEL=7;
$DEBUG=1;
$LOG_LATESTONLY=1;
$DEVICEURILOCK=1;
$LPD_DEBUG=0;

if ( $DEBUG > 0 ){
  $LPD_DEBUG=2;
}

$width=-1;
$height=-1;

#my $basedir = Cwd::realpath ($0);
my $basedir = `readlink $0`;
if ( $basedir eq '' ){
    $basedir = `realpath $0`;
}
chomp($basedir);

$basedir =~ s/$PRINTER\/cupswrapper\/.*$/$PRINTER\//g;

[.....]
my $cmdoptions=$ARGV[4];
my $PPD = $ENV{PPD};
my $PRINTER=$basedir;
my $CUPSINPUT='';
if ( @ARGV >= 6 ){
    $CUPSINPUT=$ARGV[7];
}


$PRINTER =~ s/^\/opt\/.*\/PTouch\///g;
$PRINTER =~ s/\/cupswrapper//g;
$PRINTER =~ s/\///g;

for  (my $i = 0 ; $i < @ARGV ; $i ++){
    logprint( 0 , "ARG$i      = $ARGV[$i]\n");
}

logprint( 0 , "PRINTER   = $PRINTER \n");
after which, when trying to print, the log file shows:

Code: Select all

# cat /tmp/br_cupswrapper_ink.log 

START
ARG0      = root
ARG1      = label.pdf
ARG2      = 1
ARG3      = finishings=3 number-up=1 job-uuid=urn:uuid:95f690e3-2090-3c22-7adc-e7a9c358d076 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1582816396 time-at-processing=1582816396 document-name-supplied=label.pdf
ARG4      = 
ARG5      = 
PRINTER   = usrlib64cupsfilterbrother_lpdwrapper_ql700 
PPD       = /etc/cups/ppd/QL700.ppd
BASEPATH  = /usr/lib64/cups/filter/brother_lpdwrapper_ql700
export PPD=/etc/cups/ppd/QL700.ppd
/usr/libexec/cups/filter/brother_lpdwrapper_ql700 "label.pdf"  "1"  "finishings=3 number-up=1 job-uuid=urn:uuid:95f690e3-2090-3c22-7adc-e7a9c358d076 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1582816396 time-at-processing=1582816396 document-name-supplied=label.pdf"  ""  ""  ""

TEMPRC    = /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799
label1    = 
value1    = 

SET PPD OPTIONS
)cont  <=  0  : (0
)cont  <=  *  : (0
)cutlabel  <=  1  : (1
)cutlabel  <=  *  : (1
)brit  <=  0  : (0
)brit  <=  *  : (0
)feed  <=  3  : (3
)feed  <=  *  : (3

SET VENDOR COMMAND OPTIONS

SET PPD CMD OPTIONS
brprintconfpt1_usrlib64cupsfilterbrother_lpdwrapper_ql700 -P usrlib64cupsfilterbrother_lpdwrapper_ql700 -media 29x90 -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799
 -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799b64cupsfilterbrother_lpdwrapper_ql700 -brit 0
brprintconfpt1_usrlib64cupsfilterbrother_lpdwrapper_ql700 -P usrlib64cupsfilterbrother_lpdwrapper_ql700 -cutend ON -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799
brprintconfpt1_usrlib64cupsfilterbrother_lpdwrapper_ql700 -P usrlib64cupsfilterbrother_lpdwrapper_ql700 -mirro OFF -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799
 -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799b64cupsfilterbrother_lpdwrapper_ql700 -cutlabel 1
 -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799b64cupsfilterbrother_lpdwrapper_ql700 -cont 0
 -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799b64cupsfilterbrother_lpdwrapper_ql700 -feed 3
brprintconfpt1_usrlib64cupsfilterbrother_lpdwrapper_ql700 -P usrlib64cupsfilterbrother_lpdwrapper_ql700 -trimtape ON -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799
brprintconfpt1_usrlib64cupsfilterbrother_lpdwrapper_ql700 -P usrlib64cupsfilterbrother_lpdwrapper_ql700 -quality SPEED -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799
brprintconfpt1_usrlib64cupsfilterbrother_lpdwrapper_ql700 -P usrlib64cupsfilterbrother_lpdwrapper_ql700 -half BrErrorDiffusion -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799
brprintconfpt1_usrlib64cupsfilterbrother_lpdwrapper_ql700 -P usrlib64cupsfilterbrother_lpdwrapper_ql700 -compress OFF -rcfile /tmp/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc_28799

export BRPAPERWIDTH=-1
export BRPAPERHEIGHT=-1
export PPD=/etc/cups/ppd/QL700.ppd
export BRPRINTERRCFILE=/tmp/usrlib64cupsfilterbrother_lpdwrapper_ql700_latest_print_info
export LPD_DEBUG=2
export PS=1
cat /tmp/br_cupswrapper_ink_input.ps | /usr/lib64/cups/filter/brother_lpdwrapper_ql700/lpd/filter_usrlib64cupsfilterbrother_lpdwrapper_ql700 > /tmp/br_cupswrapper_ink_output.prn 
cat  > /tmp/br_cupswrapper_ink_input.ps && cat /tmp/br_cupswrapper_ink_input.ps |/usr/lib64/cups/filter/brother_lpdwrapper_ql700/lpd/filter_usrlib64cupsfilterbrother_lpdwrapper_ql700 > /tmp/br_cupswrapper_ink_output.prn
Anyhow, looks like the perl script is parsing things incorrectly, or the symlinks for the installation are maybe botching things up:

Code: Select all

# cat /tmp/br_cupswrapper_ink_lpderr 
sh: /usr/lib64/cups/filter/brother_lpdwrapper_ql700/lpd/filter_usrlib64cupsfilterbrother_lpdwrapper_ql700: Not a directory

Code: Select all

!705
/usr/libexec/cups/filter/brother_lpdwrapper_ql700 "root"  "label.pdf"  "1"  "finishings=3 number-up=1 job-uuid=urn:uuid:95f690e3-2090-3c22-7adc-e7a9c358d076 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1582816396 time-at-processing=1582816396 document-name-supplied=label.pdf"  ""  ""
cp: cannot stat '/usr/lib64/cups/filter/brother_lpdwrapper_ql700/inf/brusrlib64cupsfilterbrother_lpdwrapper_ql700rc': Not a directory
I may try a little more debugging for Brother's 3.1.5-0 drivers
but then try 1.0.2-0 again as it once worked. Might work again now that I've got a PTouch rule in /etc/udev/rule.d/

Anyhow, would be grateful for any help getting either version 1.0.2-0 or 3.1.5-0 working.
Last edited by redwood on Sat Feb 29, 2020 5:08 am, edited 3 times in total.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

Re: Brother PTouch QL-700 label printer

  • Quote

Post by charles17 » Fri Feb 28, 2020 8:22 am

redwood wrote:Just wondering if Gentoo users have the Brother PTouch QL-700 label printer working with cups?
This one?
redwood wrote:I may try a little more debugging for Brother's 3.0.5-0 drivers
but then try 1.0.2-0 again as it once worked. Might work again now that I've got a PTouch rule in /etc/udev/rule.d/

Anyhow, would be grateful for any help getting either version 1.0.2-0 or 3.0.5-0 working.
Have you cross checked your procedure with the Alternative: rpm installation wiki article section?

Upstream instuction says:
https://support.brother.com/g/b/downloadhowto.aspx?c=de&lang=de&prod=lpql700euk&os=131&dlid=dlfp002191_000&flang=178&type3=10310 wrote: How to Install
Download the driver.



Login as a superuser.



Install driver.
Turn on the printer and connect the USB cable.
***Click the close button if the installation wizard comes up***
Open the terminal and go to the directory where the driver is.
Install driver.
Command : rpm -ihv --nodeps (drivername)
Check if the driver is Installed.
Command : rpm -qa | grep Brother
So if I did ...

Code: Select all

su -c "rpm -ihv --nodeps ql700pdrv-3.1.5-0.i386.rpm"
Password: 
Preparing...                          ################################# [100%]
Updating / installing...
   1:ql700pdrv-3.1.5-0                ################################# [100%]
lpadmin -p QL700 -E -v usb://dev/usb/lp0 -P /usr/share/cups/model/Brother/brother_ql700_printer_en.ppd

Code: Select all

rpm -qa 
ql700pdrv-3.1.5-0.i38
Top
redwood
Guru
Guru
Posts: 306
Joined: Fri Jan 27, 2006 6:28 am

  • Quote

Post by redwood » Fri Feb 28, 2020 3:26 pm

OK,

Decided to try re-installing via rpm:

Code: Select all

~/Brother/3.1.5-0 # cat RPM_replacepkgs.txt 
rpm -ivh --nodeps --force --replacepkgs ql700pdrv-3.1.5-0.i386.rpm 

~/Brother/3.1.5-0 # rpm -ivh --nodeps --force --replacepkgs ql700pdrv-3.1.5-0.i386.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:ql700pdrv-3.1.5-0                ################################# [100%]
ln: failed to create symbolic link '/opt/brother/PTouch/ql700/lpd/rastertobrpt1': File exists
ln: failed to create symbolic link '/opt/brother/PTouch/ql700/lpd/brpapertoolcups': File exists
ln: failed to create symbolic link '/opt/brother/PTouch/ql700/lpd/brpapertoollpr_ql700': File exists
ln: failed to create symbolic link '/opt/brother/PTouch/ql700/lpd/brprintconfpt1_ql700': File exists
ln: failed to create symbolic link '/usr/lib/cups/filter/brother_lpdwrapper_ql700': File exists
ln: failed to create symbolic link '/usr/lib64/cups/filter/brother_lpdwrapper_ql700': File exists
lpadmin -p QL700 -E -v usb://dev/usb/lp0 -P /usr/share/cups/model/Brother/brother_ql700_printer_en.ppd

~/Brother/3.1.5-0 # rm /opt/brother/PTouch/ql700/lpd/{rastertobrpt1,brpapertoolcups,brpapertoollpr_ql700,brprintconfpts_ql70} /usr/lib/cups/filter/brother_llpqwrapper_ql700 /usr/lib64/cups/filter/brother_lpdwrapper_ql700

~/Brother/3.1.5-0 # rpm -ivh --nodeps --force --replacepkgs ql700pdrv-3.1.5-0.i386.rpm Preparing...                          ################################# [100%]
Updating / installing...
   1:ql700pdrv-3.1.5-0                ################################# [100%]
ln: failed to create symbolic link '/usr/lib64/cups/filter/brother_lpdwrapper_ql700': File exists
lpadmin -p QL700 -E -v usb://dev/usb/lp0 -P /usr/share/cups/model/Brother/brother_ql700_printer_en.ppd
Next, following Gentoo forum post about Brother QL-570 https://forums.gentoo.org/viewtopic-t-9 ... touch.html
I modified /opt/brother/PTouch/ql700/cupswrapper/cupswrapperql700
by changing all instances of "/etc/init.d/cups restart" to "/etc/init.d/cupsd restart"

Code: Select all

cd /opt/brother/PTouch/ql700/cupswrapper;
mv cupswrapperql700 cupswrapper1l700.bak
/bin/sed 's/\/etc\/init.d\/cups\ restart/\/etc\/init.d\/cupsd\ restart/g' ./cupswrapperql700.bak > cupswrapperql700
Then when I login to localhost:631/admin and click on discover new printers, it shows my QL-700 PTouch printer

Code: Select all

usb://Brother/QL-700?serial=000J5Z413036
So decided to try that with lpadmin:

Code: Select all

lpadmin -x QL700
lpadmin -p QL700 -E -v  usb://Brother/QL-700?serial=000J5Z413036  -P /usr/share/cups/model/Brother/brother_ql700_printer_en.ppd
Then after trying to print a file, /var/log/cups/error_log shows:

Code: Select all

# grep ql700 /var/log/cups/error_log 
E [27/Feb/2020:10:11:32 -0500] QL700: File \"/usr/libexec/cups/filter/brother_lpdwrapper_ql700\" is a directory.
E [27/Feb/2020:10:11:32 -0500] [Job 12343] Unable to start filter "brother_lpdwrapper_ql700" - Success.
But no cups error logs in /tmp
and nothing printed.

"/usr/libexec/cups/filter/brother_lpdwrapper_ql700" is not a directory, but rather a symlink to another symlink to the actual file:

Code: Select all

 # ls -l /usr/libexec/cups/filter/brother_lpdwrapper_ql700 
lrwxrwxrwx 1 root root 47 May 23  2016 /usr/libexec/cups/filter/brother_lpdwrapper_ql700 -> /usr/lib64/cups/filter/brother_lpdwrapper_ql700

# ls -l /usr/lib64/cups/filter/brother_lpdwrapper_ql700
lrwxrwxrwx 1 root root 62 Feb 28 09:39 /usr/lib64/cups/filter/brother_lpdwrapper_ql700 -> /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700

# ls -l /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700
-rwxr-xr-x 1 root root 23639 Apr  9  2019 /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700
So more debugging ...
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Fri Feb 28, 2020 4:41 pm

redwood wrote:Then after trying to print a file, /var/log/cups/error_log shows:

Code: Select all

# grep ql700 /var/log/cups/error_log 
E [27/Feb/2020:10:11:32 -0500] QL700: File "/usr/libexec/cups/filter/brother_lpdwrapper_ql700" is a directory.
E [27/Feb/2020:10:11:32 -0500] [Job 12343] Unable to start filter "brother_lpdwrapper_ql700" - Success.
See https://wiki.gentoo.org/wiki/Brother_ne ... ight_place. Copy the file, not the directory.
Top
redwood
Guru
Guru
Posts: 306
Joined: Fri Jan 27, 2006 6:28 am

  • Quote

Post by redwood » Fri Feb 28, 2020 5:35 pm

Thanks for all the help. Think I'm getting closer.

Originally after installing via rpm,
/usr/libexec/cups/filter/brother_lpdwrapper_ql700 was a symlink to /usr/lib64/cups/filter/brother_lpdwrapper_ql700
which in turn was a symlink to /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700

So, I eliminated the middle man and made
/usr/libexec/cups/filter/brother_lpdwrapper_ql700 a direct symlink to /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700

Then I turned on DEBUG and LPD_DEBUG in /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700

Code: Select all

#   log functions

$LOGFILE="/tmp/br_cupswrapper_ink.log";
$LOGLEVEL=7;
$DEBUG=1;
$LOG_LATESTONLY=1;
$DEVICEURILOCK=1;
$LPD_DEBUG=1;

if ( $DEBUG > 0 ){
  $LPD_DEBUG=2;
}
Still isn't printing yet, but logfiles in /tmp look more reasonable like the perl script is parsing basedir and printer name correctly:

Code: Select all

# ls /tmp/br_* /tmp/ql*
/tmp/br_cupswrapper_ink_input.ps  /tmp/br_cupswrapper_ink_lpderr      /tmp/br_input.oflcpP            /tmp/br_lpdfilter_ink.log
/tmp/br_cupswrapper_ink.log       /tmp/br_cupswrapper_ink_output.prn  /tmp/br_lpdfilter_ink_input.ps  /tmp/ql700_latest_print_info

Code: Select all

# cat /tmp/br_cupswrapper_ink.log 
START
ARG0      = 12419
ARG1      = root
ARG2      = label.pdf
ARG3      = 1
ARG4      = finishings=3 number-up=1 job-uuid=urn:uuid:47271ca7-ad95-3fff-4c0a-7edeec8a59bb job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1582909909 time-at-processing=1582909909 document-name-supplied=label.pdf
PRINTER   = ql700 
PPD       = /etc/cups/ppd/QL700.ppd
BASEPATH  = /opt/brother/PTouch/ql700/
export PPD=/etc/cups/ppd/QL700.ppd
/usr/libexec/cups/filter/brother_lpdwrapper_ql700 "root"  "label.pdf"  "1"  "finishings=3 number-up=1 job-uuid=urn:uuid:47271ca7-ad95-3fff-4c0a-7edeec8a59bb job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1582909909 time-at-processing=1582909909 document-name-supplied=label.pdf"  ""  ""

TEMPRC    = /tmp/brql700rc_29425
label1    = 
value1    = 

SET PPD OPTIONS
)cont  <=  0  : (0
)cont  <=  *  : (0
)feed  <=  3  : (3
)feed  <=  *  : (3
)brit  <=  0  : (0
)brit  <=  *  : (0
)cutlabel  <=  1  : (1
)cutlabel  <=  *  : (1

SET VENDOR COMMAND OPTIONS

SET PPD CMD OPTIONS
brprintconfpt1_ql700 -P ql700 -quality SPEED -rcfile /tmp/brql700rc_29425
brprintconfpt1_ql700 -P ql700 -mirro OFF -rcfile /tmp/brql700rc_29425
 -rcfile /tmp/brql700rc_29425 -cont 0
 -rcfile /tmp/brql700rc_29425 -feed 3
 -rcfile /tmp/brql700rc_29425 -brit 0
brprintconfpt1_ql700 -P ql700 -compress OFF -rcfile /tmp/brql700rc_29425
brprintconfpt1_ql700 -P ql700 -cutend ON -rcfile /tmp/brql700rc_29425
brprintconfpt1_ql700 -P ql700 -half BrErrorDiffusion -rcfile /tmp/brql700rc_29425
brprintconfpt1_ql700 -P ql700 -media 29x90 -rcfile /tmp/brql700rc_29425
brprintconfpt1_ql700 -P ql700 -trimtape ON -rcfile /tmp/brql700rc_29425
 -rcfile /tmp/brql700rc_29425 -cutlabel 1

export BRPAPERWIDTH=-1
export BRPAPERHEIGHT=-1
export PPD=/etc/cups/ppd/QL700.ppd
export BRPRINTERRCFILE=/tmp/ql700_latest_print_info
export LPD_DEBUG=2
export PS=1
cat /tmp/br_cupswrapper_ink_input.ps | /opt/brother/PTouch/ql700//lpd/filter_ql700 > /tmp/br_cupswrapper_ink_output.prn 
cat  > /tmp/br_cupswrapper_ink_input.ps && cat /tmp/br_cupswrapper_ink_input.ps |/opt/brother/PTouch/ql700//lpd/filter_ql700 > /tmp/br_cupswrapper_ink_output.prn

Code: Select all

# cat /tmp/br_lpdfilter_ink.log
BR_PRT_PATH=/opt/brother/PTouch/ql700-3.1.5-0/lpd/filter_ql700    PRINTER=ql700 

BRCONV=/opt/brother/PTouch/ql700-3.1.5-0/lpd/filter_ql700/lpd/rastertobrpt1    PRINTER=ql700 

PRINTER=ql700
$ENV{PS} =  1
$ENV{BRPRINTERRCFILE} = /tmp/brql700rc_29425
$ENV{BRPAPERWIDTH} = -1
$ENV{BRPAPERHEIGHT} = -1
 PAPERINF=/opt/brother/PTouch/ql700-3.1.5-0/lpd/filter_ql700/inf/paperinfql700 

Code: Select all

# cat /tmp/ql700_latest_print_info 
[ql700]
Copies=1
CutLabel=1
CutAtEnd=ON
Trimtape=ON
Compress=OFF
Brightness=0
Contrast=0
Halftone=ERROR
MirrorPrinting=OFF
Quality=SPEED
Resolution=300
Feed=3
MediaSize=29x90
Collate=OFF
Will do some more debugging.
On the Arch Linux page https://aur.archlinux.org/packages/brother-ql710w/
for the Brother QL-710w there was a suggestion to change the permissions and owner/group of some files:

Code: Select all

chown root:lp ${pkgdir}/opt/brother/PTouch/ql710w/inf/
chmod 775 ${pkgdir}/opt/brother/PTouch/ql710w/inf/
chown daemon:lp ${pkgdir}/opt/brother/PTouch/ql710w/inf/brql710wrc
chmod 664 ${pkgdir}/opt/brother/PTouch/ql710w/inf/brql710wrc
So might give something similar a try here "chown root.lp /opt/brother/PTouch/ql700/ ..."


Also not sure about how cups sets up its printer queues, whether its supposed to copy the ppd to /etc/cups/ppd/ and rename
but the /tmp/br_cupswrapper_ink.log shows that it's exporting /etc/cups/ppd/QL700.ppd
before running the print command.

Looks like the ppd is a copy other than the permissions:

Code: Select all

 # ls -l /etc/cups/ppd/QL700.ppd /opt/brother/PTouch/ql700/cupswrapper/brother_ql700_printer_en.ppd 
-rw-r----- 1 root lp   26041 Feb 28 09:47 /etc/cups/ppd/QL700.ppd
-rw-r--r-- 1 root root 26041 Apr  9  2019 /opt/brother/PTouch/ql700/cupswrapper/brother_ql700_printer_en.ppd
Top
redwood
Guru
Guru
Posts: 306
Joined: Fri Jan 27, 2006 6:28 am

SOLVED Brother PTouch QL100-3.1.5-0

  • Quote

Post by redwood » Fri Feb 28, 2020 9:08 pm

Thanks for all the help.

Finally got the printer working.
I'll write up something a little later to show what files were installed and which symlinks were changed and what files
were copied to /usr/bin and so forth.

Not sure what exactly was needed, but followed the Arch linux guide for the QL710w.

Then when printing finally saw that the computer was communicating with the printer as printer was flashing a red error light.
Then logged into localhost:631/admin and set the default options for type of labels being printed and then printer showed a green light
and finally printed.


So I'll hunt down all the installed files and symlinks and tar them up.
Maybe I'll try my hand at an ebuild. Don't like the rpm as it doesn't really show me which files were installed and value of symlinks and permissions.

The upstream Brother driver really should be fixed to handle symlinks properly without all this hassle.
But in the meantime, I'll put together a guide shortly.

Thanks again for all the help :-)
Top
redwood
Guru
Guru
Posts: 306
Joined: Fri Jan 27, 2006 6:28 am

How To Install Brother PTouch QL-700-3.1.5-0 driver

  • Quote

Post by redwood » Fri Feb 28, 2020 11:16 pm

First, make sure printer is turned on and usb cable plugged in.
Shoud show up in "lpinfo -lv"
If not, add persistent udev rule to /etc/udev/rules.d/42-brother-ql700.rules

(change ATTRS{serial} number to match output of "lsusb -v" or "usb-devices"

Code: Select all

# cat /etc/udev/rules.d/42-brother-ql700

SUBSYSTEMS=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="2042", ATTRS{serial}=="000J5Z413036", MODE="0664", GROUP="lp",  SYMLINK+="usb/lp0_000J5Z413036"
Actually, you don't really need the SYMLINK in the above udev rule.
Just make sure that the printer is turned on and shows up in "lpinfo -lv"
The udev symlink isn't used, but rather the URI reported by "lpinfo -lv"
something like this

Code: Select all

usb://Brother/QL-700?serial=000J5Z413036
Also make sure printer is not asleep. Indicator light should be green.
Also make sure that the blue indicator light is off. If it's on then you need to press and hold
the tiny front button until the light goes off. The blue light indicator is for one-touch setup
with Windows computers.

During the rpm installation, it the printer isn't recognized, it will use "/dev/usb/lp0"
as the uri for the printer by default, which is confusing, especially when there is no such device file.
Then when "lpadmin" is run to create the cups spool, you must not use "/dev/usb/lp0"
but rather whatever is shown by "lsusb -lv"

Install using rpm command

Code: Select all

rpm -ivh --nodeps --force                     ql700pdrv-3.1.5-0.i386.rpm 

or
rpm -ivh --nodeps --force --replacepkgs ql700pdrv-3.1.5-0.i386.rpm 
This will install the brother files to /opt/brother/PTouch/ql700:

Code: Select all

rpm -qlp ql700lpr-1.0.2-0.i386.rpm 
You can also extract the files from the rpm
using either rpm2targz

Code: Select all

rpm2targz ql700pdrv-3.1.5-0.i386.rpm 
or using rpm2cpio

Code: Select all

rpm2cpio ql700pdrv-3.1.5-0.i386.rpm | cpio -idmv 
These are the files which are extracted
and placed in /opt/brother/PTouch/ql700 via rpm:

Code: Select all

# tar -zvtf ql700pdrv-3.1.5-0.i386.tar.gz 

drwxr-xr-x root/root         0 2020-02-27 10:17 ./
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/brother/
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/brother/PTouch/
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/brother/PTouch/ql700/
-rw-r--r-- root/root     20486 2019-04-09 19:25 ./opt/brother/PTouch/ql700/LICENSE_ENG.txt
-rw-r--r-- root/root     20799 2019-04-09 19:25 ./opt/brother/PTouch/ql700/LICENSE_JPN.txt
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/brother/PTouch/ql700/cupswrapper/
-rwxr-xr-x root/root     23639 2019-04-09 19:25 ./opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700
-rwxr-xr-x root/root     26041 2019-04-09 19:25 ./opt/brother/PTouch/ql700/cupswrapper/brother_ql700_printer_en.ppd
-rwxr-xr-x root/root      5143 2019-04-09 19:25 ./opt/brother/PTouch/ql700/cupswrapper/cupswrapperql700
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/brother/PTouch/ql700/inf/
-rw-r--r-- root/root      1163 2019-04-09 19:25 ./opt/brother/PTouch/ql700/inf/ImagingArea
-rw-r--r-- root/root       793 2019-04-09 19:25 ./opt/brother/PTouch/ql700/inf/brql700func
-rw-r--r-- root/root       199 2019-04-09 19:25 ./opt/brother/PTouch/ql700/inf/brql700rc
-rw-r--r-- root/root       900 2019-04-09 19:25 ./opt/brother/PTouch/ql700/inf/paperinfql700
-rw-r--r-- root/root       132 2019-04-09 19:25 ./opt/brother/PTouch/ql700/inf/pdt3534.bin
-rwxr-xr-x root/root      1659 2019-04-09 19:25 ./opt/brother/PTouch/ql700/inf/setupPrintcappt1
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/brother/PTouch/ql700/lpd/
-rwxr-xr-x root/root      8131 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/filter_ql700
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/brother/PTouch/ql700/lpd/i686/
-rwxr-xr-x root/root     10064 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/i686/brpapertoolcups
-rwxr-xr-x root/root     12028 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/i686/brpapertoollpr_ql700
-rwxr-xr-x root/root     21788 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/i686/brprintconfpt1_ql700
-rwxr-xr-x root/root     41676 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/i686/rastertobrpt1
drwxr-xr-x root/root         0 2020-02-27 10:17 ./opt/brother/PTouch/ql700/lpd/x86_64/
-rwxr-xr-x root/root     17984 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/x86_64/brpapertoolcups
-rwxr-xr-x root/root     22204 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/x86_64/brpapertoollpr_ql700
-rwxr-xr-x root/root     33126 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/x86_64/brprintconfpt1_ql700
-rwxr-xr-x root/root     58151 2019-04-09 19:25 ./opt/brother/PTouch/ql700/lpd/x86_64/rastertobrpt1
NOTE that the initscripts are named differently in Gentoo,
in particular "/etc/init.d/cups" should be "/etc/init.d/cupsd"
so the rpm install script needs to be adapted for Gentoo.
So we need to correct the initscript from cups to cupsd for use with Gentoo:

Code: Select all

cd /opt/brother/PTouch/ql700/cupswrapper;
mv cupswrapperql700 cupswrapper1l700.bak
/bin/sed 's/\/etc\/init.d\/cups\ restart/\/etc\/init.d\/cupsd\ restart/g' ./cupswrapperql700.bak > cupswrapperql700

But the rpm script does more than just extract files to /opt
which we can see using the --scripts option with rpm:

Code: Select all

rpm -qp --scripts ql700lpr-1.0.2-0.i386.rpm 

preinstall program: /bin/sh
postinstall scriptlet (using /bin/sh):
if [ "$( uname -m | grep -i -e 'x86_64' -e 'amd64' )" != '' ]; then
ln -s /opt/brother/PTouch/ql700/lpd/x86_64/rastertobrpt1         /opt/brother/PTouch/ql700/lpd/rastertobrpt1

ln -s /opt/brother/PTouch/ql700/lpd/x86_64/brpapertoolcups       /opt/brother/PTouch/ql700/lpd/brpapertoolcups

ln -s /opt/brother/PTouch/ql700/lpd/x86_64/brpapertoollpr_ql700   /opt/brother/PTouch/ql700/lpd/brpapertoollpr_ql700

ln -s /opt/brother/PTouch/ql700/lpd/x86_64/brprintconfpt1_ql700   /opt/brother/PTouch/ql700/lpd/brprintconfpt1_ql700

else
ln -s /opt/brother/PTouch/ql700/lpd/i686/rastertobrpt1         
/opt/brother/PTouch/ql700/lpd/rastertobrpt1

ln -s /opt/brother/PTouch/ql700/lpd/i686/brpapertoolcups       /opt/brother/PTouch/ql700/lpd/brpapertoolcups

ln -s /opt/brother/PTouch/ql700/lpd/i686/brpapertoollpr_ql700   /opt/brother/PTouch/ql700/lpd/brpapertoollpr_ql700

ln -s /opt/brother/PTouch/ql700/lpd/i686/brprintconfpt1_ql700   /opt/brother/PTouch/ql700/lpd/brprintconfpt1_ql700
fi

/opt/brother/PTouch/ql700/inf/setupPrintcappt1 ql700 -i USB 
if [ -e /etc/init.d/lprng ]; then
/etc/init.d/lprng restart
elif [ -e /etc/init.d/lpd ]; then
/etc/init.d/lpd restart
fi
#if [ -e /etc/init.d/cups ]; then
#  /etc/init.d/cups restart
#fi
if [ "$(which semanage 2> /dev/null)" != '' ];then
semanage fcontext -a -t cupsd_rw_etc_t '/opt/brother/PTouch/ql700/inf(/.*)?'
semanage fcontext -a -t bin_t          '/opt/brother/PTouch/ql700/lpd(/.*)?'
semanage fcontext -a -t bin_t          '/opt/brother/PTouch/ql700/cupswrapper(/.*)?'
if [ "$(which restorecon 2> /dev/null)" != '' ];then
restorecon -R /opt/brother/PTouch/ql700
fi
fi
/opt/brother/PTouch/ql700/cupswrapper/cupswrapperql700
if [ ! -e /usr/bin/brpapertoollpr_ql700 ];then
ln -s /opt/brother/PTouch/ql700/lpd/brpapertoollpr_ql700 /usr/bin/brpapertoollpr_ql700
fi
if [ ! -e /usr/bin/brprintconfpt1_ql700 ];then
ln -s /opt/brother/PTouch/ql700/lpd/brprintconfpt1_ql700 /usr/bin/brprintconfpt1_ql700
fi
chmod 00777 /opt/brother/PTouch/ql700/inf
preuninstall scriptlet (using /bin/sh):
/opt/brother/PTouch/ql700/cupswrapper/cupswrapperql700 -e
/opt/brother/PTouch/ql700/inf/setupPrintcappt1 ql700 -e
unlink /usr/bin/brpapertoollpr_ql700
unlink /usr/bin/brprintconfpt1_ql700
unlink /opt/brother/PTouch/ql700/lpd/rastertobrpt1
unlink /opt/brother/PTouch/ql700/lpd/brpapertoolcups
unlink /opt/brother/PTouch/ql700/lpd/brpapertoollpr_ql700
unlink /opt/brother/PTouch/ql700/lpd/brprintconfpt1_ql700
postuninstall scriptlet (using /bin/sh):
#rm /usr/bin/brpapertoollpr_ql700
rm -rf /opt/brother/PTouch/ql700/inf/customtape
if [ -e /etc/init.d/lprng ]; then
/etc/init.d/lprng restart
elif [ -e /etc/init.d/lpd ]; then
/etc/init.d/lpd restart
fi
if [ "$(which semanage 2> /dev/null)" != '' ];then
semanage fcontext -d -t cupsd_rw_etc_t '/opt/brother/PTouch/ql700/inf(/.*)?'
semanage fcontext -d -t bin_t          '/opt/brother/PTouch/ql700/lpd(/.*)?'
semanage fcontext -d -t bin_t          '/opt/brother/PTouch/ql700/cupswrapper(/.*)?'
if [ "$(which restorecon 2> /dev/null)" != '' ];then
restorecon -R /opt/brother/PTouch/ql700
fi
fi
if [ -e /etc/init.d/cups ]; then
/etc/init.d/cups restart
fi
rm -f /tmp/ql700_latest_print_info
For x86_64, we need to remove all symlinks in /opt/brother/PTouch/ql700/lpd to x86_64
then move those x86_64 files from /opt/brother/PTouch/ql700/lpd/x86_64
to the parent directory and then remove the x86_64 directory
(not sure if we really need to remove the x86_64 directory or not)

Code: Select all

cd /opt/brother/PTouch/ql700/lpd

# remove those symlinks to the 64-bit binaries in x86_64
# and replace with the actual 64-bit binaries instead of symlinks

mv x86_64/* . ;  rmdir x86_64
I did not remove the i686 directory or its 32-bit elf binaries

Then we need to copy two of those x86_64 files to /usr/bin
from /opt/brother/PTouche/ql700/lpd

Code: Select all

cd /opt/brother/PTouch/ql700/lpd
cp brpapertoollpr_ql700 /usr/bin/brpapertoollpr_ql700  
cp brprintconfpt_ql700   /usr/bin/brprintconfpt1_ql700
Check/correct that these 2 symlinks to brother_lpdwrapper_ql700 are correct:

Code: Select all

/usr/lib64/cups/filter/brother_lpdwrapper_ql700    -> /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700
/usr/libexec/cups/filter/brother_lpdwrapper_ql700 -> /opt/brother/PTouch/ql700/cupswrapper/brother_lpdwrapper_ql700
Fix some permissions and ownership for these 2 files (not sure if really necessary), but anyhow:

Code: Select all

chown root.lp /opt/brother/PTouch/ql700/inf/
chmod 775     /opt/brother/PTouch/ql700/inf/

chown root.lp /opt/brother/PTouch/ql700/inf/brql700rc
chmod 664     /opt/brother/PTouch/ql700/inf/brql700rc
Lastly, use lpadmin to create the cups spool:

Code: Select all

# first remove any non-working/broken configuration
lpadmin -x QL700

# then recreate correct configuration using for usb://
whatever  URI is reported by "lpinfo -lv"

lpadmin -p QL700 -E -v usb://Brother/QL-700?serial=000J5Z413036 -P /usr/share/cups/model/Brother/brother_ql700_printer_en.ppd
Then login to localhost:631/admin and set the default printer options/sizes for your labels
or you can use the commandline tool "lpoptions" to show the available options
and the current settings and to also change the settings

List printer options and current settings as well as available choices:

Code: Select all

lpoptions -p QL700 -l
Use "lpoptions -p QL700 -o "option=value" to set a particular value for an available option

Unfortunately there's not much consistency in the cups/lp commands.
lpoptions uses lowercase "-p" for the destination printer configuration
lp uses lowercase "-d" for the destination printer
lpstat and lpq use uppercase "-P" for the printer destination

All should now work.
You can turn on DEBUG and LPD_DEBUG by setting the constants equal to '1'
in the perl script

Code: Select all

/opt/brother/PTouch/cups/filter/brother_lpdwrapper_ql700

Code: Select all

#   log functions

$LOGFILE="/tmp/br_cupswrapper_ink.log";
$LOGLEVEL=7;
$DEBUG=1;
$LOG_LATESTONLY=1;
$DEVICEURILOCK=1;
$LPD_DEBUG=1;

if ( $DEBUG > 0 ){
  $LPD_DEBUG=2;
}
This should create these file in /tmp when trying to print a test file:

Code: Select all

# lp -d QL700 label.pdf

# ls -l /tmp/br* /tmp/ql*
-rw------- 1 lp lp  51803 Feb 28 15:57 /tmp/br_cupswrapper_ink_input.ps
-rw------- 1 lp lp   2742 Feb 28 15:57 /tmp/br_cupswrapper_ink.log
-rw------- 1 lp lp    214 Feb 28 15:57 /tmp/br_cupswrapper_ink_lpderr
-rw------- 1 lp lp 103384 Feb 28 15:57 /tmp/br_cupswrapper_ink_output.prn
-rw------- 1 lp lp  51883 Feb 28 15:57 /tmp/br_lpdfilter_ink_gsout.dat
-rw------- 1 lp lp  51803 Feb 28 15:57 /tmp/br_lpdfilter_ink_input.ps
-rw------- 1 lp lp   1373 Feb 28 15:57 /tmp/br_lpdfilter_ink.log
-rw------- 1 lp lp 103384 Feb 28 15:57 /tmp/br_lpdfilter_ink_out.prn
-rw------- 1 lp lp    188 Feb 28 15:57 /tmp/br_lpdfilter_ink.rc
-rw-rw-rw- 1 lp lp    188 Feb 28 15:57 /tmp/ql700_latest_print_info
The ql700_latest_print_info should contain current printer settings once printer is turned on and not asleep
If the printer is asleep (green light not on), then press the "On" button on the right side of the front panel to wake the printer up which will then create ql700_latest_print_info in /tmp
which should look something like this:

Code: Select all

cat /tmp/ql700_latest_print_info 

[ql700]
Copies=1
CutLabel=1
CutAtEnd=ON
Trimtape=ON
Compress=OFF
Brightness=0
Contrast=0
Halftone=ERROR
MirrorPrinting=OFF
Quality=SPEED
Resolution=300
Feed=3
MediaSize=62x100
Collate=OFF
The br_cupswrapper_ink.log file contains info on processing the postscript file to the QL700 printer:

Code: Select all

apps /opt/brother/PTouch/ql700/cupswrapper # cat /tmp/br_cupswrapper_ink.log 
START
ARG0      = 12431
ARG1      = root
ARG2      = label.pdf
ARG3      = 1
ARG4      = finishings=3 number-up=1 job-uuid=urn:uuid:177c67e7-fd24-3de2-5ecc-d01bf1c4bb02 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1582923434 time-at-processing=1582923434 document-name-supplied=label.pdf
PRINTER   = ql700 
PPD       = /etc/cups/ppd/QL700.ppd
BASEPATH  = /opt/brother/PTouch/ql700/
export PPD=/etc/cups/ppd/QL700.ppd
/usr/libexec/cups/filter/brother_lpdwrapper_ql700 "root"  "label.pdf"  "1"  "finishings=3 number-up=1 job-uuid=urn:uuid:177c67e7-fd24-3de2-5ecc-d01bf1c4bb02 job-originating-host-name=localhost date-time-at-creation= date-time-at-processing= time-at-creation=1582923434 time-at-processing=1582923434 document-name-supplied=label.pdf"  ""  ""

TEMPRC    = /tmp/brql700rc_6657
label1    = 
value1    = 

SET PPD OPTIONS
-trimtape  <=  ON  : (ON)
-trimtape  <=  ON  : (ON)
-media  <=  29x90  : (62x100)
-media  <=  62x100  : (62x100)
-cutend  <=  ON  : (ON)
-cutend  <=  ON  : (ON)
-quality  <=  SPEED  : (BrSpeed)
-quality  <=  SPEED  : (BrSpeed)
-mirro  <=  OFF  : (OFF)
-mirro  <=  OFF  : (OFF)
-compress  <=  OFF  : (OFF)
-compress  <=  OFF  : (OFF)
-feed  <=  3  : (3)
-feed  <=  *  : (3)
-brit  <=  0  : (0)
-brit  <=  *  : (0)
-cont  <=  0  : (0)
-cont  <=  *  : (0)
-cutlabel  <=  1  : (1)
-cutlabel  <=  *  : (1)
-half  <=  BrErrorDiffusion  : (BrErrorDiffusion)
-half  <=  ERROR  : (BrErrorDiffusion)

SET VENDOR COMMAND OPTIONS

SET PPD CMD OPTIONS
brprintconfpt1_ql700 -P ql700 -quality SPEED -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -trimtape ON -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -brit 0 -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -compress OFF -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -cutlabel 1 -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -feed 3 -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -cutend ON -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -half ERROR -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -mirro OFF -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -media 62x100 -rcfile /tmp/brql700rc_6657
brprintconfpt1_ql700 -P ql700 -cont 0 -rcfile /tmp/brql700rc_6657

export BRPAPERWIDTH=-1
export BRPAPERHEIGHT=-1
export PPD=/etc/cups/ppd/QL700.ppd
export BRPRINTERRCFILE=/tmp/ql700_latest_print_info
export LPD_DEBUG=2
export PS=1
cat /tmp/br_cupswrapper_ink_input.ps | /opt/brother/PTouch/ql700//lpd/filter_ql700 > /tmp/br_cupswrapper_ink_output.prn 
cat  > /tmp/br_cupswrapper_ink_input.ps && cat /tmp/br_cupswrapper_ink_input.ps |/opt/brother/PTouch/ql700//lpd/filter_ql700 > /tmp/br_cupswrapper_ink_output.prn
And the br_lpdfilter_ink.log file contains postscript commands for setting printing the postcript file,
bounding box, rasterization, etc.:

Code: Select all

# cat /tmp/br_lpdfilter_ink.log

 BR_PRT_PATH=/opt/brother/PTouch/ql700/    PRINTER=ql700 

 BRCONV=/opt/brother/PTouch/ql700//lpd/rastertobrpt1    PRINTER=ql700 

PRINTER=ql700
$ENV{PS} =  1
$ENV{BRPRINTERRCFILE} = /tmp/brql700rc_6657
$ENV{BRPAPERWIDTH} = -1
$ENV{BRPAPERHEIGHT} = -1
 PAPERINF=/opt/brother/PTouch/ql700//inf/paperinfql700 

 TYPE=62x100  w=696 h=1109 size_br= 

size_gs = 696x1109 ,size_br =  -ps 696x1109 

[4.32 8.4 171.36 274.56] 

<</ImagingBBox [4.32 8.4 171.36 274.56] /PageOffset [-4.32 8.4]>> setpagedevice

**** (echo  '<</ImagingBBox [4.32 8.4 171.36 274.56] /PageOffset [-4.32 8.4]>> setpagedevice';cat /tmp/br_input.uwjlqE) | /usr/bin/gs -r300 -g696x1109 -q -dNOPROMPT -dNOPAUSE -dSAFER -sDEVICE=ppmraw -sstdout=%stderr -sOutputFile=- - -c quit   ****

**** /tmp/br_input.uwjlqE  ****

**** debug=2  ****

file type = <PostScript
>

 (echo  '<</ImagingBBox [4.32 8.4 171.36 274.56] /PageOffset [-4.32 8.4]>> setpagedevice';cat /tmp/br_input.uwjlqE) | /usr/bin/gs -r300 -g696x1109 -q -dNOPROMPT -dNOPAUSE -dSAFER -sDEVICE=ppmraw -sstdout=%stderr -sOutputFile=- - -c quit  > /tmp/br_lpdfilter_ink_gsout.dat

cat /tmp/br_lpdfilter_ink_gsout.dat | /opt/brother/PTouch/ql700//lpd/rastertobrpt1 -P ql700 -pi /opt/brother/PTouch/ql700//inf/paperinfql700 -rc /tmp/br_lpdfilter_ink.rc -out cat>/tmp/br_lpdfilter_ink_out.prn

cat /tmp/br_lpdfilter_ink_out.prn 
file type = PostScript

Now just need ebuild for this.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Sat Feb 29, 2020 9:14 am

Would you drop a link to this topic on the Brother printers wiki article? So others could find your work
Have you tried net-print/brlaser?
Top
redwood
Guru
Guru
Posts: 306
Joined: Fri Jan 27, 2006 6:28 am

  • Quote

Post by redwood » Sat Feb 29, 2020 4:00 pm

Guess I could drop a link to that site, but the page says it's for Brother Networked Printers. The PTouch QL-700 is a usb printer. At the office, I've just got this printer plugged in to the usb port of one computer which then is sharing it via cups with the rest of the office.

Anyhow, if you think it's ok to put a usb printer on the Brother Networked Printer page, I'd be glad to.

Didn't know about the net-print/brlaser ebuild before. I do have a Brother multifunction printer/scanner/faxer the MFC-L5850DW duplex wireless/ethernet laser printer. I just installed the linux driver for it from the Brother website and all just worked. So Brother's support for linux is rather good.

Needed a label printer that had linux support so went with the QL-700. I installed the 1.0.2-0 driver using rpm (with some tweaks I've forgotten) and it worked fine till a couple weeks ago when something broke on a system update.

I think installing the drivers for this in Gentoo may really boil down to something as simple s this:
  • Unpack rpm and copy files to installation root at /opt/Brother/PTouch/ql700
  • Get rid of the symlinks in "/opt/brother/PTouch/ql700/lpd/" pointing to the appropriate i686/x86_64 binaries by replacing those symlinks with the actual correct binaries
  • Fix permissions/ownerships on a few of the files
  • Create 2 symlinks in /usr/libexec/cups/filter/ and /usr/lib64/cups/filter/ pointing back to the correct files in the /opt/brother/PTouch/ql700 installation root
  • Copy 2 files from the installation root to /usr/bin/
  • Correct initscript name from cups to cupsd for Gentoo
  • Use lpadmin to create the printer queue configuration
What I found confusing/annoying about rpm (or maybe just it's implementation on Gentoo) is that it apparently it only lists the brother files installed in the installation root and not those files copied from there to /usr/bin nor those symlinks created in /usr/libexec/cups/filter/ and /usr/lib64/cups/filter/
And when re-installing (--replacepkgs) I was getting error messages about not being able to create the symlnks because they already existed so had to manually remove the links, re-run rpm, then remove more symlinks, rerun rpm, etc.. until finally it completed without error. Unfortunately the symlinks created in the rpm script don't work on Gentoo or maybe were incorrectly created because of differences with Gentoo filesystem layout. But really was expecting rpm to show me all the files/symlinks installed on the system and not just those files copied to the /opt/brother/PTouch/ql700 installation root.
Last edited by redwood on Sat Feb 29, 2020 4:36 pm, edited 1 time in total.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Sat Feb 29, 2020 4:28 pm

redwood wrote:Guess I could drop a link to that site, but the page says it's for Brother Networked Printers.
The page title is misleading. Even HL-2240 fits in there. Some of the administrators needs to move that article to »Brother printers«, I don't have permission to do that.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

Re: How To Install Brother PTouch QL-700-3.1.5-0 driver

  • Quote

Post by charles17 » Sat Feb 29, 2020 4:43 pm

redwood wrote:Now just need ebuild for this.
Take this as an example: https://github.com/stefan-langenmaier/b ... -r1.ebuild
Top
redwood
Guru
Guru
Posts: 306
Joined: Fri Jan 27, 2006 6:28 am

  • Quote

Post by redwood » Sat Feb 29, 2020 4:43 pm

OK, will put a link to this thread there when I get a chance. Need to create an account and answer a captcha question which only is correct on Gentoo system (working now from Sabayon laptop).
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Wed Mar 04, 2020 6:32 am

[bug]711458[/bug]
Top
Post Reply

13 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy