stefan-langenmaier / brother-overlay

Portage overlay for Brother printer and scanner software
GNU General Public License v3.0
35 stars 42 forks source link

Brother MFC-J3530DW #60

Open wmyrda opened 6 years ago

wmyrda commented 6 years ago

I became happy owner of the shiny new MFC-J3530DW. When I hooked it up I realized I need to install it in the system ;) I would kindly ask to add ebuilds for following

http://support.brother.com/g/b/downloadlist.aspx?c=pl&lang=pl&prod=mfcj3530dw_eu_as_cn&os=127&flang=English

Hopefully it will be as simple as copying one of other ebuilds, but I know to little about them to experiment on my own so help is welcomed

wmyrda commented 6 years ago

I felt lucky so I created brother-mfcj3530dw-bin-1.0.1.ebuild which looks as follows

# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit eutils rpm linux-info

MODEL="mfcj3530dw"
LPR_DLF=103001
CW_DLF=103025
BR_PR=${PR/r/}

DESCRIPTION="Brother MFC-J3530DW lpr+cupswrapper (printer) drivers"
HOMEPAGE="http://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=${MODEL}_us_as"
SRC_URI="http://download.brother.com/welcome/dlf${LPR_DLF}/${MODEL}lpr-${PV}-${BR_PR}.i386.rpm
        http://download.brother.com/welcome/dlf${CW_DLF}/${MODEL}cupswrapper-${PV}-${BR_PR}.i386.rpm"
LICENSE="GPL-2+ brother-eula no-source-code"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
RESTRICT="strip mirror"

DEPEND="net-print/cups"
RDEPEND="${DEPEND}"

DEST="/opt/brother/Printers/${MODEL}"
S="${WORKDIR}${DEST}"

pkg_setup() {
    CONFIG_CHECK=""
        if use amd64; then
                CONFIG_CHECK="${CONFIG_CHECK} ~IA32_EMULATION"
        fi

    linux-info_pkg_setup
}

src_install() {
        cd cupswrapper || die
        exeinto /usr/libexec/cups/filter
        doexe brother_lpdwrapper_${MODEL}

        exeinto ${DEST}/cupswrapper
        doexe cupswrapper${MODEL}
        insinto ${DEST}/cupswrapper
        doins brother_${MODEL}_printer_en.ppd
        insinto /usr/share/cups/model/Brother
        doins brother_${MODEL}_printer_en.ppd
        insinto /usr/share/ppd/Brother
        doins brother_${MODEL}_printer_en.ppd

        cd ../lpd || die
        exeinto ${DEST}/lpd
        doexe br${MODEL}filter filter_${MODEL}

        cd ../inf || die
        insinto ${DEST}/inf
        doins br${MODEL}rc br${MODEL}func ImagingArea PaperDimension paperinfij2
        doins -r lut

        cd "${WORKDIR}/usr/bin" || die
        into /usr
        dobin brprintconf_${MODEL}
}

All looked ok, but I am unable to connect to the network printer. Cups finds it but says

lpstat -d -l -t
system default destination: Brother_MFC-J3530DW
scheduler is running
system default destination: Brother_MFC-J3530DW
device for Brother_MFC-J3530DW: lpd://BRN3C2AF4266EE4/BINARY_P1
Brother_MFC-J3530DW accepting requests since wto, 26 cze 2018, 23:02:28
printer Brother_MFC-J3530DW now printing Brother_MFC-J3530DW-1.  enabled since wto, 26 cze 2018, 23:02:28
    Unable to locate printer "BRN3C2AF4266EE4".

Any idea if that could be ebuild related or any other issue may be responsible here?

EDIT: Now I see I completly left out instalation of brprintconf_mfcj3530dw. I will have to take cloaser look at where should that one go

stefan-langenmaier commented 6 years ago

Hi wmyrda,

first of all thanks for writing this ebuild. If you can create a pull request I think we can work on the file so we can add it to the repository.

Concerning the error, I think it's related with the address resolution of the printer name. Maybe you can have look into an ebuild that uses avahi (https://wiki.gentoo.org/wiki/Avahi).

I recommend to try it first with the actual IP address of the printer if this works you can replace it with .local, so in your case that will be lpd://BRN3C2AF4266EE4.local/BINARY_P1

