Score:0

Scanner not working after waking up from sleep mode

gb flag

I use Ubuntu 20.04 LTS and a CANON DR-M160 scanner.

When I first start my notebook an Inspiron 15 5000 series and start the Document Scanner app it finds the scanner and all works fine.

Here is some information

ff@ff:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 8087:0a2a Intel Corp. 
Bus 001 Device 005: ID 1fd2:5001 Melfas LGD AIT Touch Controller
Bus 001 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 0bda:58c2 Realtek Semiconductor Corp. Integrated_Webcam_HD
Bus 001 Device 007: ID 1083:163e Canon Electronics, Inc. DR-M160
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ff@ff:~$ 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 your
  # 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 kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x0bda [Generic], product=0x0129 [USB2.0-CRW]) at libusb:001:004
found USB scanner (vendor=0x1083 [CANON   ], product=0x163e [CANON   DR-M160         ]) at libusb:001:007
  # 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.
ff@ff:~$ scanimage -L
device `canon_dr:libusb:001:007' is a CANON DR-M160 scanner

ff@ff:~$ scanimage -V 
scanimage (sane-backends) 1.0.32; backend version 1.0.32

Everything is fine until the scanner goes to sleep after 10 minutes of inactivity. After that, the scanner tries to wake up from sleep mode but does not work.

Here information after the scanner goes to sleep:

ff@ff:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 8087:0a2a Intel Corp. 
Bus 001 Device 005: ID 1fd2:5001 Melfas LGD AIT Touch Controller
Bus 001 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 0bda:58c2 Realtek Semiconductor Corp. Integrated_Webcam_HD
Bus 001 Device 007: ID 1083:163e Canon Electronics, Inc. DR-M160
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ff@ff:~$ 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 your
  # 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 kernel SCSI driver for your SCSI adapter.

found USB scanner (vendor=0x0bda [Generic], product=0x0129 [USB2.0-CRW]) at libusb:001:004
found USB scanner (vendor=0x1083 [CANON   ], product=0x163e [CANON   DR-M160         ]) at libusb:001:007
  # 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.
ff@ff:~$ 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).

When the scanner goes into sleep mode, the indicator starts blinking.

The indicator lights up when the command scanimage -L is executed, but after finishing scanner is not available.

Already tried the following without any result:

  1. Create and enable rc.local service with next code:
#!/bin/sh -e
chmod -R a+w /dev/bus/usb
exit 0

now I have these rules

crw-rw-rw-  1 root root 189,   0 жов 31 14:08 /dev/bus/usb/001/001
crw-rw-rw-  1 root root 189,   2 жов 31 14:08 /dev/bus/usb/001/003
crw-rw-rw-  1 root root 189,   3 жов 31 14:08 /dev/bus/usb/001/004
crw-rw-rw-  1 root root 189,   4 жов 31 14:08 /dev/bus/usb/001/005
crw-rw-rw-  1 root root 189,   5 жов 31 13:19 /dev/bus/usb/001/006
crwxrwxrwx+ 1 root root 189,   6 жов 31 14:08 /dev/bus/usb/001/007
crw-rw-rw-  1 root root 189, 128 жов 31 14:08 /dev/bus/usb/002/001

  1. Add the following rules to /etc/udev/rules.d/canon_dr-m160.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="1083", MODE="0777"
SUBSYSTEM=="usb_device", ATTRS{idVendor}=="1083", MODE="0777"
ATTRS{manufacturer}=="CANON", DRIVERS=="usb", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1083", ATTRS{idProduct}=="*", MODE="0777"
  1. Tried disable autosuspend usb
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/&usbcore.autosuspend=-1 /' /etc/default/grub
update-grub
systemctl reboot
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/&usbcore.autosuspend_delay_ms=-1 /' /etc/default/grub
update-grub
systemctl reboot
echo Y | sudo tee /sys/module/usbcore/parameters/old_scheme_first
echo Y | sudo tee /sys/module/usbcore/parameters/use_both_schemes

Update 31.10.2022

Was found same issue on sane side

Perhaps the problem is solved by installing a new version of the sane-backends 1.1.1 library.

Not clear how to install the new version of the library on ubuntu 20.04


Update 02.11.2022

I tried from source to build sane-backends 1.1.1 for Ubuntu 20.04. The problem has not been resolved. After that I formated HDD and install Ubuntu 22.04. The sane-backends library installed the latest version automatically, but the result is the same. Scanner still cannot wake up correctly from his sleep mode

I created new issues on Sane backend. Hope this helps solve the problem

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.