Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Canon G3110 Multifunction Printer Scanner Does Not Work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Thu Oct 03, 2019 4:45 pm    Post subject: Canon G3110 Multifunction Printer Scanner Does Not Work Reply with quote

I am setting up Sane to use the Canon G3110 USB multifunction printer scanner. I installed sane-backends with the pixma flag. The scanner is not identified with scanimage -L.

Code:
scanimage -L
No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate). Please read the documentation which came with this software (README, FAQ, manpages).


However, it is identified with sane-find-scanner:

Code:
sane-find-scanner

  # sane-find-scanner will now attempt to detect your scanner. If the
  #result is different from what you expected, first make sure yours
  # scanner is powered up and properly connected to your computer.

  # No SCSI scanners found. If you expected something different, make sure that
  # you have loaded a SCSI kernel driver for your SCSI adapter.

found USB scanner (vendor = 0x04a9 [Canon], product = 0x183b [G3010 series]) at libusb: 003: 004
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

  # Not checking for parallel port scanners.

  # Most Scanners connected to the parallel port or other proprietary ports
  # can't be detected by this program.

  # You may want to run this program as root to find all devices. Once you
  # found the scanner devices, be sure to adjust access permissions as
  # necessary.


The Sane gentoo Wiki reports that some devices have permission issues. But I do not understand what I have to do to solve the problem.

Could anyone help me in the case?
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1773
Location: United Kingdom

PostPosted: Thu Oct 03, 2019 7:00 pm    Post subject: Reply with quote

Some years ago I had a struggle to get the scanner in a different model of Canon MFP to work. In case it is of help in your case, here is the link to my blog post on how I got it to work: The problem of scanning using USB multi-function printers in Linux (success at last). Hope it helps.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Thu Oct 03, 2019 7:04 pm    Post subject: Reply with quote

thanks I'll try
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Thu Oct 03, 2019 9:10 pm    Post subject: Reply with quote

Your article is very cool and gave me hope that I could use the scanner on my gentoo computer. But I have come up with some particulars and I need clarification to make the appropriate changes.

My printer has the following ID:

Code:
Bus 003 Device 002: ID 04a9: 183b Canon, Inc.


My usb storage is set as kernel module (USB_STORAGE = m). Then I need to break the drive's connection to the interface. However, the file /etc/modprobe.d/usb-storage.conf does not exist. So I created the file and put the rule. Is there a problem with that?

I created a UDEV rules file /etc/udev/rules.d/99-canon-mp560.rules to modify the device ACL to my Vendor and product specifications.

Except for creating UDEV rules to change device owner, group, and permissions, I didn't find any files in /lib/udev/rules.d/ explicitly mentioning my device. The closest I found was the CANON PIXMA G3000 (04a9: 180b). So I copied his information and changed it to the specifications of my G3110 (04a9: 183b).

Then I created the UDEV file /etc/udev/rules.d/95-libsane.rules.

List the files in /etc/udev/rules.d/ and I received that both are there: 95-libsane.rules 99-canon-mp560.rules.

I turned the printer off and on, then restarted the system, but the permissions created were not there.

Code:
ls -la /dev/bus/usb/001
total 0
root drwxr-xr-x 2 root 80 out 3 17:33.
root drwxr-xr-6 root 120 Oct 3 17:33 ..
crw-rw-r-- 1 root usb 189, 0 out 3 17:33 001
crw-rw-r-- 1 root usb 189, 1 out 3 17:33 002


I listed the users and found their repetition.

Code:
tux/home/hot # users
hot hot hot hot


So I stopped there.
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Thu Oct 03, 2019 10:12 pm    Post subject: Reply with quote

I managed to make the permissions created work, however the scanner is not identified by:

Code:
tux/home/hot # scanimage -L

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which cam with this software (README, FAQ, manpages).


Only sane-find-scanner can see the device:

Code:
hot@tux ~ $ sane-find-scanner -q
found USB scanner (vendor = 0x04a9 [Canon], product = 0x183b [G3010 series]) at libusb: 003: 009

_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Thu Oct 03, 2019 10:15 pm    Post subject: Reply with quote

My pixma configuration file looks like this (/etc/sane.d/pixma.conf)

