View Single Post
Posts: 97 | Thanked: 318 times | Joined on Feb 2012 @ Switzerland
#640
In the CM13 image there is a script to enable low-power-mode for bluetooth. I did a complete rewrite of that script and it also works in the CM12 base... See: https://talk.maemo.org/showpost.php?...&postcount=310

I use that next generation script on the CM12 base for a long time now with no problems with my car audio system, bt-headphones and a HiFi bt-adapter.

Feel free to report problems...

Source: https://github.com/minimec/bt-sleep-monitor

#How it works... : A dbus-monitor process is listening for different dbus events in parallel:
# - Bluetooth power on/off
# - Bluetooth connections
# - Display events
# When an event is triggered the program will decide whether to enable/disable
# or temporarily disable bluetooth suspend (low power mode).
# If bluetooth is powered and in low power mode, a display event will disable suspend mode for 60 seconds ($BTACTIVE).
# In case there is no bluetooth connection after that time, suspend mode is enabled again.


This is a copy/paste instruction to implement script as systemd service in the CM12 port.

Code:
# login root console
devel-su

# Download new files and put them in place
curl -o /usr/bin/bt-sleep-monitor https://raw.githubusercontent.com/minimec/bt-sleep-monitor/master/bt-sleep-monitor

curl -o /lib/systemd/system/bt-sleep-monitor-ng.service https://raw.githubusercontent.com/minimec/bt-sleep-monitor/master/bt-sleep-monitor.service

# Make script executable
chmod +x /usr/bin/bt-sleep-monitor

# reload systemd units
systemctl daemon-reload

# Start service
systemctl enable bt-sleep-monitor-ng.service
systemctl start bt-sleep-monitor-ng.service

# Exit root console
exit
 

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