Bluetooth, how to wake up a smartphone from my PC?

If my smartphone is sleeping, every Bluetooth connection from the PC fails.

How to wake up the smartphone before connecting to it ?

I imagine a login script with some commands or something else.

thanks

Did you tried KDE Connect?

I need a bluetooth connection.

Look at the Bluetooth MAC address on the phone, then do l2ping <mac_address> to see if that will wake up the connection.

For example, as root user;

bluetoothctl devices
Device 2C:54:5F:D0:69:76 ILO

l2ping 2C:54:5F:D0:69:76

Ping: 2C:54:5F:D0:69:76 from 00:1A:7D:DA:71:15 (data size 44) ...
0 bytes from 2C:54:5F:D0:69:76 id 0 time 6.94ms
0 bytes from 2C:54:5F:D0:69:76 id 1 time 6.86ms
0 bytes from 2C:54:5F:D0:69:76 id 2 time 7.85ms
0 bytes from 2C:54:5F:D0:69:76 id 3 time 6.83ms

I found a solution.

I found that attempting a connection to the pan fails but wakes up the smartphone.
It fails because the smartphone access point is disable.

I write a login script :

#!/bin/bash

sleep 60s

nmcli connection up “network_ smartphone_name”

sleep 10s

bluetoothctl connect phone_mac_address

Why 60s ?
Because during the login many apps (6) start. This cause a “bluetoothctl connect” failure.

where to find the name of the bluetooth smartphone network ?
In the network plasma applet.

note : this wakes up only the bluetooth part of the phone, not the kdeconnect part.

I will try your solution.

Thanks

l2ping wakes up bluetooth connectivity.

but in a user script, how do you use such a command ?

@promeneur create a sudoers drop in file called say 01-bluetooth containing;

YOUUSERNAME ALL = NOPASSWD: /usr/bin/l2ping

Then as root user install in /etc/sudoers.d/ directory eg;
install -m0644 01-bluetooth /etc/sudoers.d/01-bluetooth

you will need to add the path to the original file location. Then should work fine with sudo eg;
sudo l2ping <mac_address>

1 Like

Thanks, but i prefer my simpler solution.

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