Logitech Lift mouse wakes up system immediately from sleep (sometimes)

Hi, newbie here and not a technical person.
My Logitech mouse is preventing the system from staying asleep.
The following permanent solution works, sometimes:

  • Create new file: /etc/udev/rules.d/logitech.rules
  • Write the following to file (where 046d is Logitech, c548 is Lift mouse model):
    ACTION==“add”, SUBSYSTEM==“usb”, DRIVERS==“usb”, ATTRS{idVendor}==“046d”, ATTRS{idProduct}==“c548”, ATTR{power/wakeup}=“disabled”
  • Reboot to make it permanent.
    ===
    This used to work, but now it seems up to chance. I actually found out that it works if I put the system to sleep 3 times in a row (as in: sleep => wakes up; sleep => wakes up; sleep => ok).
    I’m excluding other causes because removing the mouse wifi dongle fixes the issue (I can’t help using the dongle for reasons too long to explain here).
    Logs:
    http://ix.io/4CrT
    http://ix.io/4CrV

You can use a simple script to “unplug” the dongle from the command line, such as one of the solutions suggested in this thread:

Add a script to “unplug” the dongle automatically before suspend to /usr/lib/systemd/system-sleep/, and another to “plug” it back in when your system resumes, as described in this article:

https://www.addictivetips.com/ubuntu-linux-tips/run-scripts-and-commands-on-suspend-and-resume-on-linux/

Maybe it’s worth a shot if your current solution is no longer working reliably.

Thank you kindly! This worked. For completeness, here’s the solution:

  • identify the offending port with lsusb and lsusb -t (resulting in something like 1-2.3 for example)
  • create two separate scripts for unbinding and binding the offending port
#!/bin/bash
port="1-2.3" # as shown by lsusb -t: {bus}-{port}(.{subport})
unbind_usb() {
  echo "$1" >/sys/bus/usb/drivers/usb/unbind
}
unbind_usb "$port"
#!/bin/bash
port="1-2.3" # as shown by lsusb -t: {bus}-{port}(.{subport})
bind_usb() {
  echo "$1" >/sys/bus/usb/drivers/usb/bind
}
bind_usb "$port"
  • add a script to /usr/lib/systemd/system-sleep/ to “unplug” and “plug” back in the port at suspend and resume
#!/bin/bash/
if [ "${1}" == "pre" ]; then
sh /path-to-unbind-script
elif [ "${1}" == "post" ]; then
sh /path-to-bind-script
fi

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.