Archive:Snapstream Firefly: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Outleradam
(New page: {{GoToParent|Parent=Installing XBMC for Linux}} __NOEDITSECTION__ __TOC__ The Snapstream Firefly is a X10 based remote control which uses [http://en.wikipedia.org/wiki/Radio_frequency RF] ...)
 
>Outleradam
No edit summary
Line 2: Line 2:
__NOEDITSECTION__
__NOEDITSECTION__
__TOC__
__TOC__
The Snapstream Firefly is a X10 based remote control which uses [http://en.wikipedia.org/wiki/Radio_frequency RF] commands as opposed to [http://en.wikipedia.org/wiki/Infrared IR].  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]]. You will also need a [http://en.wikipedia.org/wiki/Ssh SSH] client and a [http://en.wikipedia.org/wiki/Terminal_emulator terminal emulator].  I would recommend [http://winscp.net/eng/index.php WinSCP] and [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty] as they work well and are free.
The Snapstream Firefly is a X10 based remote control which uses [http://en.wikipedia.org/wiki/Radio_frequency RF] commands as opposed to [http://en.wikipedia.org/wiki/Infrared IR].  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]]. You will also need a [http://en.wikipedia.org/wiki/Ssh SSH] client and a [http://en.wikipedia.org/wiki/Terminal_emulator terminal emulator].  I would recommend [http://winscp.net/eng/index.php WinSCP] and [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty] as they work well and are free.  
 


You will need root access for the following commands.


== Setting up Lirc ==
== Setting up Lirc ==
First we will set up Lirc to work with the remote.  lircd.conf specifies to Lirc how it should handle the remote device.  We need to replace the current file with our Snapstream Firefly file.  
First we will set up Lirc to work with the remote.  lircd.conf specifies to Lirc how it should handle the remote device.  We need to replace the current file with our Snapstream Firefly file.  


/etc/lirc/lircd.conf
*Replace the contents of /etc/lirc/lircd.conf in it's entirety with the following.
 
  begin remote
  begin remote
  name Snapstream Firefly
  name Snapstream Firefly
  bits 16
  bits 16
  eps 30
  eps 30
  aeps 100
  aeps 100  
  one 0 0
  one 0 0
  zero 0 0
  zero 0 0
Line 80: Line 78:




== Integrating Firefly into XBMC ==
You will need to add the following information into the current lirc map for XBMC to interperate the commands given by lirc into productive commands.
* Modify /etc/share/xbmc/system/Lircmap.xml to add the following directly below <lircmap> and above <remote device="mceusb">
<remote device="Snapstream">
<pause>pause</pause>
<stop>stop</stop>
<forward>forward</forward>
<reverse>rewind</reverse>
<left>left</left>
<right>right</right>
<up>up</up>
<down>down</down>
<select>ok</select>
<pageplus>chup</pageplus>
<pageminus>chdown</pageminus>
<back>exit</back>
<menu>menu</menu>
<title>play</title>
<info>info</info>
<skipplus>next</skipplus>
<skipminus>prev</skipminus>
<display>maximize</display>
<start>firefly</start>
<record>rec</record>
<volumeplus>volup</volumeplus>
<volumeminus>voldown</volumeminus>
<mute>mute</mute>
<power>close</power>
<myvideo>video</myvideo>
<mymusic>music</mymusic>
<mypictures>photos</mypictures>
<mytv>tv</mytv>
<one>1</one>
<two>2</two>
<three>3</three>
<four>4</four>
<five>5</five>
<six>6</six>
<seven>7</seven>
<eight>8</eight>
<nine>9</nine>
<zero>0</zero>
<mytv>a</mytv>
<mymusic>b</mymusic>
<mypictures>c</mypictures>
<myvideo>d</myvideo>
</remote>




== S3 resume combo Close button ==


The funny thing about this remote is that the only button which will allow it to resume the computer from standby via S3 switch is the same button that puts the computer into standby. The same command is issued by the remote every time you press the close button and is retained in memory until issued to a proper output device by lirc.  Resuming from standby with the power button puts the computer back in standby or deactivates the remote.


==Adding PPA Keys==
In order to issue the S3 resume command to the computer and restart the remote controller without issuing the command to put the computer back into sleep mode or standby you will need to add the following resume script.
These packages are signed with a unique key for added security. Synaptic needs to know this key in order to verify the packages' authenticity.
*Click [http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x6D975C4791E7EE5E here] to view the PGP key
*Select the text from the beginning of the keyblock to the end (including those lines)
*Copy that text to the clipboard (Edit -> Copy)
*Open your text editor from Applications -> Text Editor.
*Paste the key contents (Edit -> Paste)
*Save the document in your home folder as xbmc-ppa.key
*Reopen Software Sources, this time choosing the "Authentication" tab.
*Click "Import Key File" and choose the newly created xbmc-ppa.key and press OK.


==Installing XBMC==
*Using your SSH client, create the file /etc/pm/resume.d/99lirc-resume.sh
Now that the repo and key have been added, install XBMC like any other program.
*Modify the contents of /etc/pm/sleep.d/99lirc-resume.sh to contain the following
*Click System -> Administration -> Synaptic Package Manager
#!/bin/sh
*Click "Reload"
*Search for "xbmc"
case "$1" in
*Mark xbmc and xbmc-standalone for installation and mark additional changes when prompted.
resume)
*Click "Apply" and agree to the changes after reading them.
sleep 5
XBMC is now installed and ready for use.
sudo rmmod lirc_atiusb
sudo modprobe lirc_atiusb
sudo /etc/init.d/lirc restart >/tmp/resumescript.log
irw & sleep 1; killall irw >/tmp/resumescript.log
sudo curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start" >/tmp/resumescript.log
echo "lirc_atiusb resume script completed" >/tmp/script.log
;;
esac


==Autostart XBMC (optional)==
You will now need to make the new file executable.
By following these instructions, your system will boot directly into XBMC rather than your desktop from now on. '''It is advised that you delay this step until XBMC is setup as you'd like it.
*From the desktop click System -> Administration -> Login Window
*From the "Security" tab choose "Enable Automatic Login" and select your username.
*Click "OK" to exit.
*Logout of your system.
*From the Login screen choose "Select Session"
*Choose "XBMC" and click "Change Session"
You're finished. Next time you login you should be greeted with XBMC.


*open your terminal log in and type the following
sudo chmod +x /etc/pm/sleep.d/99lirc-resume.sh


[[category:How To|Linux]]
*Restart the computer
[[category:Linux]]
[[category:To-Do]]

Revision as of 04:26, 7 November 2009

Template:GoToParent

The Snapstream Firefly is a X10 based remote control which uses RF commands as opposed to IR. 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. You will also need a SSH client and a terminal emulator. I would recommend WinSCP and Putty as they work well and are free.

You will need root access for the following commands.

Setting up Lirc

First we will set up Lirc to work with the remote. lircd.conf specifies to Lirc how it should handle the remote device. We need to replace the current file with our Snapstream Firefly file.

  • Replace the contents of /etc/lirc/lircd.conf in it's entirety with the following.
begin remote
name Snapstream Firefly
bits 16
eps 30
aeps 100 
one 0 0
zero 0 0
pre_data_bits 8
pre_data 0x14
post_data_bits 16
post_data 0x0
gap 235978
toggle_bit_mask 0x80800000

begin codes
maximize 0x81AC
close 0xD702
1 0x628D
2 0xE30E
3 0x648F
4 0xE510
5 0x6691
6 0xE712
7 0x6893
8 0xE914
9 0x6A95
0 0xEC17
back 0x6B96
ent 0xED18
volup 0x5E89
voldown 0xDD08
mute 0x5F8A
chup 0xE00B
chdown 0x618C
firefly 0xD500
info 0x83AE
option 0x042F
up 0x6F9A
down 0xF722
left 0x729D
right 0xF41F
ok 0x739E
menu 0xF11C
exit 0x75A0
rec 0xFC27
play 0x7AA5
stop 0xFD28 
rew 0x79A4
prev 0x002B
pause 0x7EA9
ffwd 0xFB26
next 0x7FAA
music 0xDB06
photo 0x5A85
dvd 0xD904
tv 0x5883
video 0xDC07
help 0x5681 
mouse 0x022D
a 0x6E99
b 0xF01B
c 0x76A1
d 0xF823
end codes

end remote 


Integrating Firefly into XBMC

You will need to add the following information into the current lirc map for XBMC to interperate the commands given by lirc into productive commands.


  • Modify /etc/share/xbmc/system/Lircmap.xml to add the following directly below <lircmap> and above <remote device="mceusb">
<remote device="Snapstream">
<pause>pause</pause>
<stop>stop</stop>
<forward>forward</forward>
<reverse>rewind</reverse>
<left>left</left>
<right>right</right>
<up>up</up>
<down>down</down>
<select>ok</select>
<pageplus>chup</pageplus>
<pageminus>chdown</pageminus>
<back>exit</back>
<menu>menu</menu>
<title>play</title>
<info>info</info>
<skipplus>next</skipplus>
<skipminus>prev</skipminus>
<display>maximize</display>
<start>firefly</start>
<record>rec</record>
<volumeplus>volup</volumeplus>
<volumeminus>voldown</volumeminus>
<mute>mute</mute>
<power>close</power>
<myvideo>video</myvideo>
<mymusic>music</mymusic>
<mypictures>photos</mypictures>
<mytv>tv</mytv>
<one>1</one>
<two>2</two>
<three>3</three>
<four>4</four>
<five>5</five>
<six>6</six>
<seven>7</seven>
<eight>8</eight>
<nine>9</nine>
<zero>0</zero>
<mytv>a</mytv>
<mymusic>b</mymusic>
<mypictures>c</mypictures>
<myvideo>d</myvideo>
</remote>


S3 resume combo Close button

The funny thing about this remote is that the only button which will allow it to resume the computer from standby via S3 switch is the same button that puts the computer into standby. The same command is issued by the remote every time you press the close button and is retained in memory until issued to a proper output device by lirc. Resuming from standby with the power button puts the computer back in standby or deactivates the remote.

In order to issue the S3 resume command to the computer and restart the remote controller without issuing the command to put the computer back into sleep mode or standby you will need to add the following resume script.

  • Using your SSH client, create the file /etc/pm/resume.d/99lirc-resume.sh
  • Modify the contents of /etc/pm/sleep.d/99lirc-resume.sh to contain the following
#!/bin/sh

case "$1" in
	resume)
		sleep 5
		sudo rmmod lirc_atiusb
		sudo modprobe lirc_atiusb
		sudo /etc/init.d/lirc restart >/tmp/resumescript.log

irw & sleep 1; killall irw >/tmp/resumescript.log

		sudo curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start" >/tmp/resumescript.log

echo "lirc_atiusb resume script completed" >/tmp/script.log

	;;
esac

You will now need to make the new file executable.

  • open your terminal log in and type the following
sudo chmod +x /etc/pm/sleep.d/99lirc-resume.sh
  • Restart the computer