Jump to content
Flirc Forums
Sign in to follow this  
digitalb0y

[Ubuntu] Setting up suspend/wake for Flirc on Ubuntu

Recommended Posts

First we need to enable wakeup on the USB bus to which your Flirc is connected.

  1. Determine which USB buses (if any) already have wakeup enabled:
    cat /proc/acpi/wakeup
    On my system, here's the result:
    
    		$ cat /proc/acpi/wakeup
    
    		Device S-state   Status   Sysfs node
    
    		P0P1   S4 *disabled  pci:0000:00:1e.0
    
    		P0P4   S4 *disabled  pci:0000:00:1c.0
    
    		P0P5   S4 *disabled  pci:0000:00:1c.1
    
    		P0P6   S4 *disabled  pci:0000:00:1c.2
    
    		P0P7   S4 *disabled
    
    		P0P8   S4 *disabled
    
    		P0P9   S4 *disabled
    
    		USB0   S3 *disabled  pci:0000:00:1d.0
    
    		USB1   S3 *disabled  pci:0000:00:1d.1
    
    		USB2   S3 *disabled  pci:0000:00:1d.2
    
    		USB3   S3 *disabled  pci:0000:00:1d.3
    
    		EUSB   S3 *disabled  pci:0000:00:1d.7    
    
    	
  2. You'll need to be root for the next part, so:
    sudo su
  3. You need to determine which of those USB buses (the ones with USBX in the first column) is the one your Flirc is plugged into. Starting with the first bus in the list above, run:
    echo USB0 > /proc/acpi/wakeup
    If you run the command from step 1 again, the USB0 line should say enabled instead of disabled.
  4. Suspend the system, and see if you can wake it up with your remote.
  5. If the machine won't wake with your remote, wake it with the power button or over LAN and repeat step three using USB1 in place of USB0, then repeat step 4. Keep going until you find the bus to which your Flirc is attached.
Once you've found the bus the Flirc is on, it will keep working until you reboot the machine, unless you add the command to enable it to rc.local. To do so:
  1. leave root:
    exit
  2. edit the file:
    sudo nano /etc/rc.local
  3. Add this to the file below the comments and above the exit line:
    
    	sh -c 'echo "USB0"' > /proc/acpi/wakeup
    
    	echo "rc.local has completed sucessfully." >> /tmp/resume.log	
    
    
    Note: this assumes USB0 is the bus that worked in the top section. If yours worked on a different bus, change the number in this step accordingly. Here's an example of what the file might look like:
    
    
    	#!/bin/sh -e
    
    	#
    
    	# rc.local
    
    	#
    
    	# This script is executed at the end of each multiuser runlevel.
    
    	# Make sure that the script will "exit 0" on success or any other
    
    	# value on error.
    
    	#
    
    	# In order to enable or disable this script just change the execution
    
    	# bits.
    
    	#
    
    	# By default this script does nothing.	
    
    
    
    	sh -c 'echo "USB0"' > /proc/acpi/wakeup
    
    	echo "rc.local has completed sucessfully." >> /tmp/resume.log
    
    
    	exit 0	
    
    
    	
  4. Save the file (Ctrl+X to save and exit, Y for yes, Enter to confirm the file name is the same).
  5. Reboot. If all went well, you should be able to wake your machine from sleep using your Flirc.
Note: if you want to eliminate the guess work in the top section and don't have a lot of USB devices that might interfere, you can just enable them all in rc.local. I've seen an Ubuntu forum poster say his rc.local file looks like this:

sh -c 'echo "USB4" > /proc/acpi/wakeup'

sh -c 'echo "USB3" > /proc/acpi/wakeup'

sh -c 'echo "USB2" > /proc/acpi/wakeup'

sh -c 'echo "USB1" > /proc/acpi/wakeup'

sh -c 'echo "USB0" > /proc/acpi/wakeup'

exit 0

There's also some steps you can take specifically if you're running XBMC and the machine wakes immediately when you put it to sleep. There's lots of good troubleshooting info and more to read at:

Share this post


Link to post
Share on other sites

One more quick note: even following the extra steps in the XBMC wiki to modify the grub file, I was getting immediate wakeups using Flirc firmware fw_wake_v6. Going back to Firmware 1.0 fixes this. It takes away the ability to use a mapped 'wake' button, but firmware 1.0 using the steps above *should* yield an Ubuntu system that wakes from suspend using any remote button that's programmed in your Flirc config.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...