Bluetooth keyboard keeps connecting and disconnecting after rebooting

I am jusing Manjaro XFCE version.

My bluetooth keyboard when my computer is rebooted will keep saying connected and disconnecting. In order to connect back, i have to set my keyboard to pairing mode then connect.

They keyboard that I am using is the Keychron K8

I have set AutoEnable to true in /etc/bluetooth/main.conf as well.

System:
  Kernel: 5.15.28-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.15-x86_64
    root=UUID=77ae071f-effa-4023-b31c-07018b3e6b24 rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: Xfce v: 4.16.0 tk: Gtk v: 3.24.29 info: xfce4-panel wm: xfwm
    v: 4.16.1 vt: 7 dm: LightDM v: 1.30.0 Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
  Mobo: ASUSTeK model: PRIME B560M-A v: Rev 1.xx
    serial: <superuser required> UEFI: American Megatrends v: 0820
    date: 04/27/2021
Battery:
  Device-1: hid-dc:2c:26:0f:7f:62-battery model: Keychron K8 serial: N/A
    charge: N/A status: discharging
  Device-2: hidpp_battery_0 model: Logitech Wireless Gaming Mouse
    serial: <filter> charge: 55% (should be ignored) rechargeable: yes
    status: discharging
  Device-3: hidpp_battery_1 model: Logitech Wireless Solar Keyboard K750
    serial: <filter> charge: 55% rechargeable: yes status: charging
Memory:
  RAM: total: 15.48 GiB used: 2.17 GiB (14.0%)
  RAM Report:
    permissions: Unable to run dmidecode. Root privileges required.
