Archive:Snapstream Firefly: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Outleradam
No edit summary
No edit summary
 
(32 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{GoToParent|Parent=Installing XBMC for Linux}}
{{outdated}}
__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 Kodi for Linux and here HOW-TO setup Lirc to talk to XBMC. You will also need a [http://en.wikipedia.org/wiki/Ssh SFTP] client and a [http://en.wikipedia.org/wiki/Terminal_emulator terminal emulator] like [http://winscp.net/eng/index.php WinSCP] and [http://www.chiark.greenend.org.uk/~sgtatham/putty/ Putty].


You will need root access for the following commands.


== Snapstream Firefly ==
== Setting up the easy way ==


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 SFTP] 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 following file contains all modifications required to make the Snapstream Firefly work and has been tested under Ubuntu 9.04-10.10 with XBMC-live. This file will map out several features of the remote. The files contained within this tar.gz are an example of just one way to do this.
* Download the following file - NOTE: wget command may not work because mediafire blocks the direct link to the file.
http://www.mediafire.com/file/034de16ccrr0mdr/SnapStreamFireflyFilesytemRoot.tar.gz
  wget http://www.mediafire.com/file/034de16ccrr0mdr/SnapStreamFireflyFilesytemRoot.tar.gz
* unpackage it
tar xvf ./SnapStreamFireflyFilesytemRoot.tar.gz
* with superuser permsissions copy it to the root of the filesystem
  sudo cp -R ./SnapStreamFireflyFilesytemRoot/* /
* Follow "Integrating your Firefly LIRC commands into XBMC" section below since the Firefly remote is not in there by default. You will need to edit /usr/share/xbmc/system/Lircmap.xml.
* Reboot your computer
sudo reboot
You are now finished. Enjoy your snapstream firefly remote.


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.  


=== Setting up Lirc ===
* Log into the Kodi computer using your SFTP client.
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
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
Play 0x7AA5
Pause 0x7EA9
Stop 0xFD28
Fwd 0xFB26
Rew 0x79A4
Left 0x729D
Right 0xF41F
Up 0x6F9A
Down 0xF722
OK 0x739E
CH+ 0xE00B
CH- 0x618C
EXIT 0x75A0
MENU 0xF11C
OPTION 0x042F
INFO 0x83AE
Next 0x7FAA
Prev 0x002B
MAXIMIZE 0x81AC
Firefly 0xD500
Rec 0xFC27
VOL+ 0x5E89
VOL- 0xDD08
MUTE 0x5F8A
CLOSE 0xD702
Video 0xDC07
Music 0xDB06
Photos 0x5A85
TV 0x5883
A 0x6E99
B 0xF01B
C 0x76A1
D 0xF823
0 0xEC17
1 0x628D
2 0xE30E
3 0x648F
4 0xE510
5 0x6691
6 0xE712
7 0x6893
8 0xE914
9 0x6A95
BACK 0x6B96
DVD 0xD904
Help 0x5681
Mouse 0x022D
ENT 0xED18
end codes
end remote


*Log into the XBMC computer using your SFTP client.
 
*Replace the contents of /etc/lirc/lircd.conf in it's entirety with the following:
and /etc/lirc/hardware.conf
  begin remote
# /etc/lirc/hardware.conf
  name Snapstream Firefly
#
  bits 16
#Chosen Remote Control
  eps 30
REMOTE="Windows Media Center Remotes (new version Philips et al.)"
  aeps 100
REMOTE_MODULES="lirc_dev lirc_mceusb2"
  one 0 0
REMOTE_DRIVER=""
  zero 0 0
REMOTE_DEVICE="/dev/lirc0"
  pre_data_bits 8
REMOTE_LIRCD_CONF="mceusb/lircd.conf.mceusb"
  pre_data 0x14
REMOTE_LIRCD_ARGS=""
  post_data_bits 16
  post_data 0x0
#Chosen IR Transmitter
  gap 235978
TRANSMITTER="None"
  toggle_bit_mask 0x80800000
  TRANSMITTER_MODULES=""
  TRANSMITTER_DRIVER=""
  TRANSMITTER_DEVICE=""
  TRANSMITTER_LIRCD_CONF=""
  TRANSMITTER_LIRCD_ARGS=""
   
  #Enable lircd
  START_LIRCD="true"
   
  #Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"
   
  #Try to load appropriate kernel modules
  LOAD_MODULES="true"
   
   
  begin codes
  # Default configuration files for your hardware if any
  maximize 0x81AC
  LIRCMD_CONF=""
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
  #Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
 
 
 
For more information see Lirc and Lircmap.xml
 
== Integrating your Firefly LIRC commands into Kodi ==


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


=== 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.
* Using your SFTP client, modify /usr/share/xbmc/system/Lircmap.xml to add the following directly below <lircmap> and above <remote device="mceusb">:


<remote device="Snapstream">
<Play>Play</Play>
<pause>Pause</pause>
<stop>Stop</stop>
<forward>Fwd</forward>
<reverse>Rew</reverse>
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
<select>OK</select>
<pageplus>CH+</pageplus>
<pageminus>CH-</pageminus>
<back>MENU</back>
<menu>EXIT</menu>
<title>OPTION</title>
<info>INFO</info>
<skipplus>Next</skipplus>
<skipminus>Prev</skipminus>
<display>MAXIMIZE</display>
<start>Firefly</start>
<record>Rec</record>
<volumeplus>VOL+</volumeplus>
<volumeminus>VOL-</volumeminus>
<mute>MUTE</mute>
<power>CLOSE</power>
<myvideo>Video</myvideo>
<mymusic>Music</mymusic>
<mypictures>Photos</mypictures>
<mytv>TV</mytv>
<mytv>A</mytv>
<myvideo>B</myvideo>
<mymusic>C</mymusic>
<mypictures>D</mypictures>
<zero>0</zero>
<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>
<enter>ENT</enter>
<back>BACK</back>
</remote>
In this configuration, BACK is a redundant button. It calls the same function as MENU and used as a backspace while typing


* Using your SFTP client, modify /etc/share/xbmc/system/Lircmap.xml to add the following directly below <lircmap> and above <remote device="mceusb">:
The following buttons are unused in this configuration.
<remote device="Snapstream">
* HELP
<pause>pause</pause>
* MOUSE
<stop>stop</stop>
* DVD
<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 fix ===
== S3 resume combo Close button fix ==


The funny thing about this remote is; 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 any output by lirc. Resuming from standby with the power button puts the computer back in standby or deactivates the remote.
The funny thing about this remote is; the only button which will allow it to resume the computer from [http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface#Power_States S3] 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 any output 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.
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 SFTP client, create the file /etc/pm/resume.d/99lirc-resume.sh
* Using your SFTP client, create the file /etc/pm/sleep.d/99lirc-resume.sh
*Modify the contents of /etc/pm/sleep.d/99lirc-resume.sh to contain the following:
* Modify the contents of /etc/pm/sleep.d/99lirc-resume.sh to contain the following:
  #!/bin/sh
  #!/bin/sh
    
    
  # This script uses curl.  Install curl by "apt-get install curl" from a terminal.  This script restarts any
  # This script uses curl.  Install curl by "apt-get install curl" from a terminal.  This script restarts any
  # ATI USB compatable device, including the Snapstream Firefly.  It accomplishes this by first restarting the  
  # ATI USB compatable device, including the Snapstream Firefly.  It accomplishes this by first restarting the  
  # ATIUSB device, then restarting LIRC, porting the resident memory command to IRW, kills IRW, then restarts
  # XBMC, then Firefly, then restarting LIRC. It then ports the resident memory command to IRW, waits 1 seccond
  # the XBMC LIRC port.   This script goes in /etc/acpi/resume.d
# and terminates the irw process. Finally, it sends a command back to Kodi to restart lirc input services. 
  # When finished, it reports to /tmp/script.log. This script goes in /etc/pm/sleep.d/99lirc-resume.sh 
   
   
  case "$1" in
  case "$1" in  
  resume)
  resume|thaw)
  sleep 5
  curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"
  sudo rmmod lirc_atiusb
  rmmod lirc_atiusb
  sudo modprobe lirc_atiusb
  modprobe lirc_atiusb
  sudo /etc/init.d/lirc restart >/tmp/resumescript.log
  /etc/init.d/lirc restart  
  irw & sleep 1; killall irw >/tmp/resumescript.log
  irw & sleep 1; killall irw
  sudo curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start" >/tmp/resumescript.log
  curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start"  
  echo "lirc_atiusb resume script completed" >/tmp/script.log
  echo "lirc_atiusb resume script completed" >>/tmp/script.log
  ;;
  ;;
  esac
  esac


You will now need to make the new file executable.
You will now need to make the new file executable.  


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


You will now need to install curl to allow the resume script to send commands to the XBMC event server.  
You will now need to install curl to allow the resume script to send commands to the Kodi event server.  
  sudo apt-get install curl
  sudo apt-get install curl


*Restart the computer
* Restart the computer
 
Your remote will now function properly. For the full feel of a media center device, and quicker load times in XBMC, change Settings-System-Hardware-Shutdown fucntion from Shutdown to Suspend.


Your remote will now function properly.  For the full feel of a media center device, and quicker load times in XBMC, change Settings-System-Hardware-Shutdown fucntion from Shutdown to Suspend.
[[Category:Hardware-Archived]]

Latest revision as of 01:42, 19 July 2020

Time.png THIS PAGE IS OUTDATED:

This page or section has not been updated in a long time, no longer applies, refers to features that have been replaced/removed, and/or may not be reliable.

This page is only kept for historical reasons, or in case someone wants to try updating it.

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 Kodi for Linux and here HOW-TO setup Lirc to talk to XBMC. You will also need a SFTP client and a terminal emulator like WinSCP and Putty.

You will need root access for the following commands.

Setting up the easy way

The following file contains all modifications required to make the Snapstream Firefly work and has been tested under Ubuntu 9.04-10.10 with XBMC-live. This file will map out several features of the remote. The files contained within this tar.gz are an example of just one way to do this.

  • Download the following file - NOTE: wget command may not work because mediafire blocks the direct link to the file.

http://www.mediafire.com/file/034de16ccrr0mdr/SnapStreamFireflyFilesytemRoot.tar.gz

wget http://www.mediafire.com/file/034de16ccrr0mdr/SnapStreamFireflyFilesytemRoot.tar.gz
  • unpackage it
tar xvf ./SnapStreamFireflyFilesytemRoot.tar.gz 
  • with superuser permsissions copy it to the root of the filesystem
sudo cp -R ./SnapStreamFireflyFilesytemRoot/* /
  • Follow "Integrating your Firefly LIRC commands into XBMC" section below since the Firefly remote is not in there by default. You will need to edit /usr/share/xbmc/system/Lircmap.xml.
  • Reboot your computer
sudo reboot

You are now finished. Enjoy your snapstream firefly remote.

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.

  • Log into the Kodi computer using your SFTP client.
  • Replace the contents of /etc/lirc/lircd.conf in it's entirety with the following:
 begin remote
	name Snapstream
	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
		Play 0x7AA5
		Pause 0x7EA9
		Stop 0xFD28
		Fwd 0xFB26
		Rew 0x79A4
		Left 0x729D
		Right 0xF41F
		Up 0x6F9A
		Down 0xF722
		OK 0x739E
		CH+ 0xE00B
		CH- 0x618C
		EXIT 0x75A0
		MENU 0xF11C
		OPTION 0x042F
		INFO 0x83AE
		Next 0x7FAA
		Prev 0x002B
		MAXIMIZE 0x81AC
		Firefly 0xD500
		Rec 0xFC27
		VOL+ 0x5E89
		VOL- 0xDD08
		MUTE 0x5F8A	
		CLOSE 0xD702
		Video 0xDC07
		Music 0xDB06
		Photos 0x5A85
		TV 0x5883
		A 0x6E99
		B 0xF01B
		C 0x76A1
		D 0xF823
		0 0xEC17
		1 0x628D
		2 0xE30E
		3 0x648F
		4 0xE510
		5 0x6691
		6 0xE712
		7 0x6893
		8 0xE914
		9 0x6A95
		BACK 0x6B96
		DVD 0xD904
		Help 0x5681 
		Mouse 0x022D
		ENT 0xED18
	end codes
end remote 


and /etc/lirc/hardware.conf

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Windows Media Center Remotes (new version Philips et al.)"
REMOTE_MODULES="lirc_dev lirc_mceusb2"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_LIRCD_CONF="mceusb/lircd.conf.mceusb"
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true" 

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""


For more information see Lirc and Lircmap.xml

Integrating your Firefly LIRC commands into Kodi

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


  • Using your SFTP client, modify /usr/share/xbmc/system/Lircmap.xml to add the following directly below <lircmap> and above <remote device="mceusb">:
	<remote device="Snapstream">
		<Play>Play</Play>
		<pause>Pause</pause>
		<stop>Stop</stop>
		<forward>Fwd</forward>
		<reverse>Rew</reverse>
		<left>Left</left>
		<right>Right</right>
		<up>Up</up>
		<down>Down</down>
		<select>OK</select>
		<pageplus>CH+</pageplus>
		<pageminus>CH-</pageminus>
		<back>MENU</back>
		<menu>EXIT</menu>
		<title>OPTION</title>
		<info>INFO</info>
		<skipplus>Next</skipplus>
		<skipminus>Prev</skipminus>
		<display>MAXIMIZE</display>
		<start>Firefly</start>
		<record>Rec</record>
		<volumeplus>VOL+</volumeplus>
		<volumeminus>VOL-</volumeminus>
		<mute>MUTE</mute>
		<power>CLOSE</power>
		<myvideo>Video</myvideo>
		<mymusic>Music</mymusic>
		<mypictures>Photos</mypictures>
		<mytv>TV</mytv>
		<mytv>A</mytv>
		<myvideo>B</myvideo>
		<mymusic>C</mymusic>
		<mypictures>D</mypictures>
		<zero>0</zero>
		<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>
		<enter>ENT</enter>
		<back>BACK</back>
	</remote>

In this configuration, BACK is a redundant button. It calls the same function as MENU and used as a backspace while typing

The following buttons are unused in this configuration.

  • HELP
  • MOUSE
  • DVD


S3 resume combo Close button fix

The funny thing about this remote is; the only button which will allow it to resume the computer from S3 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 any output 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 SFTP client, create the file /etc/pm/sleep.d/99lirc-resume.sh
  • Modify the contents of /etc/pm/sleep.d/99lirc-resume.sh to contain the following:
#!/bin/sh
 
# This script uses curl.  Install curl by "apt-get install curl" from a terminal.   This script restarts any
# ATI USB compatable device, including the Snapstream Firefly.  It accomplishes this by first restarting the 
# XBMC, then Firefly, then restarting LIRC. It then ports the resident memory command to IRW, waits 1 seccond 
# and terminates the irw process. Finally, it sends a command back to Kodi to restart lirc input services.  
# When finished, it reports to /tmp/script.log.  This script goes in /etc/pm/sleep.d/99lirc-resume.sh  

case "$1" in 
	resume|thaw)
		curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Stop"
		rmmod lirc_atiusb
		modprobe lirc_atiusb
		/etc/init.d/lirc restart 
		irw & sleep 1; killall irw
		curl "http://127.0.0.1:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=LIRC.Start" 
		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

You will now need to install curl to allow the resume script to send commands to the Kodi event server.

sudo apt-get install curl
  • Restart the computer

Your remote will now function properly. For the full feel of a media center device, and quicker load times in XBMC, change Settings-System-Hardware-Shutdown fucntion from Shutdown to Suspend.