AlarmXBMC
#1
Alarm script for XBMC and Linux (Ubuntu) for setting an mp3 alarm and also suspend/resume function. Have only tested it on my version of XBMC and Ubuntu 10.04, its made for Alaska skin but seems alright with Confluence f.e

* Install pmi and add permissions to run without sudo/password
* Install rtcwake & xbmc-send
Code:
sudo apt-get install xbmc-eventclients-xbmc-send
sudo apt-get install rtcwake
sudo chmod u+s /usr/sbin/rtcwake

Files here: http://code.google.com/p/alarmxbmc/

NOTE: This script does not care about earlier entries to crontab, so they will be removed eventually. Ill work on a fix for that.

2010-07-13: Changed the script a bit and added some instructions.
2010-07-16: Another edit, cleaned up code and its now working flawless for me so far.
2010-07-20: Changed to python script executing alarm, and moved code to separate modules
2010-07-20: Changed hardcoded configuration so nothing needs to be changed in python files and added README
Reply
#2
Hi

I would for sure be interested in using this. Will it also wake up your machine from Stand-by?

Regards Skare
Reply
#3
skare Wrote:Hi

I would for sure be interested in using this. Will it also wake up your machine from Stand-by?

Regards Skare

Nice man! Im currently cleaning up the code and trying to make it more like an official release but Ill get you a link soon.
Waking up from stand-by is a good idea, I forgot about that cause my previous motherboard didnt support it but it might be possible to implement. Ill have a look at it!
Reply
#4
So.. I got some stuff together. Getting the wake up function to work is a pita but atleast some of it is there. Right now there are a few things left to do:

* Make a wake up script that removes the crontab entry for rtcwake per default
* Make it possible to turn wake up OFF and keep suspend timer. Right now you have to turn suspend off entirely.
* Make it possible to turn only wake up ON, if you want to suspend manually.
* Get the time from a already set wake up timer to display when you start the script again.

If any one feel like adding this or cleaning up the code be my guest!
Also I had to do a few changes to get rtcwake to almost work, which is add permission to /dev/rtc0 since that was the only solution I could figure out, as rtcwake needs root access and sudo from crontab will probably expire.
Also you need to change permissions of /sys/power/state, which I havent figured out how to do permanently yet.

All feedback is very much appreciated. Cheers

EDIT: Most of this is taken care of now
Reply
#5
As for knowing what mode to use for rtcwake, this might be useful:

Code:
$ grep -i rtc /var/log/kern.log
RTC can wake from S4
...
rtc0: alarms up to one month

# G1 Sleeping subdivides into the four states S1 through S4.

* S1: The CPU(s) stop executing instructions.
* S2: The CPU is powered off.
* S3: Suspend to RAM.
* S4: Suspend to disk or hibernate.

from http://www.mythtv.org/wiki/ACPI_Wakeup
Reply
#6
Well, pm-suspend wont work without sudo either, and adding it to sudoers wont do the trick. So I found this.

Change TIMERNOWAKE to "pmi action suspend" or "/usr/sbin/pmi action suspend"
Reply
#7
Maybe this can be changed to the release forum?
Reply
#8
Hey again. Im trying to make a python script for playing the alarm instead of the bash one I have now. Importing xbmcgui wont work, but xbmc module is fine. Just one small thing tho, I get this:

Code:
AttributeError: 'module' object has no attribute 'executebuiltin'

Do I have to run the script from XBMC for it to work? Or is there any other way to get a python script to interact with XBMC when run through ordinary python interpreter?


EDIT: There was a simple solution to this of course. I just changed crontab to do "xbmc-send RunScript(alarm.py)". Which means I can now implement some more functions, like a snooze button.. Smile
Reply

Logout Mark Read Team Forum Stats Members Help
AlarmXBMC0