Page 1 of 3

[MOD] New function added: Alarm and Volume fade over time

PostPosted: 17 Feb 2015, 14:56
by cyber7
Some notes:
You need to enable crontab:
Code: Select all
# /usr/bin/systemctl start cronie
# /usr/bin/systemctl enable cronie


ADVANCED USERS: To check the http crontab once an alarm has been set:
Code: Select all
# crontab -u http -l


You need to install bc:
Code: Select all
pacman -S bc


To install, dump tar file into /var/www:
Code: Select all
cd /var/www
tar -xvf fade_and_alarm - beta1.tar


Hope you enjoy the release
cyber7 (aka Aubrey Kloppers; Cape Town; South Africa)

Some Screenshots:
alarm - being set.png
Alarm Screen:
alarm - being set.png (39.71 KiB) Viewed 5605 times

volume fader.png
Volume Fader Screen:
volume fader.png (12.77 KiB) Viewed 5605 times

fade_and_alarm - beta1.tar
Beta1 Tar
(30 KiB) Downloaded 796 times

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 17 Feb 2015, 15:37
by cyber7
For the future:
    1. Add more detail (i.e. final volume) to the "Current Alarm" display.
    2. Add a HARDWARE button to do an automatic fade pre-specified when pressed:
    2.a. How long it will take to do the fade.
    2.b. Fade in or Fade out.

cyber7

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 17 Feb 2015, 16:32
by hondagx35
Hi cyber7,

thank you for this modification / addon.

I think you missed something:
- cronie is not installed by default
- crontab entries for http?

Frank

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 18 Feb 2015, 05:37
by cyber7
Hi Frank
Code: Select all
[root@runeaudio www]# tar -xvf /root/fade_and_alarm\ -\ beta1.tar
index.php
mpc_fade
app/fade_ctl.php
app/alarm_ctl.php
app/templates/alarm.php
app/templates/fade.php
app/templates/header.php
[root@runeaudio www]# /usr/bin/systemctl start cronie
[root@runeaudio www]# /usr/bin/systemctl enable cronie
Created symlink from /etc/systemd/system/multi-user.target.wants/cronie.service to /usr/lib/systemd/system/cronie.service.
[root@runeaudio www]#


The above is a FRESH install and cronie is installed by default...

The comment regarding crontab is in for advanced users. I will fix/give more instructions.

kind regards
cyber7

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 08 Mar 2015, 14:06
by aj78
Thanks for this, very useful. I've just reinstalled Runeaudio 0.3b on a Raspberry Pi model B and installed this script and have noticed something rather odd. When setting an alarm time of 06.55 it actually sets a cronjob for 06.25 (this is shown both in the info panel about existing alarms and by examining the http crontab). Whatever time I put in, the alarm is set for 30 minutes earlier. My installation is set for London time. The time the alarm actually activates is the earlier time (the one that appears in the cronjob).

The runeaudio is a fresh installation and apart from configuring the network settings and the NFS share I have done nothing before installing your script.

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 12 Mar 2015, 10:55
by cyber7
:D
sorry, I had to be more descriptive, but this is a FEATURE. The 30MIN BEFORE CRON JOB means the radio-clock will fade-in for 30 minutes until your MAX has been reached.

So, if you want to wake up at 7am, the cron job will start at 6:30. It has been proven a JERK wake-up alarm could cause medical problems where a slow increase in sound will wake you up as if you are waking up naturally.

Hope this is better explained.
cyber7

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 12 Mar 2015, 15:41
by aj78
Aha - thanks! I think I will try setting it a bit later and hope that the healthier alarm allows me to do with less snooze time...

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 14 Mar 2015, 12:23
by viklander
Hey Cyber7

This wake-up feature is just great. It's defnitely a must have.

The ultimate option that I'd miss would be the ability to set up two (or more ...) alarms
ie : one for workdays, the other one for weekends, or even better one for each day as I wake up on a different time on mondays and thursdays ; tuesday, wednesday and friday ; saturday and sunday ...

That's a lot to ask, I know

Alas I'm no great coder, so I'll try to poke into you code even if I'm quite confident about ending with a totally messed up system :-)

Cheers

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 17 Jan 2016, 22:29
by lanlor
Hello. Thank you for this addon, it was what I was looking for. However I encountered one problem. I know it was mentioned before that crontab should be installed, but I have problems with enabling this service.
When typing (via putty):
Code: Select all
/usr/bin/systemctl start cronie
I have a message which says "Failed to start cronie.service: Unit cronie.service failed to load: No such file or directory."
I am using Raspberry Pi 2 model B.
Could anyone help me with this? Am I doing something wrong?

Re: [MOD] New function added: Alarm and Volume fade over tim

PostPosted: 17 Jan 2016, 23:23
by hondagx35
Hi lanlor,

I am using Raspberry Pi 2 model B.

On the RP2 image cronie is not installed by default.

You can try to install it with:
Code: Select all
pacman -S cronie


Frank