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

Suggestions/requests/ideas for RuneAudio core features and functions

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

Postby cyber7 » 17 Feb 2015, 14:56

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 5580 times

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

fade_and_alarm - beta1.tar
Beta1 Tar
(30 KiB) Downloaded 793 times
Last edited by cyber7 on 18 Feb 2015, 05:41, edited 1 time in total.
To err is human, to err again is machine!
User avatar
cyber7
 
Posts: 28
Joined: 04 Feb 2014, 14:49
Location: Cape Town, South Africa

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

Postby cyber7 » 17 Feb 2015, 15:37

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
Last edited by cyber7 on 18 Feb 2015, 08:27, edited 1 time in total.
To err is human, to err again is machine!
User avatar
cyber7
 
Posts: 28
Joined: 04 Feb 2014, 14:49
Location: Cape Town, South Africa

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

Postby hondagx35 » 17 Feb 2015, 16:32

Hi cyber7,

thank you for this modification / addon.

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

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

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

Postby cyber7 » 18 Feb 2015, 05:37

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
To err is human, to err again is machine!
User avatar
cyber7
 
Posts: 28
Joined: 04 Feb 2014, 14:49
Location: Cape Town, South Africa

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

Postby aj78 » 08 Mar 2015, 14:06

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.
aj78
 
Posts: 51
Joined: 29 Oct 2014, 20:42

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

Postby cyber7 » 12 Mar 2015, 10:55

: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
To err is human, to err again is machine!
User avatar
cyber7
 
Posts: 28
Joined: 04 Feb 2014, 14:49
Location: Cape Town, South Africa

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

Postby aj78 » 12 Mar 2015, 15:41

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...
aj78
 
Posts: 51
Joined: 29 Oct 2014, 20:42

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

Postby viklander » 14 Mar 2015, 12:23

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
viklander
 
Posts: 6
Joined: 14 Mar 2015, 12:08

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

Postby lanlor » 17 Jan 2016, 22:29

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?
lanlor
 
Posts: 2
Joined: 17 Jan 2016, 22:19

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

Postby hondagx35 » 17 Jan 2016, 23:23

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
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

support RuneAudio Donate with PayPal

Next

Return to Feature request

Who is online

Users browsing this forum: No registered users and 2 guests