CPU:
  Info: model: Intel Core i3-10320 bits: 64 type: MT MCP arch: Comet Lake
    family: 6 model-id: 0xA5 (165) stepping: 3 microcode: 0xEC
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 800 min/max: 800/4600 scaling: driver: intel_pstate
    governor: powersave cores: 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800
    8: 800 bogomips: 60819
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush clflushopt
    cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts
    epb erms est f16c flush_l1d fma fpu fsgsbase fxsr ht hwp hwp_act_window
    hwp_epp hwp_notify ibpb ibrs ibrs_enhanced ida intel_pt invpcid
    invpcid_single lahf_lm lm mca mce md_clear mmx monitor movbe mpx msr mtrr
    nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln
    pni popcnt pse pse36 pts rdrand rdseed rdtscp rep_good sdbg sep smap smep
    ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tsc tsc_adjust
    tsc_deadline_timer vme x2apic xgetbv1 xsave xsavec xsaveopt xsaves
    xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX unsupported
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 status: Vulnerable: eIBRS with unprivileged eBPF
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GM206 [GeForce GTX 960] vendor: eVga.com. driver: nvidia
    v: 510.54 alternate: nouveau,nvidia_drm pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 01:00.0 chip-ID: 10de:1401 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.3 compositor: xfwm v: 4.16.1 driver:
    X: loaded: nvidia gpu: nvidia display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 4224x1280 s-dpi: 96 s-size: 1118x339mm (44.02x13.35")
    s-diag: 1168mm (45.99")
  Monitor-1: DP-0 pos: primary,top-left res: 1024x1280 hz: 60 dpi: 87
    size: 299x374mm (11.77x14.72") diag: 479mm (18.85") modes: N/A
  Monitor-2: DP-4 pos: bottom-r res: 1280x1024 hz: 60 dpi: 87
    size: 374x299mm (14.72x11.77") diag: 479mm (18.85") modes: N/A
  Monitor-3: HDMI-0 pos: primary,middle-c res: 1920x1080 hz: 60 dpi: 82
    size: 598x336mm (23.54x13.23") diag: 686mm (27.01") modes: N/A
  Message: Unable to show GL data. Required tool glxinfo missing.
Audio:
  Device-1: Intel vendor: ASUSTeK driver: snd_hda_intel v: kernel
    bus-ID: 00:1f.3 chip-ID: 8086:f0c8 class-ID: 0403
  Device-2: NVIDIA GM206 High Definition Audio vendor: eVga.com.
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:0fba class-ID: 0403
  Sound Server-1: ALSA v: k5.15.28-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.20 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.48 running: yes
Network:
  Device-1: Intel Ethernet I219-V vendor: ASUSTeK driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15fa class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Intel Wireless 7265 driver: iwlwifi v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:095a class-ID: 0280
  IF: wlp3s0 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: dynamic noprefixroute scope: global
  IP v6: <filter> type: dynamic noprefixroute scope: global
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8
    bus-ID: 1-8:2 chip-ID: 8087:0a2a class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 3 state: up address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 931.52 GiB used: 75.12 GiB (8.1%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital
    model: WDS500G3X0C-00SJG0 size: 465.76 GiB block-size: physical: 4096 B
    logical: 4096 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 111110WD temp: 57.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Western Digital
    model: WDS500G2B0A-00SM50 size: 465.76 GiB block-size: physical: 512 B
    logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 20WD
    scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 465.46 GiB size: 457.08 GiB (98.20%)
    used: 75.12 GiB (16.4%) fs: ext4 dev: /dev/nvme0n1p2 maj-min: 259:2
    label: N/A uuid: 77ae071f-effa-4023-b31c-07018b3e6b24
  ID-2: /boot/efi raw-size: 300 MiB size: 299.3 MiB (99.76%)
    used: 288 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
    label: NO_LABEL uuid: 3249-E8A4
Swap:
  Alert: No swap data was found.
Unmounted:
  ID-1: /dev/sda1 maj-min: 8:1 size: 465.76 GiB fs: ext4 label: N/A
    uuid: f77e80f4-d1fd-4755-a619-64de540f4260
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 16 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-8:2 info: Intel Bluetooth wireless interface type: Bluetooth
    driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 100mA
    chip-ID: 8087:0a2a class-ID: e001
  Hub-2: 1-10:3 info: Genesys Logic Hub ports: 4 rev: 2.0 speed: 480 Mb/s
    power: 100mA chip-ID: 05e3:0610 class-ID: 0900
  Device-1: 1-10.3:5 info: Logitech Unifying Receiver
    type: Keyboard,Mouse,HID driver: logitech-djreceiver,usbhid interfaces: 3
    rev: 2.0 speed: 12 Mb/s power: 98mA chip-ID: 046d:c52b class-ID: 0300
  Device-2: 1-10.4:6 info: Logitech Cordless Mouse Receiver type: Mouse,HID
    driver: logitech-djreceiver,usbhid interfaces: 2 rev: 2.0 speed: 12 Mb/s
    power: 98mA chip-ID: 046d:c537 class-ID: 0300
  Device-3: 1-11:4 info: ASUSTek AURA LED Controller type: HID
    driver: hid-generic,usbhid interfaces: 2 rev: 2.0 speed: 12 Mb/s power: 16mA
    chip-ID: 0b05:19af class-ID: 0300 serial: <filter>
  Hub-3: 2-0:1 info: Super-speed hub ports: 6 rev: 3.1 speed: 20 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 27.8 C mobo: N/A gpu: nvidia temp: 60 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 6%
Info:
  Processes: 259 Uptime: 4h 23m wakeups: 80 Init: systemd v: 250
  tool: systemctl Compilers: gcc: 11.2.0 clang: 13.0.1 Packages: pacman: 1210
  lib: 328 flatpak: 0 Shell: Bash v: 5.1.16 running-in: xfce4-terminal
  inxi: 3.3.14

on a fresh boot when ever i try to enter a key on the bluetooth keyboard i just get a connected prompt followed by a disconnected prompt, nothing registers.

I have to open bluetooth manager and set the keyboard to pairing mode then connect it.

Either disable power management on the bluetooth device wiha TLP, or remove tlp package all together and see if the issue persists.

It seems that Keychron firmware needs to have very specific sequence of actions in order for bluetooth to work. This is how it should be in the exact order:

  1. Remove the keyboard from known bluetooth devices if it’s there.
  2. Hold Fn+[1-3] to start pairing with the keyboard
  3. In blueman-manager press “Search” (or type scan on in bluetoothctl)
  4. DO NOT CONNECT THE DEVICE, pair it instead. Right click on device in blueman-manager and select “Pair” (or type pair <mac> in bluetoothctl)
  5. Pairing takes a couple of seconds after which keyboard disconnects. Wait until it fully disconnects
  6. Now, connect the keyboard. Double click it in blueman-manager (or connect <mac> in bluetoothctl)
  7. After keyboard is connected, make it “trusted”. Right click the device in blueman-manager and select “Trusted” (or trust <mac> in bluetoothctl)
4 Likes

This works but for some reason blueman kills the bluetooth signal when the screen is locked, keyboard disconnected, or system goes to sleep. But once you turn it back on the keyboard connects automatically. I can live with that! Thanks!