My solution: convenient and reliable alarms
#1
Hello everybody.
Let me know, what you tink about this.

Alarms that are set in the Clocks App of (at least) Mobian are, as far as I can see, actually not reliable.
They do not go off, if the phone is in stand by mode for some time.
Sometimes they go off, when I wake up the phone, sometimes, when I unlock it, and sometimes they do not at all.
My first approach was to use a cronjob, that wakes the phone up, 1 minute before it is time for the alarm. Any (!) command executed by cron did the job. I used "ls".
This worked well and I used this solution for several days, until I decided, that the standard alarm tone is crap. And even worse, it will last precious seconds to find my glasses, unlock the phone, open the header and stop it.

No, I wake up with my favorit music, the phone is already unlocked and I am able to quit (if I wish) without using my glasses.
Here is, how it works.
You need to install cron and mplayer.
You create a cronjob that (1) unlocks your device and (2) starts mplayer in a kingscross session. mplayer will play every music you like.
cron will wake up your phone reliable, even after a long night. Your display remains dark.
To end this "alarm", you have to press the power button once, then either hit q, or p on the keyboard. This will quit, or pause mplayer.
As an alternative you can end kingscross. This is what I do, because I can do it without my glasses.
I hit the arrow icon to switch to task view, swipe to close and hit the fat red button on the right (indicating, mplayer is running in the terminal)
Yes, that are two to four key presses. More than in standard spy phones but less than necessary whith the standard alarm.

Here is, what has to be done before (you need basic knowlege of command line editors, cron, mplayer).
In Kingscross, or from a SSH session do:
sudo apt install cron
sudo apt install mplayer
crontab -e
## In the file, that opens, enter the following line

30 7 * * * loginctl unlock-session 1; DISPLAY=:0 /usr/bin/kgx -e "mplayer http://wdr-wdr5-live.icecast.wdr.de/wdr/...stream.mp3"

That's all.
At 7:30 on every weekday (30 7 * * * ), cron will now unlock the device in your name (loginctl unlock-session 1) and start kingscross (/usr/bin/kgx). Kingscross will execute mplayer and let it playback the german WDR5 info radio (-e "mplayer http://wdr-wdr5-live.icecast.wdr.de/wdr/...stream.mp3").
The mplayer manpages will tell you, how to set the initial volume and how to play your inividual playlist.
The cron manpages will tell you, how to configure "alarms" for working days, weekends etc.
  Reply
#2
Hi,

I would suggest you to use the alarm clock app I wrote Wink It wakes the device through systemd timers that sett the RTC device clock: https://gitlab.gnome.org/kailueke/wake-mobile

Mobian binary packages are linked in the README.


In your case, why is cron waking up the device, do you use the systemd-cron?
  Reply
#3
(02-01-2021, 04:43 PM)pothos Wrote: Hi,

I would suggest you to use the alarm clock app I wrote Wink It wakes the device through systemd timers that sett the RTC device clock: https://gitlab.gnome.org/kailueke/wake-mobile

Mobian binary packages are linked in the README.


In your case, why is cron waking up the device, do you use the systemd-cron?

Hello there,

your app sounds promising. For my Mobian (latest updates), there were two dependencies missing:

gnome-session-canberra
python3-psutil

After installing these two, the app works fine, thank you!


And thanks to derbaertigefrytz for bringing up this topic and the hint for python3-psutil.

And I get an error trying to start the app

Quote:File "/usr/bin/wake-mobile", line 9, in <module> import os, sys, signal, psutil
ModuleNotFoundError: No module named 'psutil'

Any ideas?
  Reply
#4
This app has worked really well for me, thanks. It was the last missing piece I still needed my old phone for.

I've used the alarm for about 4 weeks now, and it has never failed to go off.

I can't remember what I did to get it running, but according to `pip list` I have psutil installed that way.

So try
Code:
pip install psutil
  Reply
#5
Little improvement proposal to unlock from CLI :

Code:
loginctl show-seat $(loginctl list-seats --no-pager --no-legend) -p ActiveSession --value|xargs -iX loginctl unlock-session X

but now we're stuck on another problem : how to set display ON from CLI ?
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Possible Solution for Microphone Not Working Ferriah 0 903 02-13-2023, 01:09 PM
Last Post: Ferriah
  Latest Reliable Mobian Build Confirmation Thread Katsujinken 5 2,514 09-27-2022, 08:41 AM
Last Post: Katsujinken
  alarms do not seem to work motox6 2 2,781 05-06-2021, 11:08 AM
Last Post: motox6

Forum Jump:


Users browsing this thread: 1 Guest(s)