Python - Wait for CEC command?
#1
Hi,

Basically, I have a Raspberry Pi that I have powered on all the time.

I am wanting to write a python script that puts XBMC (& the Pi) into a "sleep" state.
This will spin down the harddrives and a few other things to "save power" and most importantly - make no noise.

Is there any python functions to wait for a CEC command? or a XBMC specific command.
Eg: wait for "suspend" command (which Pulse Eight calls) - then the script will catch this and run.
Currently - suspend does nothing on the RPI.

Easier yet would be changing the Pulse Eight to call the python script directly.

I would then want XBMC to "wake up" if the TV powers on or WOL (if I need to access the harddrives from my PC)

Any ideas?
Reply
#2
Doesn't Pulse Eight's libCEC already do all this without the need for a python script?
Reply
#3
Yes, it can put XBMC into a "suspend" mode or shutdown.

However, suspend on the RPI does nothing.
So, i was going to write a python service to wait for a "suspend" command and then spin down hard-drives etc.

Shutdown on the RPI does spin down the hard-drives.
However, there is no way to wake it back up without unplugging.

The propper soultion would be that the RPI has a propper suspend function that spins down hard-drives etc.
Then waits for keypress / CEC command / WOL
Reply
#4
not that this is what you were asking but out of curiosity why do you keep it powered on all the time? i just have mine powered through the usb service port on my tv to it turns on and off with the tv.
Reply

Logout Mark Read Team Forum Stats Members Help
Python - Wait for CEC command?0