Linux open device failed

Arch Linux

I have a brother DCP 7020 printer/scanner. I used to print and scan with it in my previous computer running arch linux without problems. Now I have a new laptop, and I tried to set it up again. I installed ‘foomatic-db’ and got the printer to work with cups. However I’m having problems getting the scanner to work. In particular, when I run xsane, I get a pop-up saying

«Failed to open device `brother2:bus4;dev1′: Invalid argument»

I also tried simple-scan, and I got a «Failed to scan. Unable to connect to scanner» message.

Following the wiki for brother scanners, I installed the package brscan2 that corresonds to my model. After installing it, the scanner seems to be detected:

$ scanimage -L device `brother2:bus4;dev1' is a Brother DCP-7020 USB scanner device `v4l:/dev/video0' is a Noname Laptop_Integrated_Webcam_E4HD virtual device
$ lsusb | grep Brother Bus 003 Device 006: ID 04f9:0183 Brother Industries, Ltd DCP-7020

Something that seems to be problematic is that xsane is considering «bus4;dev1», wheras lsusb shows something about bus 3 and dev 6.

Anybody has any clue what’s going on?

PS. I rebooted both laptop and scanner after installing the packages and added my user to the scanner group. Also, the only difference between this and the previous laptop where the scanner worked, is that the new is 64bit and the old was 32bit.
PS2. This does not seem to be a permission problem either; I checked that there is a line for my printer in the udev rules file.

Last edited by geo909 (2016-04-05 19:36:57)

#2 2016-04-05 06:17:27

Re: [SOLVED]Brother scanner won’t work with xsane; «Failed to open device»

Have you got /etc/sane.d/brother.conf? It should be with line looks like this:

Inspect your /etc/sane.d/dll.conf, also. There should be line with: brother2.
Check /lib/udev/rules.d/49-sane.rules. It should be line looks like this:

# Brother DCP-7020 ATTRS=="04f9", ATTRS=="0183", MODE="0664", GROUP="scanner", ENV="yes"

Last edited by pb (2016-04-05 06:18:39)

#3 2016-04-05 14:23:04

Re: [SOLVED]Brother scanner won’t work with xsane; «Failed to open device»

Have you got /etc/sane.d/brother.conf? It should be with line looks like this:

Hmm.. There’s no brother.conf file in there. There are a lot of other .conf files, but not for brother.

Inspect your /etc/sane.d/dll.conf, also. There should be line with: brother2.

That was there. In fact there were three lines with «brother2».

Check /lib/udev/rules.d/49-sane.rules. It should be line looks like this:

# Brother DCP-7020 ATTRS=="04f9", ATTRS=="0183", MODE="0664", GROUP="scanner", ENV="yes"

So there is the brother.conf missing.. Would that be the culprit?

Читайте также:  Linux mint изменить порядок загрузки grub

#4 2016-04-05 15:58:31

Re: [SOLVED]Brother scanner won’t work with xsane; «Failed to open device»

Ok, problem solved. After reading this post I created a file `/lib/udev/40-libsane.rules` (it wasn’t there) and added:

1. Open "/lib/udev/rules.d/40-libsane.rules" file. 2.Add the following two lines to the end of the device list. # Brother scanners ATTRS=="04f9", ENV="yes"

After rebooting I was able to use simple-scan.

Is this missing file a bug? Should I bring this up to a maintener of some package or something?

Last edited by geo909 (2016-04-05 15:58:56)

#5 2016-04-05 19:11:22

Re: [SOLVED]Brother scanner won’t work with xsane; «Failed to open device»

Your homebrew udev rules file is actually doing the same thing as the line corresponding to your device in /usr/lib/udev/rules.d/49-sane.rules, it’s just a bit less strict regarding selection and permissions. The line in /usr/lib/udev/rules.d/49-sane.rules corresponding to the Brother MFC-215C which is working flawlessly here is the same except the deviceID.
So that udev rules file looks rather like a workaround, not the solution.

A backend configuration file /etc/sane.d/brotherN.conf isn’t provided by upstream and seems by no means obligatory as it doesn’t exist on the system the said Brother MFC-215C is connected to either.
Same applies to the apparent inconsistency between usb device numbering as stated by lsusb and ‘scanimage -L’ respectively. Same here, but scanner does work.
Membership in group scanner isn’t needed any longer.
Several copies of line ‘brother2’ in /etc/sane.d/dll.conf are probably due to the predecessor package brscan2 not removing these upon uninstall. This shouldn’t happen any longer using the current package.