Code:
# pixma.conf configuration for the sane pixma backend
#
# bjnp-timeout=5000
# Specify the timeout (in ms) to be used for all the folllowing
# scanners.
# May be specified multiple times.
# The last value (if any) will be used for auto-detection
#
# define URI's of scanners (one per line)
# This is only used for network scanners.
# normally scanners will be detected by sending a broadcast
# if this does not work under your OS, or if the scanners
# are on a different subnet, configure your scanners URI here
#
# method must be bjnp
# port number can normally be left out, port 8612 is used as default
# The timeout parameter sets a timeout value for the scanner on
# the same line
# Example:
# bjnp://myscanner.my.domain:8612 // uses the default 1000ms timeout
# bjnp-timeout=5000
# bjnp://printer-1.pheasant.org // will use the 5000 ms timeout
# bjnp://scanner.bad-network.org/timeout=1500 // timeout set to 1500 ms
# bjnp-timeout=3000 // will be used for auto-detected scanners
bjnp-timeout=3000


Is something missing?
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1773
Location: United Kingdom

PostPosted: Fri Oct 04, 2019 3:03 am    Post subject: Reply with quote

If the MFP is only connected via USB, no, nothing is missing. The bjnp entries are for a network connection, so, if your MFP is only connected via USB then they do not apply:

Code:
$ grep -v ^# /etc/sane.d/pixma.conf
bjnp-timeout=5000
bjnp://192.168.1.78

Code:
$ eix -I bjnp
[I] net-print/cups-bjnp
     Available versions:  ~1.1 ~1.2.1 2.0
     Installed versions:  2.0(04:26:04 20/06/19)
     Homepage:            https://sourceforge.net/projects/cups-bjnp/
     Description:         CUPS backend for the canon printers using the proprietary USB over IP BJNP protocol

Code:
$ scanimage -L
device `pixma:MP560_192.168.1.78' is a CANON Canon PIXMA MP560 multi-function peripheral
device `pixma:04A9173E_1653C4' is a CANON Canon PIXMA MP560 multi-function peripheral

Code:
$ sane-find-scanner -q
could not fetch string descriptor: Pipe error
could not fetch string descriptor: Pipe error
found USB scanner (vendor=0x04a9 [Canon], product=0x173e [MP560 series]) at libusb:003:009

Code:
$ ls -la /etc/modprobe.d/usb-storage.conf
-rw-r--r-- 1 root root 39 Jul 24  2015 /etc/modprobe.d/usb-storage.conf
$ cat /etc/modprobe.d/usb-storage.conf
options usb-storage quirks=04a9:173e:i

So you should need:
Code:
options usb-storage quirks=04a9:183b:i


Code:
$ ls -la /etc/udev/rules.d/95-libsane.rules
-rw-r--r-- 1 root root 122 Jul 29  2015 /etc/udev/rules.d/95-libsane.rules
$ cat /etc/udev/rules.d/95-libsane.rules
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173e", MODE="0666", OWNER="fitzcarraldo", GROUP="scanner", ENV{libsane_matched}="yes"

So you should need:
Code:
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="183b", MODE="0666", OWNER="hot", GROUP="scanner", ENV{libsane_matched}="yes"


