tiktaalik-dev / blueproximity

Desktop application to lock/unlock your screen automatically based on detecting how close it's to another Bluetooth device (e.g. your mobile phone).
GNU General Public License v2.0
93 stars 28 forks source link

Application does not measure distance/unable to work properly #16

Closed SpyPower closed 2 years ago

SpyPower commented 2 years ago

Hi,

I am using your updated version since September 2021 on my ubuntu 20.04 and it worked quite good. Now i have switched to fedora 35, and installed the app with version 1.3.3, copied the configuration from the previous installation and the app will not work the same way as on the previous installation.

[sp@spyros-thinkpad ~]$ python --version
Python 3.10.1

The distance bar is not changing, stuck at 255 (max left). Icon is "disconnected".

Steps that I did:

  1. Pair the phone
  2. Open first time the application
  3. Edit the config file with the settings from the previous working OS
  4. restart application

After quite a while of testing, switching channels, testing the scan mode, nothing worked. I even went on the debug mode to see if there was a problem on the python script, but I do not have the time to decypher the code and find the bug.

I will post my config file so you can have a look. I have removed the last 4 characters from my phones mac address.

device_mac = D0:9C:7A:D5:XX:XX
device_channel = 12
lock_distance = 8
lock_duration = 12
unlock_distance = 6
unlock_duration = 3
lock_command = 'xdg-screensaver lock && sleep 1 && xset dpms force off && pb push -d 1 "Screen locked at $(date +%H:%M:%S) on $(date +%d/%m/%Y)"'
unlock_command = pb push -d 1 "Screen unlocked at $(date +%H:%M:%S) on $(date +%m/%d/%Y)" && xdg-screensaver reset && xset dpms force on
proximity_command = xset dpms force on
proximity_interval = 89
buffer_size = 1
log_to_syslog = True
log_syslog_facility = local7
log_to_file = True
log_filelog_filename = /home/sp/blueproximity.log
SpyPower commented 2 years ago

For those that came upon this thread, I fixed it using this guide https://www.daniloaz.com/en/automatically-lock-unlock-your-screen-by-bluetooth-device-proximity/

Fix:

sudo hciconfig hci0 up

where hci0 is my bluetooth interface found by rfkill list.