All, here is something that I learned through a little digging into the kindle's internals/file system. This was on a Kindle Signature 12th Generation running 5.17.0.
Some background...
I wanted to play sound files via cron but was having trouble in that the device would disconnect any bluetooth connection as the device a few seconds or minutes after going into screen saver mode. I have an app that I wrote which keeps the device awake when the screen saver is visible and the device is either charging or its battery level is > 98%, (this is for another thread if anyone is interested). However, the device's framework would still disconnect my bluetooth speaker. Unlike other solutions that I've seen, my "keep awake" solution does not interfere with the device's normal activities except that it does not allow the device to go into a suspended state (i.e., I don't disable the screen saver support using ";ds" in the search bar or invoking lipc-set-prop com.lab126.powerd preventScreenSaver 1).
The solution to my BT conundrum was to force the kindle to reconnect before invoking mplay, for newer devices, or aplay for older ones.
The command to connect a device is:
Quote:
lipc-set-prop com.lab126.btfd Connect DEVICE_MAC_ADDR
|
There is no harm done by invoking this should the device be connected already. The Bluetooth daemon (btmanagerd) handles things properly. You'll also want to sleep about 5 second after invoking the command above and before attempting to play any media files, to give the device a chance to connect.
To identify the MAC address of the device that you want to connect, look at the following file on the kindle:
Quote:
/var/local/zbluetooth/bt_config.conf
|
Some other resources which were useful in this endeavor included the following:
output from: lipc-probe -a -v #Look for the "com.lab126.btfd" section.
/etc/upstart/btmanagerd.conf
/usr/share/webkit-1.0/pillow/javascripts/constants.js
/usr/share/webkit-1.0/pillow/javascripts/bt_switch_dialog.js
I hope that someone finds this useful.