Code:
$ grep -B1 "04a9.*173e" /lib/udev/rules.d/*
/lib/udev/rules.d/41-libsane.rules-# Canon PIXMA MP560
/lib/udev/rules.d/41-libsane.rules:ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173e", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

Code:
$ grep -B1 "04a9.*183b" /lib/udev/rules.d/*
$

So you need to create in /lib/udev/rules.d/41-libsane.rules the following new rule:
Code:
# Canon G3110
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="183b", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"


Code:
$ cat /etc/udev/rules.d/99-canon-mp560.rules
# ACL settings for Canon PIXMA MP560 printer MFP
ATTR{idVendor}=="04a9", ATTR{idProduct}=="173e", GOTO="canon"
GOTO="canon_end"
 
LABEL="canon"
RUN+="/bin/setfacl -m g:scanner:rw -m g:lp:rw $env{DEVNAME}"
TEST=="/var/run/ConsoleKit/database", \
        RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}"
 
LABEL="canon_end"

Delete 99-canon-mp560.rules because you don't have a Canon MP560. So you will need a file /etc/udev/rules.d/99-canon-g3110.rules with:
Code:
# ACL settings for Canon G3110 printer MFP
ATTR{idVendor}=="04a9", ATTR{idProduct}=="183b", GOTO="canon"
GOTO="canon_end"
 
LABEL="canon"
RUN+="/bin/setfacl -m g:scanner:rw -m g:lp:rw $env{DEVNAME}"
TEST=="/var/run/ConsoleKit/database", \
        RUN+="udev-acl --action=$env{ACTION} --device=$env{DEVNAME}"
 
LABEL="canon_end"


EDIT: Above assumes you are using ConsoleKit. Are you using ConsoleKit or elogind or systemd?

EDIT2: It also appears that udev-acl is not included in eudev nor systemd, so a new udev rule is needed. Mind you, my scanner works anyway these days, and I'm using eudev and elogind. Still, it would be nice to know if that rule can either be updated or dropped entirely. I'll see if I can find out.

Code:
$ ls -la /dev/bus/usb/001
total 0
drwxr-xr-x 2 root root     80 Oct  3 22:13 .
drwxr-xr-x 6 root root    120 Oct  3 22:13 ..
crw-rw-r-- 1 root usb  189, 0 Oct  4 04:05 001
crw-rw-r-- 1 root usb  189, 1 Oct  3 22:14 002

Code:
$ users
fitzcarraldo fitzcarraldo fitzcarraldo

Code:
$ grep USB_STORAGE /usr/src/linux/.config | grep -v ^#
CONFIG_USB_STORAGE=m
$ lsmod | grep usb_storage
usb_storage            61440  0


Compare set/not-set USE flags with mine:
Code:
$ eix -I sane
[I] dev-perl/Image-Sane
     Available versions:  0.140.0 {examples test}
     Installed versions:  0.140.0(00:43:46 20/06/19)(-examples -test)
     Homepage:            https://metacpan.org/release/Image-Sane
     Description:         Access SANE-compatible scanners from Perl

[I] kde-apps/libksane
     Available versions:  (5) 19.04.3 ~19.08.1
       {debug kwallet}
     Installed versions:  19.04.3(5)(02:37:40 02/08/19)(kwallet -debug)
     Homepage:            https://kde.org/
     Description:         SANE Library interface based on KDE Frameworks

[I] media-gfx/sane-backends
     Available versions:  1.0.27-r3 {gphoto2 ipv6 snmp systemd threads usb v4l xinetd zeroconf ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32" SANE_BACKENDS="+abaton +agfafocus +apple +artec +artec_eplus48u +as6e +avision +bh +canon +canon630u +canon_dr -canon_pp +cardscan +coolscan +coolscan2 +coolscan3 +dc210 +dc240 +dc25 +dell1600n_net +dmc +epjitsu +epson +epson2 +fujitsu +genesys +gt68xx +hp +hp3500 +hp3900 +hp4200 +hp5400 +hp5590 +hpljm1005 -hpsj5s +hs2p +ibm +kodak +kodakaio +kvs1025 +kvs20xx kvs40xx +leo +lexmark +ma1509 +magicolor +matsushita +microtek +microtek2 +mustek -mustek_pp +mustek_usb mustek_usb2 +nec +net +niash +p5 +pie +pixma +plustek +plustek_pp -pnm +qcam +ricoh +rts8891 +s9036 +sceptre +sharp +sm3600 +sm3840 +snapscan +sp15c +st400 +stv680 +tamarack +teco1 +teco2 +teco3 +test +u12 +umax +umax1220u +umax_pp +xerox_mfp"}
     Installed versions:  1.0.27-r3(00:43:15 20/06/19)(gphoto2 ipv6 usb v4l zeroconf -snmp -systemd -threads -xinetd ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="32 64 -x32" SANE_BACKENDS="abaton agfafocus apple artec artec_eplus48u as6e avision bh canon canon630u canon_dr cardscan coolscan coolscan2 coolscan3 dc210 dc240 dc25 dell1600n_net dmc epjitsu epson epson2 fujitsu genesys gt68xx hp hp3500 hp3900 hp4200 hp5400 hp5590 hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx leo lexmark ma1509 magicolor matsushita microtek microtek2 mustek mustek_usb nec net niash p5 pie pixma plustek plustek_pp qcam ricoh rts8891 s9036 sceptre sharp sm3600 sm3840 snapscan sp15c st400 stv680 tamarack teco1 teco2 teco3 test u12 umax umax1220u umax_pp xerox_mfp -canon_pp -hpsj5s -kvs40xx -mustek_pp -mustek_usb2 -pnm")
     Homepage:            http://www.sane-project.org/
     Description:         Scanner Access Now Easy - Backends

[I] media-gfx/sane-frontends
     Available versions:  1.0.14-r3 ~1.0.14-r4 {gimp gtk}
     Installed versions:  1.0.14-r3(00:44:14 20/06/19)(gimp gtk)
     Homepage:            http://www.sane-project.org
     Description:         Scanner Access Now Easy

[I] media-gfx/xsane
     Available versions:  0.999-r2 {gimp jpeg lcms nls ocr png tiff}
     Installed versions:  0.999-r2(00:44:23 20/06/19)(gimp jpeg lcms nls png tiff -ocr)
     Homepage:            http://www.xsane.org/
     Description:         graphical scanning frontend

Found 5 matches

_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1773
Location: United Kingdom

PostPosted: Sat Oct 05, 2019 10:04 am    Post subject: Reply with quote

Any luck?

If you are still not having any success, here's another idea:

1. Delete the rules files /etc/udev/rules.d/99-canon-g3110.rules and /etc/udev/rules.d/99-canon-mp560.rules that you created. See https://enotty.pipebreaker.pl/2012/05/23/linux-automatic-user-acl-management/ for the new method of setting ACLs.

2. Edit the rules file /lib/udev/rules.d/95-libsane.rules that you created so that it only contains the following:

Code:
# Canon G3110
ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="183b", MODE="0666", OWNER="hot", GROUP="scanner", ENV{libsane_matched}="yes" TAG+="uaccess"


Notice the addition of TAG+="uaccess" in the rule, which appears to be a new method, to avoid users having to set the ACL themselves like I did in the past. See https://enotty.pipebreaker.pl/2012/05/23/linux-automatic-user-acl-management/

However, I'm not sure of the naming of the rules file that should contain the TAG+="uaccess" entry. See https://github.com/OpenCBM/OpenCBM/pull/8 which seems to indicate it has to come before 70-uaccess.rules or 73-seat-late.rules
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Sat Oct 05, 2019 8:49 pm    Post subject: Reply with quote

I use Consolekit and eudev.

The permission was buried correctly.
Code:

tux /home/hot # ls -la /dev/bus/usb/003
total 0
drwxr-xr-x  2 root root         120 out  5 17:20 .
drwxr-xr-x  6 root root         120 out  5 17:19 ..
crw-rw-r--  1 root usb     189, 256 out  5 17:29 001
crw-rw-rw-+ 1 hot  scanner 189, 257 out  5 17:29 002
crw-rw-r--  1 root usb     189, 258 out  5 17:29 003
crw-rw-r--  1 root usb     189, 259 out  5 17:29 004


I believe there is something wrong with usb storage, because the module has not been loaded.
Code:

tux /home/hot # grep USB_STORAGE /usr/src/linux/.config | grep -v ^#
CONFIG_USB_STORAGE=m

Code:

tux /home/hot # lsmod | grep usb_storage
tux /home/hot #

Code:

tux /home/hot # lsmod
Module                  Size  Used by
nvidia_drm             40960  1
usblp                  20480  0
nvidia_modeset       1015808  40 nvidia_drm
nvidia              14200832  1394 nvidia_modeset
x86_pkg_temp_thermal    16384  0
efivarfs               16384  1


The flags conform to your.

Could the rule created in /lib/udev/rules.d/41-libsane.rules for MFP 183b be the reason for not detecting? For in your case she already existed. I tried to configure to use the scanner over network and got the same error, only being able to use the printer.

Now I will follow the new guidelines.
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Sat Oct 05, 2019 8:59 pm    Post subject: Reply with quote

Fitzcarraldo wrote:
2. Edit the rules file /lib/udev/rules.d/95-libsane.rules that you created so that it only contains the following:


Is this the /etc/udev/rules.d/95-libsane.rules file?
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Sat Oct 05, 2019 10:30 pm    Post subject: Reply with quote

I made the changes according to orientation and the MFP scanner has not yet been detected.

Regarding the order of the ACLs, I changed the file name to 69-libsane.rules. But it didn't work either. However, I did not quite understand the references to ACLs.

Will it be easier to configure the MFP scanner by network?

Thank.
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1773
Location: United Kingdom

PostPosted: Sat Oct 05, 2019 11:11 pm    Post subject: Reply with quote

nubiocicarini wrote:
Fitzcarraldo wrote:
2. Edit the rules file /lib/udev/rules.d/95-libsane.rules that you created so that it only contains the following:


Is this the /etc/udev/rules.d/95-libsane.rules file?

Yes. Sorry, I meant /etc/udev/rules.d/95-libsane.rules, not /lib/udev/rules.d/95-libsane.rules.

nubiocicarini wrote:
Will it be easier to configure the MFP scanner by network?

No, I doubt it. I don't think it would alter the basic problem you're having.

EDIT: I've just noticed you wrote the following in an earlier post:

nubiocicarini wrote:
My printer has the following ID:

Code:
Bus 003 Device 002: ID 04a9: 183b Canon, Inc.

Notice it is Bus 003 and Device 002 in your case. So you should be using the following command to see the permissions and ownership of the device:

Code:
# ls -la /dev/bus/usb/003

What does that command return?

Also, what does the 'get file access control lists' command return for the device?:

Code:
# getfacl /dev/bus/usb/003/002

_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog


Last edited by Fitzcarraldo on Sat Oct 05, 2019 11:29 pm; edited 2 times in total
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Sat Oct 05, 2019 11:24 pm    Post subject: Reply with quote

Do I need to reboot every time I change a rule in eudev?
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1773
Location: United Kingdom

PostPosted: Sat Oct 05, 2019 11:27 pm    Post subject: Reply with quote

nubiocicarini wrote:
Do I need to reboot every time I change a rule in eudev?

Yes, or the following instead:

Code:
# udevadm control --reload-rules && udevadm trigger


P.S. Please see the extra comments I added to my previous post since you posted.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Sat Oct 05, 2019 11:34 pm    Post subject: Reply with quote

Code:
tux /home/hot # lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 1a2c:0c23 China Resource Semico Co., Ltd
Bus 003 Device 005: ID 04a9:183b Canon, Inc.
Bus 003 Device 004: ID 1a2c:0043 China Resource Semico Co., Ltd
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Code:
tux /home/hot # ls -la /dev/bus/usb/003
total 0
drwxr-xr-x  2 root root         120 out  5 20:30 .
drwxr-xr-x  6 root root         120 out  5 19:52 ..
crw-rw----  1 root usb     189, 256 out  5 20:34 001
crw-rw----  1 root usb     189, 258 out  5 20:34 003
crw-rw----  1 root usb     189, 259 out  5 20:34 004
crw-rw-rw-+ 1 hot  scanner 189, 260 out  5 20:34 005

Code:
tux /home/hot # getfacl /dev/bus/usb/003/005
getfacl: Removing leading '/' from absolute path names
# file: dev/bus/usb/003/005
# owner: hot
# group: scanner
user::rw-
user:hot:rw-
group::rw-
mask::rw-
other::rw-

_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1773
Location: United Kingdom

PostPosted: Sun Oct 06, 2019 3:08 am    Post subject: Reply with quote

If you look at my outputs, it looks like your Gentoo installation and mine are configured the same way:

Code:
# lsusb | grep Canon
Bus 003 Device 009: ID 04a9:173e Canon, Inc. PIXMA MP560

The Vendor ID (04a9) is the same because we both have a Canon MFP (Multi Function Peripheral). My PIXMA MP560 has a Product ID of 173e, whereas your PIXMA G3110 has product ID of 183b. From the above output, my Canon PIXMA MP560 is Device 009 on USB Bus 003, therefore:

Code:
# ls -la /dev/bus/usb/003/009
crw-rw-rw-+ 1 fitzcarraldo scanner 189, 264 Oct  6 01:14 /dev/bus/usb/003/009

Code:
# getfacl /dev/bus/usb/003/009
getfacl: Removing leading '/' from absolute path names
# file: dev/bus/usb/003/009
# owner: fitzcarraldo
# group: scanner
user::rw-
user:fitzcarraldo:rw-
group::rw-
mask::rw-
other::rw-


To summarise my current configuration relating to my Canon PIXMA MP560:

Code:
# cat /etc/modprobe.d/usb-storage.conf
options usb-storage quirks=04a9:173e:i

Code:
# lsmod | grep usb_storage
usb_storage            61440  0

Code:
# grep 173e /lib/udev/rules.d/*
/lib/udev/rules.d/41-libsane.rules:ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173e", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

Code:
# grep 173e /etc/udev/rules.d/*
/etc/udev/rules.d/95-libsane.rules:ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173e", MODE="0666", OWNER="fitzcarraldo", GROUP="scanner", ENV{libsane_matched}="yes"

I have deleted the file /etc/udev/rules.d/99-canon-mp560.rules I created in 2015 because apparently the software has changed since I made my blog post in 2015 and it appears that both systemd (which I do not use in Gentoo) and eudev (which I use in Gentoo) now take care of managing ACLs.

So, as far as I can tell, all you should need is:

Code:
# cat /etc/modprobe.d/usb-storage.conf
options usb-storage quirks=04a9:183b:i

Code:
# lsmod | grep usb_storage
usb_storage            61440  0

^ the numbers in the lsmod output for usb_storage may be different in your case, but the important thing is that the module is loaded.

Code:
# grep 183b /lib/udev/rules.d/*
/lib/udev/rules.d/41-libsane.rules:ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="183b", MODE="0664", GROUP="scanner", ENV{libsane_matched}="yes"

Code:
# grep 183b /etc/udev/rules.d/*
/etc/udev/rules.d/95-libsane.rules:ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="183b", MODE="0666", OWNER="hot", GROUP="scanner", ENV{libsane_matched}="yes"


The list of Canon devices supported by the SANE software is given on the SANE Web site: http://sane-project.org/sane-mfgs.html#Z-CANON

Your Canon PIXMA G3110 is not listed but the 'PIXMA G3010 Series' with the same Product ID (183b) as your G3110 is listed as 'Untested':

Quote:
Model                       Interface    USB id                Status      Comment           Backend           Manpage
PIXMA G3010 Series   USB WiFi      0x04a9/0x183b   Untested   Testers needed!    pixma (0.23.0)   sane-pixma

So perhaps that is the reason you are not having any success, i.e. nothing to do with the configuration in Gentoo (udev rules, etc.).

The only other thing I can think of would be for you to try and install the official Canon scanner driver ScanGear, but this becomes much more complicated (não é mole, não, cara!). It is not in the main Portage tree, but you could try installing it by using a local overlay on your machine (see the Gentoo Wiki for instructions if you do not know how to set up a local overlay). You could create an ebuild for the package media-gfx/scangearmp2 Version 3.60 -- see https://bugs.gentoo.org/663176 to get a copy of the ebuild /usr/local/portage/media-gfx/scangearmp2/scangearmp2-3.50.ebuild and the patch file /usr/local/portage/media-gfx/scangearmp2/files/scangearmp2-3.50-1_fix_crash.patch . HOWEVER, Version 3.50 does not support your product ID (I have looked in the source code file scangearmp2-source-3.50-1.tar.gz, and the ebuild installs a file /lib/udev/rules.d/80-canon_mfp2.rules and a file /usr/lib/bjlib/canon_mfp2.conf, neither of which has the Product ID 183b. However, I searched the Web and I can see that Version 3.60 of ScanGear does mention your product ID:

/lib/udev/rules.d/80-canon_mfp2.rules in ScanGear 3.60 Linux 64-bit:
Code:
# 80-canon_mfp2.rules

ACTION!="add", GOTO="canon_mfp_end"
SUBSYSTEM=="usb_device", GOTO="canon_mfp_start"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="canon_mfp_start"
GOTO="canon_mfp_end"

LABEL="canon_mfp_start"

#MG7500 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="177c", MODE="666"
#MG6600 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="177e", MODE="666"
#MG5600 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="177f", MODE="666"
#MG2900 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1780", MODE="666"
#MB2000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1778", MODE="666"
#MB2300 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1779", MODE="666"
#MB5000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1776", MODE="666"
#MB5300 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1777", MODE="666"
#E460 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1788", MODE="666"

#MX490 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1787", MODE="666"
#E480 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1789", MODE="666"

#MG7700 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="178b", MODE="666"
#MG6900 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="178c", MODE="666"
#MG6800 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="178d", MODE="666"
#MG5700 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="178e", MODE="666"
#MG3600 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="178a", MODE="666"

#G3000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1794", MODE="666"

#TS9000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="179f", MODE="666"
#TS8000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1800", MODE="666"
#TS6000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1801", MODE="666"
#TS5000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1802", MODE="666"
#MG3000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="180b", MODE="666"
#E470 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="180c", MODE="666"
#G4000 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="181d", MODE="666"

#MB2100 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1793", MODE="666"
#MB2700 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1792", MODE="666"
#MB5100 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1790", MODE="666"
#MB5400 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="178f", MODE="666"

#TS9100 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1820", MODE="666"
#TS8100 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1821", MODE="666"
#TS6100 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1822", MODE="666"
#TR8500 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1823", MODE="666"
#TR7500 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1824", MODE="666"
#TS5100 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1825", MODE="666"
#TS3100 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1827", MODE="666"
#E3100 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1828", MODE="666"
#TS9180 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="183e", MODE="666"
#TS8180 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="183f", MODE="666"
#TS6180 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1840", MODE="666"
#TR8580 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1841", MODE="666"
#TS8130 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1842", MODE="666"
#TS6130 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1843", MODE="666"
#TR8530 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1844", MODE="666"
#TR7530 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1845", MODE="666"
#XK50 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1846", MODE="666"
#XK70 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="1847", MODE="666"

#G3010 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="183b", MODE="666"
#G4010 series
ATTR{idVendor}=="04a9", ATTR{idProduct}=="183d", MODE="666"


LABEL="canon_mfp_end"

/usr/lib/bjlib/canon_mfp2.conf in scanGear Version 3.60 Linux 64-bit:
Code:
#
# Canon MFP conf file
#

#---- V360 --------------------------
[G3010 series] 0x183B 0x0151
[G4010 series] 0x183D 0x0153

#---- V350 --------------------------
[TS9100 series] 0x1820 0x0151
[TS8100 series] 0x1821 0x0151
[TS6100 series] 0x1822 0x0151
[TR8500 series] 0x1823 0x0153
[TR7500 series] 0x1824 0x0153
[TS5100 series] 0x1825 0x0151
[TS3100 series] 0x1827 0x0151
[E3100 series] 0x1828 0x0151
[TS9180 series] 0x183E 0x0151
[TS8180 series] 0x183F 0x0151
[TS6180 series] 0x1840 0x0151
[TR8580 series] 0x1841 0x0153
[TS8130 series] 0x1842 0x0151
[TS6130 series] 0x1843 0x0151
[TR8530 series] 0x1844 0x0153
[TR7530 series] 0x1845 0x0153
[XK50 series] 0x1846 0x0151
[XK70 series] 0x1847 0x0151

#---- V340 --------------------------
[TS9000 series] 0x179F 0x0151
[TS8000 series] 0x1800 0x0151
[TS6000 series] 0x1801 0x0151
[TS5000 series] 0x1802 0x0151
[MG3000 series] 0x180B 0x0151
[E470 series] 0x180C 0x0151
[G4000 series] 0x181D 0x0153

[MB2100 series] 0x1793 0x0133
[MB2700 series] 0x1792 0x0133
[MB5100 series] 0x1790 0x0137
[MB5400 series] 0x178F 0x0137

#---- V330 --------------------------
[G3000 series] 0x1794 0x0131

#---- V320 --------------------------
[MG7700 series] 0x178B 0x0131
[MG6900 series] 0x178C 0x0131
[MG6800 series] 0x178D 0x0131
[MG5700 series] 0x178E 0x0131
[MG3600 series] 0x178A 0x0131

#---- V310 --------------------------
[MX490 series] 0x1787 0x0133
[E480 series] 0x1789 0x0133

#---- V300 --------------------------
[MG7500 series] 0x177C 0x0131
[MG6600 series] 0x177E 0x0131
[MG5600 series] 0x177F 0x0131
[MG2900 series] 0x1780 0x0131
[MB2000 series] 0x1778 0x0133
[MB2300 series] 0x1779 0x0133
[MB5000 series] 0x1776 0x0133
[MB5300 series] 0x1777 0x0137
[E460 series] 0x1788 0x0131

So you could try renaming scangearmp2-3.50.ebuild to scangearmp2-3.60.ebuild, renaming /usr/local/portage/media-gfx/scangearmp2/files/scangearmp2-3.50-1_fix_crash.patch to /usr/local/portage/media-gfx/scangearmp2/files/scangearmp2-3.60-1_fix_crash.patch, and editing both those files to change any reference to '3.50' to '3.60', and hope that the patch is still applicable to ScanGear Version 3.60. Then try merging scangearmp2. If you are using Gentoo Stable Branch then you will also need to unmask the package by keyword in order to be able to merge it:

Code:
# cat /etc/portage/package.accept_keywords/scangearmp2
=media-gfx/scangearmp2-3.50 ~amd64


I do not know if this will work, or, if it does, whether the installed media-gfx/scangearmp2-3.60 would then recognise your G3110 MFP, but I cannot think what else to try. From my Web searches, the model G3110 is only sold in South America, and Canon's Brazilian Web site does not have any Linux drivers for that model.


EDIT: OK, Version 3.60 of ScanGear can be installed using the steps I gave above. However, the source URL for V3.60 in the ebuild is incorrect and I cannot find the correct URL, so I had to download the package manually by clicking on the Download button on the Canon Web page https://asia.canon/en/support/0100949301/1 and then I copied the file to the distfiles directory:

Code:
# cp /home/fitzcarraldo/Downloads/scangearmp2-source-3.60-1.tar.gz /usr/portage/distfiles/

Then it is possible to merge the package via the local overlay:

Code:
# cd /usr/local/portage/media-gfx/scangearmp2/
# cp scangearmp2-3.50.ebuild scangearmp2-3.60.ebuild
# nano scangearmp2-3.60.ebuild
# cp files/scangearmp2-3.50-1_fix_crash.patch files/scangearmp2-3.60-1_fix_crash.patch
# nano files/scangearmp2-3.60-1_fix_crash.patch
# echo "=media-gfx/scangearmp2-3.60 ~amd64" >> /etc/portage/package.accept_keywords/scangearmp2
# ebuild scangearmp2-3.60.ebuild manifest
# emerge scangearmp2
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) media-gfx/scangearmp2-3.60::local_overlay
>>> Installing (1 of 1) media-gfx/scangearmp2-3.60::local_overlay
>>> Jobs: 1 of 1 complete                           Load avg: 1.49, 0.59, 0.40
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.


Code:
# eix-update
# eix -I scangearmp2
[I] media-gfx/scangearmp2 [1]
     Available versions:  (~)3.50 (~)3.60
     Installed versions:  3.60(05:05:34 06/10/19)
     Homepage:            https://www.canon.com
     Description:         Driver and utility package for Canon scanners

[1] "local_overlay" /usr/local/portage


Code:
# grep -i 183b /lib/udev/rules.d/*
/lib/udev/rules.d/80-canon_mfp2.rules:ATTR{idVendor}=="04a9", ATTR{idProduct}=="183b", MODE="666"
# grep -i 183b /usr/lib/bjlib/canon_mfp2.conf
[G3010 series] 0x183B 0x0151


I do not have any of those models of Canon printer to try with this ScanGear driver, so do not know if it actually works.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1773
Location: United Kingdom

PostPosted: Sun Oct 06, 2019 5:15 am    Post subject: Reply with quote

I found the URL of ScanGear V3.60: http://gdlp01.c-wss.com/gds/3/0100009493/01/scangearmp2-source-3.60-1.tar.gz

So /usr/local/portage/media-gfx/scangearmp2/scangearmp2-3.60.ebuild looks like this:

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

EAPI=6

inherit autotools

MY_P="${PN}-source-${PV}-1"

DESCRIPTION="Driver and utility package for Canon scanners"
HOMEPAGE="https://www.canon.com"
SRC_URI="http://gdlp01.c-wss.com/gds/3/0100009493/01/${MY_P}.tar.gz"

LICENSE="Canon-IJ"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND=">=x11-libs/gtk+-2.16:2
virtual/libusb:1"
RDEPEND="${DEPEND}"

S="${WORKDIR}/${MY_P}/${PN}"

src_prepare()
{
        sed -i -e '/^CFLAGS/d' configure.in || die
        sed -i -e '/AC_INIT/s/in/ac/' configure.in || die
        mv configure.{in,ac} || die

        eapply -p2 ${FILESDIR}/scangearmp2-3.60-1_fix_crash.patch
        eapply_user

        eautoreconf
}

src_compile()
{
        SHIPPED_LIBS="${WORKDIR}/${MY_P}/com/libs_bin$(usex amd64 64 32)"
        emake LDFLAGS="-L${SHIPPED_LIBS}"
}

src_install()
{
        SHIPPED_LIBS="${WORKDIR}/${MY_P}/com/libs_bin$(usex amd64 64 32)"

        dodir /usr/lib/bjlib
        dodir /lib/udev/rules.d

        dolib.so "${SHIPPED_LIBS}/"*.so*
        insinto /usr/lib/bjlib
        doins "${WORKDIR}/${MY_P}/com/ini/canon_mfp2_net.ini"

        insinto /lib/udev/rules.d
        doins "${S}/etc/"*.rules

        emake DESTDIR="${D}" install
}

_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Nreal
Apprentice
Apprentice


Joined: 06 Jan 2009
Posts: 168

PostPosted: Sun Oct 06, 2019 10:54 am    Post subject: Reply with quote

Canon sucks in linux - use HP.
Back to top
View user's profile Send private message
nubiocicarini
n00b
n00b


Joined: 20 Feb 2019
Posts: 51
Location: Brazil

PostPosted: Mon Oct 07, 2019 2:50 am    Post subject: Reply with quote

Fitzcarraldo,

I followed his latest guidelines compiling scangearmp2 3.60 and the scanner worked PERFECTLY. I am very happy! :)

I don't know what the best reaction should be to the tremendous work this process has given you. For now, I'm sure this topic will help gentoo users here in Brazil, as this printer is being sold in major supply stores. In addition, I will make myself available to the sane community to test the opensource pixma drive for this device. This proprietary program is very obsolete with opensource alternatives such as sane + skanlite. Finally, this ebuild should be available in some overlays repository. The only one found is already very obsolete (scangearmp 1.30).

Gratitude.
_________________
Workers of the world, unite!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum