View Single Post
edp17's Avatar
Posts: 605 | Thanked: 735 times | Joined on Jul 2019 @ UK
#556
Originally Posted by mautz View Post
@edp17

Getting SFDroid too work was too complicated for me and SFDroid was sadly never fully usable, many things didn't work.

What is wrong with the bt scripts?
Thank you. I expected that answer on the SFDroid but I hoped it could work.

About the bt script:
I found that topic and checked my systems with 'mcetools --get-suspend-stats'. As the result was 0 in all Sailfish roms I downloaded minimec's first script. I have seen it requires a kernel that supports that but thanks for you it is already there!
The script worked and works fine even with the latest update 3.2.0.12.
Then I found minimec's enhanced script that uses only one dbus listener or something and saw his conversation with you about baking the script into the OS.
Then I did a 'locate bt-sleep-monitor' on my system and found two services (bt-sleep-monitor.service and bt-sleep-monitor.timer) in /lib/systemd/system and a script (bt-sleep-monitor) in /usr/bin.
So, I rebooted and tried to run one of those services. But either of them didn't make any difference, the sleep-stats remained 0.
Maybe I am trying to use them incorrectly? (I have tried 'sudo systemctl start bt-sleep-monitor.service' or 'sudo systemctl start bt-sleep-monitor.timer')
Plus, there is another service 'bt-sleep-monitor-timer' in the '/lib/systemd/system/multi-user.target.wants/' but I am not sure about this one.
Now I am trying to install minimec's first script as a sytemd service but there is no '/usr/lib/systemd/scripts' folder as the instruction said therefore I put the script into the '/usr/lib/systemd/user' but, again, not sure this is the correct place for this.

Edit: The BT monitor was a false alarm! I have removed the service that I installed (the old minimec script) and enabled the bt-sleep-monitor.service and bt-sleep-monitor.timer services and it works! Probably just I was clumsy or maybe I needed to enable these services. Anyway, it works now. Thank you!
(At least I learnt how to create a service. :-))

Edit2:
Something is still not right. The suspend_time in 'mcetool --get-suspend-stats' is not really counting. With the original bt-sleep-monitor script it was almost the same as the uptime, but with the script that came with the OS now:
uptime: 5054.484 and suspend_time: 206.410 (The suspend time was the same 90 minutes ago too.)
I don't use any bt device and the bt has not been turned on at all today.

Last edited by edp17; 2019-11-06 at 11:17. Reason: extra info (retest)