[mythtv-users] Wake from USB

Tim Draper veehexx at gmail.com
Fri Apr 5 20:24:48 UTC 2013


This is how i wake/sleep my atom ion FE (not a zbox, but it is zotac).
Hopefully this will format the way i want it to, so here goes...

---
sudo nano ~/.lirc/mythtv

begin
remote = mceusb
prog = irexec
button = KEY_POWER
config = sudo pm-suspend
end


---
sudo nano ~/scripts/1.s3_cntrl.sh

#!/bin/sh
# This script enables pci/usb controllers/cards to be kept alive
during suspend (sysfs). Use ls /sys/bus/usb/devices/ for valid
devices. Eg: usb controller
echo enabled > /sys/bus/usb/devices/1-0:1.0/power/wakeup
echo enabled > /sys/bus/usb/devices/1-2/power/wakeup
echo enabled > /sys/bus/usb/devices/1-2:1.0/power/wakeup
echo enabled > /sys/bus/usb/devices/2-0:1.0/power/wakeup
echo enabled > /sys/bus/usb/devices/3-0:1.0/power/wakeup
echo enabled > /sys/bus/usb/devices/1-0:1.0/power/wakeup
echo enabled > /sys/bus/usb/devices/4-1/power/wakeup
echo enabled > /sys/bus/usb/devices/4-1:1.0/power/wakeup
echo enabled > /sys/bus/usb/devices/5-0:1.0/power/wakeup
#echo enabled > /sys/bus/usb/devices/5-1/power/wakeup
#echo enabled > /sys/bus/usb/devices/5-1:1.0/power/wakeup
#echo enabled > /sys/bus/usb/devices/5-2/power/wakeup
#echo enabled > /sys/bus/usb/devices/5-2:1.0/power/wakeup
exit 0

---
sudo nano ~/scripts/2.s3_usb.sh

#!/bin/sh
# Scipt to enable individual USB devices to be kept alive during
sleep. Eg USB IR Reciever
echo USB0 > /proc/acpi/wakeup
echo USB1 > /proc/acpi/wakeup
echo USB2 > /proc/acpi/wakeup
echo USB3 > /proc/acpi/wakeup
exit 0

---
sudo visudo
%mythtv ALL = NOPASSWD: /usr/sbin/pm-suspend, /sbin/modprobe,
/home/myth/scripts/, /bin/sh, /etc/init.d/mythtv-backend,
/usr/bin/irexec

----------------------

It should be self explanatory on what each script does what.
The only thing i need todo on reboot/cold boot, is run the
1.s3_cntrl.sh, and 2.s3_usb.sh scripts in that order.
I think it's been mentioned, but ensure you have USB wake enabled in the BIOS.

My MCE receiver LED only illuminates when it detects IR. This is what
1.s3_cntrl.sh does; enables the usb controller to be kept alive when
in sleep. 2.s3_usb.sh then allows individual devices to wake the
machine.
you will need to ammend the paths to suit your system.

hth


More information about the mythtv-users mailing list