Archive:Automatic lirc resume script: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Outleradam
No edit summary
>Outleradam
No edit summary
Line 26: Line 26:
  /etc/init.d/lirc start  
  /etc/init.d/lirc start  
  irw & sleep 1; killall irw
  irw & sleep 1; killall irw
  curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn& parameter=LIRC.Start"  
  curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start"  
  echo "lirc resume script completed!!!" >>/tmp/script.log
  echo "lirc resume script completed!!!" >>/tmp/script.log
  ;;
  ;;

Revision as of 01:13, 16 November 2009

This guide assumes that you have installed XBMC_Live or have at least performed all steps outlined in one of the articles listed here Installing_XBMC_for_Linux and here HOW-TO_setup_Lirc_to_talk_to_XBMC. This guide assumes that your remote works well upon startup. If it does not, then do not proceed with this article.

You will also need a SFTP client and a terminal emulator like WinSCP and Putty.

To enable resume from your remote see the following article Enable Wake-On-Device

You will need root access for the following commands.

Creating a resume file

  • Using your SFTP client create a file called /etc/pm/sleep.d/99lirc-resume.sh
  • copy the following information into the file 99lirc-resume.sh
#!/bin/sh

# This script uses curl. Install curl using the following command from your terminal apt-get install curl
# This script will restart ATIUSB, Lirc, and XBMC upon resume.

case "$1" in  
	resume)
		lircDriver=$(dmesg | grep usbcore | grep -i 'lirc' | sed -e "s/.* \(lirc*\)/\1/" | head -n 1)
 		curl "http://127.0.0.1:8080/xbmcCmds /xbmcHttp?command=ExecBuilt&Inparameter=LIRC.Stop"
		/etc/init.d/lirc stop 
		rmmod $lircDriver
		modprobe $lircDriver
		/etc/init.d/udev restart
		/etc/init.d/lirc start 
		irw & sleep 1; killall irw
		curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start" 
		echo "lirc resume script completed!!!" >>/tmp/script.log
	;;
esac
  • make it executable using the following command in your terminal
chmod +x /etc/pm/sleep.d/99lirc-resume.sh

You are now done.