View Single Post
Posts: 97 | Thanked: 318 times | Joined on Feb 2012 @ Switzerland
#499
Regarding the bluetooth wakelock we face with the Nexus5, I can offer you a solution now, that will allow you to use bluetooth the way you used it until now and profit from Bluetooth LowPowerMode, without any interaction form your part.

After some input of the community on irc (#sailfishos-porters), and some discussion with 'mautz', I wrote a script, that should work quiet nicely with all Sailfishos ports, CM11,CM12, or future releases.

The script is a workaround for an existing kernel bug, that also some android users face. So the hope is, that we might not need that workaround some day in the future.

Please do some testing and tell me if it works for you.

Update
As stated by mautz, I forgot to mention that you need the latest kernel with 'bluetooth sleep' enabled.


The script can be downloaded here... <- New Version

Don't forget to...
Code:
chmod +x bt-sleep-monitor.sh
All information is in the script itself...

#title : bt-sleep-monitor.sh
#description : Bluetooth 'LowPowerMode' monitor for SailfishOS ports that face a bluetooth wakelock bug.
#author : minimec
#date : 20170206
#version : 0.3 (2nd release/code cleaned/with logfile for testing)
#usage : ./bash bt-sleep-monitor.sh & (first login to a root console with 'devel-su')
#kill script : devel-su killall bt-sleep-monitor.sh dbus-monitor
#follow log : tail -f /dev/shm/bt-sleep-monitor.log
#notes : Best use as systemd service
#================================================= =============================
#How it works... : LowPowerMode is disabled in two cases:
# - by enabling the bluetooth adapter, in case it is 'disabled'.
# - by powering on the display, in case the adapter is 'enabled'.
# The script switches between these modes automatically.
# After an 'action' is triggered you have 120sec. (default value) to connect a device.
# In case a device is connected, the script listens for 'disconnect' and will enable LPM again afterwards.
#================================================= =============================

Last edited by minimec; 2017-02-06 at 19:45.
 

The Following 12 Users Say Thank You to minimec For This Useful Post: