You are not logged in.

#1 2013-06-22 10:07:17

xanb
Member
Registered: 2012-07-24
Posts: 418

Brother HL-3150CDW installation driver in cups [solved]

Hi,

Recently I bought the Brother HL-3150CDW color laser printer and I want to install driver in cups. I search in wiki and I found several pages, for example HL-2250ND and MFC-9320CW and I deciced to follow.

In all cases, they:

  1. pacman -S rpmextract

  2. rpmextract.sh *.rpm (in my case it creates two directories: opt and usr with the following contents:

    # ls -R ./
    ./:
    hl3150cdwcupswrapper-1.1.2-1.i386.rpm  hl3150cdwlpr-1.1.2-1.i386.rpm  opt  usr
    
    ./opt:
    brother
    
    ./opt/brother:
    Printers
    
    ./opt/brother/Printers:
    hl3150cdw
    
    ./opt/brother/Printers/hl3150cdw:
    cupswrapper  inf  lpd
    
    ./opt/brother/Printers/hl3150cdw/cupswrapper:
    brcupsconfpt1  brother_hl3150cdw_printer_en.ppd  cupswrapperhl3150cdw
    
    ./opt/brother/Printers/hl3150cdw/inf:
    brhl3150cdwfunc  brhl3150cdwrc  ImagingArea  lut  paperinfij2  setupPrintcapij
    
    ./opt/brother/Printers/hl3150cdw/inf/lut:
    0600-c_cache12.bin     0600-m_cache12.bin     capt-c_cache12.bin     capt-m_cache12.bin
    0600-c-TS_cache12.bin  0600-m-TS_cache12.bin  capt-c-TS_cache12.bin  capt-m-TS_cache12.bin
    0600-k_cache12.bin     0600-y_cache12.bin     capt-k_cache12.bin     capt-y_cache12.bin
    0600-k-TS_cache12.bin  0600-y-TS_cache12.bin  capt-k-TS_cache12.bin  capt-y-TS_cache12.bin
    
    ./opt/brother/Printers/hl3150cdw/lpd:
    brhl3150cdwfilter  filterhl3150cdw  psconvertij2
    
    ./usr:
    bin
    
    ./usr/bin:
    brprintconf_hl3150cdw
  3. change 'etc/init.d/' to 'etc/rc.d'

So  I can't do the last step because, archlinux now uses systemd. After the substitution, the wrapper contains these lines:

# cat cupswrapperhl3150cdw | grep rc.d
if [  -e /etc/rc.d/cups ]; then
   /etc/rc.d/cups restart
elif [  -e /etc/rc.d/cupsys ]; then
   /etc/rc.d/cupsys restart
#  /etc/rc.d/cups restart
if [  -e /etc/rc.d/cups ]; then
   /etc/rc.d/cups restart
elif [  -e /etc/rc.d/cupsys ]; then
   /etc/rc.d/cupsys restart
#  /etc/rc.d/cups restart
errorcode=0
    errorcode=30
exit $errorcode
if [ -e /etc/rc.d/lpd ]; then
   /etc/rc.d/lpd stop
if [  -e /etc/rc.d/lprng ]; then
   /etc/rc.d/lprng stop
if [  -e /etc/rc.d/cups ]; then
   /etc/rc.d/cups restart
elif [  -e /etc/rc.d/cupsys ]; then
   /etc/rc.d/cupsys restart

what obviously does not work. How can I adapt rc.d script to systemd? Any help will be appreciated.

Last edited by xanb (2013-06-23 17:43:16)


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#2 2013-06-23 02:08:15

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: Brother HL-3150CDW installation driver in cups [solved]

I believe the following will work.

systemctl restart cups.service

Last edited by David Batson (2013-06-23 02:08:41)

Offline

#3 2013-06-23 11:57:37

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: Brother HL-3150CDW installation driver in cups [solved]

The exact question is: what is equivalent of the above lines?

This?

if [  -e /etc/rc.d/cups ]; then
   systemctl restart cups.service
elif [  -e /etc/rc.d/cupsys ]; then
   systemctl restart cups.service
#  /etc/rc.d/cups restart
if [  -e /etc/rc.d/cups ]; then
   systemctl restart cups.service
elif [  -e /etc/rc.d/cupsys ]; then
   systemctl restart cups.service
#  /etc/rc.d/cups restart
errorcode=0
    errorcode=30
exit $errorcode
if [ -e /etc/rc.d/lpd ]; then
   /etc/rc.d/lpd stop
if [  -e /etc/rc.d/lprng ]; then
   /etc/rc.d/lprng stop
if [  -e /etc/rc.d/cups ]; then
   systemctl restart cups.service
elif [  -e /etc/rc.d/cupsys ]; then
   systemctl restart cups.service

What is the equivalent of 'if [  -e /etc/rc.d/cups ];' in systemd?

Thanks for answering.
Xan.


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#4 2013-06-23 14:56:29

rtoijala
Member
Registered: 2011-09-11
Posts: 36

Re: Brother HL-3150CDW installation driver in cups [solved]

As far as I can tell, the "if [ -e ....... ];" lines are just checking to see what the rc.d script is called.
Since you are not using rc.d scripts, just replace the whole

if [ ... ]; then
    /etc/rc.d/... restart 
endif

thing with

systemctl restart cups.service.

Offline

#5 2013-06-23 15:40:54

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: Brother HL-3150CDW installation driver in cups [solved]

Thanks both for all. I change that, and then I have this code:

# diff cupswrapperhl3150cdw cupswrapperhl3150cdw-old 
50c50,55
<   systemctl restart cups.service
---
> if [  -e /etc/rc.d/cups ]; then
>    /etc/rc.d/cups restart
> elif [  -e /etc/rc.d/cupsys ]; then
>    /etc/rc.d/cupsys restart
> fi
> #  /etc/rc.d/cups restart
52c57
< 
---
> fi
55c60,65
<   systemctl restart cups.service
---
> if [  -e /etc/rc.d/cups ]; then
>    /etc/rc.d/cups restart
> elif [  -e /etc/rc.d/cupsys ]; then
>    /etc/rc.d/cupsys restart
> fi
> #  /etc/rc.d/cups restart
288c298,303
< systemctl restart cups.service
---
> 
> if [  -e /etc/rc.d/cups ]; then
>    /etc/rc.d/cups restart
> elif [  -e /etc/rc.d/cupsys ]; then
>    /etc/rc.d/cupsys restart
> fi

but I have rc.d related to lpd  and lpdng:

# cat cupswrapperhl3150cdw | grep "rc.d"
errorcode=0
    errorcode=30
exit $errorcode
if [ -e /etc/rc.d/lpd ]; then
   /etc/rc.d/lpd stop
if [  -e /etc/rc.d/lprng ]; then
   /etc/rc.d/lprng stop

What are the equivalents of systemd? How can I check if lpd service exists?


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#6 2013-06-23 16:06:08

rtoijala
Member
Registered: 2011-09-11
Posts: 36

Re: Brother HL-3150CDW installation driver in cups [solved]

Google gives me this and more importantly this
So it looks as if you can also replace these lines with

systemctl stop cups.service

You could have found this yourself with a bit of effort.

Last edited by rtoijala (2013-06-23 16:06:27)

Offline

#7 2013-06-23 16:41:08

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: Brother HL-3150CDW installation driver in cups [solved]

Sorry, but I did not found. I searched google and duck too.
I substitute the lines for systemctl stop cups.service


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#8 2013-06-23 16:45:59

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: Brother HL-3150CDW installation driver in cups [solved]

Now the problem is where to put directories.

In wiki, it creates 'bin' and 'usr' directories. In my case I have 'opt' and 'usr' directories:

brother/:
hl3150cdwcupswrapper-1.1.2-1.i386.rpm
hl3150cdwlpr-1.1.2-1.i386.rpm
opt
usr

brother/opt:
brother

brother/opt/brother:
Printers

brother/opt/brother/Printers:
hl3150cdw

brother/opt/brother/Printers/hl3150cdw:
cupswrapper
inf
lpd

brother/opt/brother/Printers/hl3150cdw/cupswrapper:
brcupsconfpt1
brother_hl3150cdw_printer_en.ppd
cupswrapperhl3150cdw
cupswrapperhl3150cdw-old

brother/opt/brother/Printers/hl3150cdw/inf:
brhl3150cdwfunc
brhl3150cdwrc
ImagingArea
lut
paperinfij2
setupPrintcapij

brother/opt/brother/Printers/hl3150cdw/inf/lut:
0600-c_cache12.bin
0600-c-TS_cache12.bin
0600-k_cache12.bin
0600-k-TS_cache12.bin
0600-m_cache12.bin
0600-m-TS_cache12.bin
0600-y_cache12.bin
0600-y-TS_cache12.bin
capt-c_cache12.bin
capt-c-TS_cache12.bin
capt-k_cache12.bin
capt-k-TS_cache12.bin
capt-m_cache12.bin
capt-m-TS_cache12.bin
capt-y_cache12.bin
capt-y-TS_cache12.bin

brother/opt/brother/Printers/hl3150cdw/lpd:
brhl3150cdwfilter
filterhl3150cdw
psconvertij2

brother/usr:
bin

brother/usr/bin:
brprintconf_hl3150cdw

In which directories I have to move that?

It's clear that '~/brother/usr/bin/brprintconf_hl3150cdw' to '/usr/bin/brprintconf_hl3150cdw'. But 'opt'?

Thanks,

Last edited by xanb (2013-06-23 16:46:43)


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#9 2013-06-23 17:14:21

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: Brother HL-3150CDW installation driver in cups [solved]

* I copy ~/brother/opt/brother to /opt/brother and /usr/bin/* to /usr/bin
* I run  ls /opt/brother/Printers/hl3150cdw/cupswrapper/cupswrapperhl3150cdw. All is good:

Warning: Stopping cups.service, but it can still be activated by:
  cups.path
  cups.socket
lpadmin -p HL3150CDW -E -v usb:/dev/usb/lp0 -P /usr/share/cups/model/Brother/brother_hl3150cdw_printer_en.ppd

and I have this printer added to cups.
* But when I print "sample page" I received:

Processant - "S'està esperant que la impressora estigui disponible."

Translated:

Processing - "Waiting printer will be available"

What's wrong now?. Yes, I restart cups several times.

dmesg shows me

[ 4318.901821] usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x04F9 pid 0x0052
[ 4324.176213] usblp0: removed
[ 4324.181823] usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x04F9 pid 0x0052

and /var/log/cups/error.log shows me:

I [23/Jun/2013:19:13:38 +0200] [Job 33] S'està esperant que la impressora estigui disponible.
I [23/Jun/2013:19:13:42 +0200] Saving job.cache...
D [23/Jun/2013:19:13:42 +0200] cupsdSetBusyState: newbusy="Printing jobs", busy="Printing jobs and dirty files"

Thanks in advance,
Xan.


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#10 2013-06-23 17:42:55

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: Brother HL-3150CDW installation driver in cups [solved]

USB connection does not work, but if I add the same printer with network (lpd://172.26.0.8/BINARY_P1), all is fine.
Completed. I will create a wiki page with a summary of this information.

Thanks all of you, very much,
Xan.


Owning one OpenRC (artoo way) and other three systemd machines

Offline

#11 2013-06-24 18:27:51

xanb
Member
Registered: 2012-07-24
Posts: 418

Re: Brother HL-3150CDW installation driver in cups [solved]

As I promiss, this is the wiki page with all information. Please improve it, if you want, overall people have this printer model ;-)


Owning one OpenRC (artoo way) and other three systemd machines

Offline

Board footer

Powered by FluxBB