You are not logged in.

#1 2016-07-04 21:20:24

Sedenion
Member
Registered: 2016-07-03
Posts: 30

[Solved] How to obtain device URI?

I am trying to setup a printer using the instructions given here: https://wiki.archlinux.org/index.php/CUPS. The command

lpadmin -p <printer_name> -E -v <device> -P <ppd>

requires the address <device> of the printer.

lsusb detects the printer, but does not show its address. (usb://...) lpinfo show the following:

$ lpinfo -v
network beh
network http
network ipps
network ipp
network socket
network https
network lpd
network smb

How do I obtain the address? The printer is directly attached to the computer through an USB cable.

Edit: Uninstalling sane and brscan4 allows lpinfo to detect the printer's URI.

Last edited by Sedenion (2016-07-06 03:34:01)

Offline

#2 2016-07-05 14:14:13

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [Solved] How to obtain device URI?

When wiki pages show commands beginning '# ' that indicates you need to run the command as root. What does lpinfo show when you run it as root?

Offline

#3 2016-07-05 15:25:10

Sedenion
Member
Registered: 2016-07-03
Posts: 30

Re: [Solved] How to obtain device URI?

ukhippo wrote:

When wiki pages show commands beginning '# ' that indicates you need to run the command as root. What does lpinfo show when you run it as root?

It shows the same thing in a different order.

$ sudo lpinfo -v
network lpd
network https
network http
network ipps
network socket
network ipp
network beh
network smb

$ sudo su
# lpinfo -v
network beh
network ipps
network https
network socket
network http
network ipp
network lpd
network smb

Offline

#4 2016-07-05 16:43:40

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [Solved] How to obtain device URI?

sudo su is a nonsensical thing to do, use sudo -i or -s instead.
As for the address, what model of printer is this and what does dmesg say when you plug it in?

Edit: Also, if you have access to a browser then using the web interface can be quite a bit easier.

Last edited by Mr.Elendig (2016-07-05 16:44:20)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#5 2016-07-05 17:45:06

Sedenion
Member
Registered: 2016-07-03
Posts: 30

Re: [Solved] How to obtain device URI?

Mr.Elendig wrote:

sudo su is a nonsensical thing to do, use sudo -i or -s instead.
As for the address, what model of printer is this and what does dmesg say when you plug it in?

Edit: Also, if you have access to a browser then using the web interface can be quite a bit easier.

sudo -i with lpinfo -v gives the same result. My printer is Brothers MFC7360N. dmesg gives

[14399.325029] usb 2-1.3: new high-speed USB device number 8 using ehci-pci
[14399.415787] usblp 2-1.3:1.0: usblp1: USB Bidirectional printer dev 8 if 0 alt 0 proto 2 vid 0x04F9 pid 0x0270

I do have access to the web interface (http://127.0.0.1:631/) but my printer does not show up on the "Add printer" page.

Offline

#6 2016-07-05 18:10:57

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [Solved] How to obtain device URI?

Start by installing brother-mfc7360n from aur if you havn't.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#7 2016-07-05 18:49:46

Sedenion
Member
Registered: 2016-07-03
Posts: 30

Re: [Solved] How to obtain device URI?

Mr.Elendig wrote:

Start by installing brother-mfc7360n from aur if you havn't.

I installed the driver from here: https://aur.archlinux.org/packages/brother-mfc7360n/ with

$ git clone https://aur.archlinux.org/brother-mfc7360n.git 
$ cd brother-mfc7360n/ && makepkg -sri

but lpinfo still gives the same output:

$ sudo -i
$ lpinfo -v
network ipps
network http
network beh
network https
network ipp
network socket
network lpd
network smb

lsusb is still able to detect the printer.

Meanwhile, the scanner attached to the printer is fully functional (with SANE) and I sucessfully scanned a few image with that.

Last edited by Sedenion (2016-07-05 19:04:33)

Offline

#8 2016-07-05 20:10:47

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: [Solved] How to obtain device URI?

When you connect the printer, several lines should be appended to the journal.  Could you post those lines here?   I have a feeling the printer might be showing up as a storage device.  More and more, manufacturers are shipping systems that appear to be storage devices so that they can automatically install device drivers on Windows.  When those drivers run, they flip a magic switch that cause the printers to re-enumerate as  a printer.  For some reason this is preferred over the proper solution of providing multiple USB endpoints.   Anyway, let's see if this is the issue.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#9 2016-07-05 21:35:17

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: [Solved] How to obtain device URI?

It might be caused by usblp; if it is, report the bug!
Or perhaps there is a conflict with SANE?
There's an entry for a Brother MFC7360 on the Printer-specific problems page on the wiki, so someone got it working at some point...

The URI will be something like this:

usb://Brother/MFC7360N

You could try that and see whether it works; the CUPS page on the wiki isn't in a good shape at the moment.

Offline

#10 2016-07-05 23:54:13

Sedenion
Member
Registered: 2016-07-03
Posts: 30

Re: [Solved] How to obtain device URI?

ewaller wrote:

When you connect the printer, several lines should be appended to the journal.  Could you post those lines here?   I have a feeling the printer might be showing up as a storage device.  More and more, manufacturers are shipping systems that appear to be storage devices so that they can automatically install device drivers on Windows.  When those drivers run, they flip a magic switch that cause the printers to re-enumerate as  a printer.  For some reason this is preferred over the proper solution of providing multiple USB endpoints.   Anyway, let's see if this is the issue.

Sorry, which journal file are you referring to?

Offline

#11 2016-07-06 00:08:47

Sedenion
Member
Registered: 2016-07-03
Posts: 30

Re: [Solved] How to obtain device URI?

pypi wrote:

It might be caused by usblp; if it is, report the bug!
Or perhaps there is a conflict with SANE?
There's an entry for a Brother MFC7360 on the Printer-specific problems page on the wiki, so someone got it working at some point...

The URI will be something like this:

usb://Brother/MFC7360N

You could try that and see whether it works; the CUPS page on the wiki isn't in a good shape at the moment.

Blacklisting usblp doesn't work. It produces the same result.

I tried creating the file

/etc/udev/rules.d/99-printer.rules
# idProduct and idVendor needs to match your printer
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341b", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"

but the problem is still there.

Offline

#12 2016-07-06 03:25:41

Sedenion
Member
Registered: 2016-07-03
Posts: 30

Re: [Solved] How to obtain device URI?

Thanks to pypi, I have found a solution. I uninstalled sane and brscan4 and now lpinfo -v produces:

$ sudo lpinfo -v
network ipps
network http
network beh
network ipp
network lpd
network https
network socket
direct usb://Brother/MFC-7360N?serial=U62700H1N772098
network smb

Offline

#13 2016-07-06 04:35:09

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: [Solved] How to obtain device URI?

Sedenion wrote:
ewaller wrote:

When you connect the printer, several lines should be appended to the journal.  Could you post those lines here?   I....

Sorry, which journal file are you referring to?

*Headdesk*


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#14 2016-07-06 05:52:35

pypi
Wiki Maintainer
Registered: 2014-04-22
Posts: 250

Re: [Solved] How to obtain device URI?

Sedenion wrote:

...

I tried creating the file

/etc/udev/rules.d/99-printer.rules
# idProduct and idVendor needs to match your printer
ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341b", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"

but the problem is still there.

You've copied and pasted from the wiki; idProduct and idVendor will be wrong. You can find the correct values in the lsusb output - according to the dmesg output, assuming that these are what I think they are,

vid 0x04F9 pid 0x0270

the idVendor should be 04F9 and idProduct should be 0270.

Offline

Board footer

Powered by FluxBB