wmyrda commented 6 years ago

So my scanner on that printer works fine after adding it with brsaneconfig4 -a name=Scanner model=Brother_MFC-J3530DW ip=192.168.101.11 but I still may not print anything even after trying lpd://BRN3C2AF4266EE4.local/BINARY_P1 and lpd://192.168.101.11/BINARY_P1. Maybe the issue here is that while managing printers and changing the driver I see two drivers with the same name? I did try both with no luck, but maybe some files are misplaced and that is why CUPS sees two drivers. Name resolution could have been the case in the past, but should not be anymore as I added BRN3C2AF4266EE4 and BRN3C2AF4266EE4.local to /etc/hosts. Printer gets statically assigned ip address from servers dhcp. I read that some printers do not work over LDP but only with IPP which is recommended by CUPS anyways. Perhaps I should try it if so than how?

lpoptions -d Brother_MFC-J3530DW
copies=1 device-uri=lpd://BRN3C2AF4266EE4/BINARY_P1 finishings=3 job-cancel-after=10800 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=1530083461 marker-colors=#000000,#FFFF00,#00FFFF,#FF00FF,none marker-levels=-1,-1,-1,-1,-1 marker-names='Black\ Ink\ Cartridge,Yellow\ Ink\ Cartridge,Cyan\ Ink\ Cartridge,Magenta\ Ink\ Cartridge,Ink\ Absorber' marker-types=ink-cartridge,ink-cartridge,ink-cartridge,ink-cartridge,waste-ink number-up=1 printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info='Brother MFC-J3530DW' printer-is-accepting-jobs=true printer-is-shared=false printer-is-temporary=false printer-location=BVO printer-make-and-model='Brother MFC-J3530DW CUPS' printer-state=3 printer-state-change-time=1530083488 printer-state-reasons=none printer-type=10629148 printer-uri-supported=ipp://localhost/printers/Brother_MFC-J3530DW

As for git pull I would rather not. I am very bad at it and would have to spend hours trying to do it, so if you think code is easier to check that way please do so.

stefan-langenmaier commented 6 years ago

What is the error message when you try to print with the fixed IP address? Are there other error messages logged? Are there differences between the two?

wmyrda commented 6 years ago

Full log https://pastebin.com/QEAZGb28 What stands out is Unable to execute ippfind utility: No such file or directory. Maybe one of the wrappers needs have entry changed with sed from ipptool to ippfind? Using qlist cups |grep ipp I find there are /usr/bin/ipptool and /usr/libexec/cups/filter/sys5ippprinter

EDIT: I see ippfind is completely different from ipptool. Might be that cups itself is missing something, but what? [ebuild R ] net-print/cups-2.2.8-r1::gentoo USE="X acl dbus java pam python ssl threads usb -debug -kerberos -lprng-compat (-selinux) -static-libs -systemd -xinetd -zeroconf" ABI_X86="32 (64) (-x32)" PYTHON_TARGETS="python2_7" 0 KiB

EIDT2: Gentoo says avahi may be used while Arch says avahi must be used to discover network printers. That is quite a substantial difference. I never had any need for using avahi so it may be driver is fine it is just cups is missing functionality. I'll test it in a sec.

EDIT3: I did manage to get printer working with avahi now that ippfind utility is also here, but something tells me it is not really using driver from Brother ;) which still seemed to fail me if picking other options than driverless

Anyway seems reasonable for network printer drivers to have zeroconf use flag or dependency check of some sort. Maybe zeroconf? ( net-print/cups[zeroconf] )?

stefan-langenmaier commented 6 years ago

Hi @wmyrda

I have found this bug report: https://bugs.gentoo.org/610086

It seems you need to install cups with the zeroconf USE-flag to have the ippfind application.

Does this resolve the problem?

wmyrda commented 6 years ago

@stefan-langenmaier yes. Like I said in EDIT 3 "I did manage to get printer working". Link from previous post https://imgur.com/a/ekhwj62 confirms that. I just have no idea if it is Brother driver that made it work as it says "driverless mode" ;) Other options did not really work for me

stefan-langenmaier commented 6 years ago

Oops, looks like I missed your edits. :) Well I don't think it is using the driver. Did something else fail then in the logs?