On Lenovo v145 15AST Ubuntu 20.04 with Logitech Bluetooth mouse, I created script
/lib/systemd/system-sleep/KickPebbleMouse.sh
Which uses rfkill
#!/bin/sh
# put this in /lib/systemd/system-sleep/
# kick the bluetooth because mouse is doesn't work after suspend.
case $1 in
post)
sleep 1
btid=`rfkill --output ID,DEVICE| grep hci | sed -n -E 's/^ //;1p' | cut -d" " -f1`
rfkill block ${btid}
sleep 2
rfkill unblock ${btid}
;;
esac
edit1: ---
Added sed into pipline to remove leading space when ID's are less than 2 digits (ie <10)
edit2: ---
Since the upgrade of the kernel (which I installed 11-Nov-2020) also included an update of the firmware, this solved the Stuck mouse after suspend problem, But I still can't use the wifi that is builtin to the same chip. [rtl8821ce]
See the Kernel and Firmware version change below.
Previous kernel boot:
$ journalctl -b -3 |grep -i -e "Linux version \| bluetooth.* version"
Nov 04 10:24:52 lenou2004 kernel: Linux version 5.4.0-52-generic (buildd@lgw01-amd64-060) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 (Ubuntu 5.4.0-52.57-generic 5.4.65)
Nov 04 10:24:53 lenou2004 kernel: Bluetooth: hci0: RTL: rom_version status=0 version=1
Nov 04 10:24:54 lenou2004 kernel: Bluetooth: hci0: RTL: fw version 0x826ca99e
Newer kernel boot:
$ journalctl -b -2 |grep -i -e "Linux version \| bluetooth.* version"
Nov 11 11:38:06 lenou2004 kernel: Linux version 5.4.0-53-generic (buildd@lcy01-amd64-007) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 (Ubuntu 5.4.0-53.59-generic 5.4.65)
Nov 11 11:38:08 lenou2004 kernel: Bluetooth: hci0: RTL: rom_version status=0 version=1
Nov 11 11:38:08 lenou2004 kernel: Bluetooth: hci0: RTL: fw version 0x829a21e4
Nov 11 11:44:32 lenou2004 kernel: Bluetooth: hci0: RTL: rom_version status=0 version=1
Nov 11 11:44:32 lenou2004 kernel: Bluetooth: hci0: RTL: fw version 0x829a21e4
edit3 ---
The original problem has returned, I haven't kept track when it first occurred. Current Kernel/firmware:
journalctl -b |grep -i -e "Linux version \| bluetooth.* version"
Dec 12 11:36:25 lenou2004 kernel: Linux version 5.4.0-58-generic (buildd@lcy01-amd64-004) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 (Ubuntu 5.4.0-58.64-generic 5.4.73)
Dec 12 11:36:27 lenou2004 kernel: Bluetooth: hci0: RTL: rom_version status=0 version=1
Dec 12 11:36:27 lenou2004 kernel: Bluetooth: hci0: RTL: fw version 0x829a21e4