Basically current AUR package brscan2, which I’m maintaining btw., seems to work as expected. Just tested it on a laptop where neither this package nor sane in general had been installed before.
After installing xsane the system needs to be rebooted in order to make xsane recognize available devices, but that’s what you did. (Maybe some udevadm invocation can do the trick, too. Didn’t test this.)

Did you eventually restore some old [x]sane settings when setting up your new laptop? I’m asking as faulty settings in ~/.sane/xsane/* can very well cause the error message you’re facing. You could eventually remove directory ~/.sane/xsane while xsane isn’t running.
If you’re interested in tracking this down further you could undo all unneeded modifications, reboot the system and see whether scanning from the command line by running e. g.

$ scanimage --format=PNG > test.png

works (assuming only one scanner device is attached).

#6 2016-04-05 19:36:02

Re: [SOLVED]Brother scanner won’t work with xsane; «Failed to open device»

Your homebrew udev rules file is actually doing the same thing as the line corresponding to your device in /usr/lib/udev/rules.d/49-sane.rules, it’s just a bit less strict regarding selection and permissions. The line in /usr/lib/udev/rules.d/49-sane.rules corresponding to the Brother MFC-215C which is working flawlessly here is the same except the deviceID.
So that udev rules file looks rather like a workaround, not the solution.

A backend configuration file /etc/sane.d/brotherN.conf isn’t provided by upstream and seems by no means obligatory as it doesn’t exist on the system the said Brother MFC-215C is connected to either.
Same applies to the apparent inconsistency between usb device numbering as stated by lsusb and ‘scanimage -L’ respectively. Same here, but scanner does work.
Membership in group scanner isn’t needed any longer.
Several copies of line ‘brother2’ in /etc/sane.d/dll.conf are probably due to the predecessor package brscan2 not removing these upon uninstall. This shouldn’t happen any longer using the current package.

Читайте также:  Linux как изменить файл командная строка

Basically current AUR package brscan2, which I’m maintaining btw., seems to work as expected. Just tested it on a laptop where neither this package nor sane in general had been installed before.
After installing xsane the system needs to be rebooted in order to make xsane recognize available devices, but that’s what you did. (Maybe some udevadm invocation can do the trick, too. Didn’t test this.)

Did you eventually restore some old [x]sane settings when setting up your new laptop? I’m asking as faulty settings in ~/.sane/xsane/* can very well cause the error message you’re facing. You could eventually remove directory ~/.sane/xsane while xsane isn’t running.
If you’re interested in tracking this down further you could undo all unneeded modifications, reboot the system and see whether scanning from the command line by running e. g.

$ scanimage --format=PNG > test.png

works (assuming only one scanner device is attached).

Thanks for all the info. I didn’t restore anything from my old laptop, the installation of sane, xsane, and brscan2 was fresh, using pacman and yaourt, nothing custom. I did uninstall and install them a couple of times while trying to figure the problem out, so maybe that’s why I had the multiple lines in my dll.conf.

Since my scanner works now, I’m happy and I think I won’t tinker with it any longer. If however you think that tracking this down further could contribute to improve the package, I’ll do, just let me know.

Last edited by geo909 (2016-04-05 19:36:23)

Источник

After installing NMAP: dnet: Failed to open device eth0?

In my case, the error was caused by nmap being installed through Snap.

In order to get nmap to work, I had to tell snap to connect it to the network-control:

sudo snap connect nmap:network-control 

After that everything worked fine.

TLDR: Use the —unprivileged nmap option.

I just suffered the same problem when tried to scan/test hosts thru a Wireguard 0.3.14 tunnel in Windows 8.1 and Windows 7 using the last available versions, nmap 7.91, npcap 1.31. Tried several solutions/combinations, running as admin, reinstalling, etc., except downgrading to Winpcap 4.1.3 (the last available) with the same result:

C:\Windows\system32>nmap -n -P0 -p 22 192.168.20.1 Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower. Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-08 13:28 Hora de verano central (México) dnet: Failed to open device eth0 QUITTING! 

It’s strange that the interface listing of nmap —iflist does not show a device name associated with eth0 (also doesn’t show a MAC address, maybe it’s Wireguard interface driver install/hooks at fault here). Relevant lines:

C:\Windows\system32>nmap --iflist Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-08 13:32 Hora de verano central (México) ************************INTERFACES************************ DEV (SHORT) IP/MASK TYPE UP MTU MAC eth0 (eth0) 10.10.252.92/32 ethernet up 65535 00:00:00:00:00:00 : DEV WINDEVICE eth0
C:\Windows\system32>route print =========================================================================== Interface list 8. Wintun Userspace Tunnel #77 : IPv4 Route table =========================================================================== Active routes: Network Destination Net mask Gateway Interface Metric 192.168.20.0 255.255.255.0 On-link 10.10.252.92 5 192.168.20.255 255.255.255.255 On-link 10.10.252.92 261 

Solved it using the —unprivileged option:

C:\Windows\system32>nmap --unprivileged -n -P0 -p 22 192.168.20.1 Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times will be slower. Starting Nmap 7.91 ( https://nmap.org ) at 2021-06-08 13:22 Hora de verano central (MÚxico) Nmap scan report for 192.168.20.1 Host is up (0.20s latency). PORT STATE SERVICE 22/tcp open ssh Nmap done: 1 IP address (1 host up) scanned in 0.29 seconds 

Источник

Читайте также:  Remove all permissions linux

«failed to open this device: LIBUSB_ERROR_ACCESS» on ubuntu16.04, have tried some solutions

After searching for long time on internet I think there is no proper answer so I put up this problem. As being new here, I apology if I made any mistakes. I have a tof camera connected to ubuntu16.04 through usb and a software to operate it. When I try to receive the image through software:

it gives these error repeatedly: 2018/07/06 20:27:20.297[3249948416][DBG] [dmcam_dev_open] open dmcam device @ 0x7f8ab88e29c0 2018/07/06 20:27:20.297[3249948416][DBG] [_usb_ll_dev_open] create usb context 2018/07/06 20:27:20.300[3249948416][ERR] [dmcam_dev_open] open device failed! 2018/07/06 20:27:21.301[3249948416][DBG] [dmcam_dev_open] open dmcam device @ 0x7f8ab88e29c0 2018/07/06 20:27:21.301[3249948416][DBG] [_usb_ll_dev_open] create usb context 2018/07/06 20:27:21.303[3249948416][ERR] [dmcam_dev_open] open device failed! 2018/07/06 20:27:22.304[3249948416][DBG] [dmcam_dev_open] open dmcam device @ 0x7f8ab88e29c0 2018/07/06 20:27:22.304[3249948416][DBG] [_usb_ll_dev_open] create usb context 2018/07/06 20:27:22.307[3249948416][DBG] [_usb_ll_dev_open] found dmcam device (speed=3) @ 001:002:020 2018/07/06 20:27:22.307[3249948416][WRN] [_usb_ll_dev_open] failed to open this device: LIBUSB_ERROR_ACCESS, try next . 2018/07/06 20:27:22.308[3249948416][ERR] [dmcam_dev_open] open device failed! but if I run this command:

sudo nano /etc/udev/rules.d/99-persistent-usb.rules 
SUBSYSTEMS=="usb",ATTRS=="111b", \ ATTRS==1238",GROUP="root", OWNER="root", \ MODE="0666" 
$ lsusb Bus 001 Device 002: ID 8087:8001 Intel Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 006: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 002 Device 005: ID 8087:07dc Intel Corp. Bus 002 Device 004: ID 064e:920b Suyin Corp. Bus 002 Device 003: ID 046d:c530 Logitech, Inc. Bus 002 Device 021: ID 111b:1238 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
GROUP="dongtu" or "adm" or "usrs" or "plugdev", OWNER="dongtu" or just removing it, adding TAG+="uaccess", putting in one line and remove " \" 
sudo udevadm control --reload 

However, all these make no change. I observed that there is no change under /dev/ when I connect the tof, but I failed to figure out why. I hope to do my job in anaconda with python, which means I can’t use sudo in case run under system python environment. Is there any one could help me? Apologize again if I wasted your time.

Источник

Оцените статью
Adblock
detector