XBMC will be renamed to Kodi for v14. Read here for more details

HOW-TO:Create a resume script

From Kodi
Revision as of 19:46, 8 November 2009 by Outleradam (Talk)

Jump to: navigation, search

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.

You will need root access for the following commands.


Contents

1 Setting up the basics

This section discusses installation and use of curl

1.1 Installing curl

  • Log into a terminal as root
  • Execute the following command to get a program which will allow you to turn on and off XBMC's remote monitoring function
apt-get install curl

1.2 Using Curl

The following command will disable XBMC's ability to turn your remote's commands into usable input.

curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"

The following command will enable XBMC's ability to turn your remote's commands into usable input.

curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start"

The following command will stop and then restart XBMC's ability to turn your remote's commands into usable input.

curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.restart"


2 Designing your resume script

This section discusses creating a basic lirc resume script. You will now go through each one of the sections and design your custom restart script. It is recommended that you create a wiki article like this one, Snapstream Firefly when you are finished. When you add to the wiki, it is documented so people who are not as good with scripting may follow behind your work.

2.1 Create your basic script outline

  • Open a notepad so that you can keep notes for your resume script
  • Copy the following into your notepad
#!/bin/sh
case "$1" in 
	resume)
		curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"


		/etc/init.d/lirc restart 
		curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start" 
		echo "lirc_atiusb resume script completed" >>/tmp/script.log
	;;
esac

This is the basic resume script outline. The two blank lines under curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop" will be for restarting your drivers.

2.2 checking remote output

  • From your terminal copy and paste the following to verify if your remote is working.
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"
 /etc/init.d/lirc restart
curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start
irw
  • Press a few buttons on your remote
  • press ctrl + C to exit irw

If your remote works, then skip to the creating a resume file section.

2.3 Locate your drivers

  • From your terminal type the following to verify your system is recognizing your remote's receiver
lsusb
  • Search for your remote's physical device

EG.

(T: XBMCLive)root@XBMCLive:~# lsusb
Bus 001 Device 003: ID 0bda:0151 Realtek Semiconductor Corp. Mass Stroage Device 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0bc7:0008 X10 Wireless Technology, Inc. Wireless Transceiver (ACPI-compliant)
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
(T: XBMCLive)root@XBMCLive:~#

08 X10 Wireless Technology, Inc. Wireless Transceiver (ACPI-compliant) is the remote device. You can verify this by unplugging the device and running lsusb again


  • List all lirc devices
sudo modprobe -l |grep lirc
  • Search for the driver which controls the physical device
Personal tools
Namespaces

Variants
Actions
Navigation
Wiki help
Toolbox