Skip to content

Instantly share code, notes, and snippets.

@probonopd
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save probonopd/313ec9dea0e44b304c6f to your computer and use it in GitHub Desktop.

Select an option

Save probonopd/313ec9dea0e44b304c6f to your computer and use it in GitHub Desktop.
Raspberry Pi 2 Media Center
begin remote
name input
flags RAW_CODES
eps 30
aeps 100
gap 96193
begin raw_codes
name KEY_UP
9041 4507 573 573 573 573
573 573 573 573 573 573 `
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 573
573 573 573 573 573 573
573 573 573 1694 573 573
573 573 573 1694 573 1694
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_DOWN
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 573
573 1694 573 573 573 573
573 573 573 1694 573 573
573 573 573 1694 573 573
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_MENU
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 573 573 1694
573 573 573 573 573 1694
573 573 573 1694 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_OK
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 1694
573 1694 573 573 573 573
573 573 573 1694 573 573
573 1694 573 573 573 573
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_ESC
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 573 573 573
573 573 573 573 573 1694
573 573 573 1694 573 1694
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_LEFT
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 1694
573 1694 573 573 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 573
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_RIGHT
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 1694 573 573 573 1694
573 1694 573 573 573 573
573 573 573 573 573 573
573 1694 573 573 573 573
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_RED
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 573
573 573 573 573 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_GREEN
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 573 573 573
573 573 573 573 573 1694
573 573 573 1694 573 1694
573 1694 573 1694 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_YELLOW
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 573 573 1694 573 1694
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_BLUE
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 1694 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_0
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 1694
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_1
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 573
573 1694 573 573 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 573
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_2
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 573 573 573
573 1694 573 573 573 1694
573 573 573 1694 573 1694
573 1694 573 1694 573 573
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_3
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 573 573 573
573 1694 573 573 573 573
573 573 573 1694 573 1694
573 1694 573 1694 573 573
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_4
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 573
573 1694 573 573 573 1694
573 573 573 1694 573 573
573 573 573 1694 573 573
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_5
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 1694 573 573
573 1694 573 573 573 1694
573 573 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_6
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 1694 573 573
573 1694 573 573 573 573
573 573 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_7
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 1694
573 573 573 573 573 1694
573 573 573 1694 573 573
573 573 573 573 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_8
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 1694 573 1694
573 573 573 573 573 1694
573 573 573 1694 573 1694
573 573 573 573 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_9
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 1694 573 1694
573 573 573 573 573 573
573 573 573 1694 573 1694
573 573 573 573 573 1694
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_EPG
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 573 573 1694 573 1694
573 573 573 573 573 1694
573 573 573 573 573 1694
573 573 573 573 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_PLAY
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 573
573 573 573 573 573 1694
573 573 573 1694 573 573
573 573 573 1694 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_PAUSE
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 1694 573 573
573 573 573 573 573 1694
573 573 573 1694 573 1694
573 573 573 1694 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_STOP
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 1694 573 573
573 573 573 573 573 573
573 573 573 1694 573 1694
573 573 573 1694 573 1694
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_RECORD
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 1694 573 1694 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 573 573 1694 573 1694
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_FASTFORWARD
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 573 573 573 573 1694
573 573 573 573 573 1694
573 573 573 1694 573 1694
573 1694 573 573 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_REWIND
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 1694
573 573 573 573 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 1694
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_INFO
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 1694 573 1694 573 573
573 1694 573 573 573 573
573 573 573 573 573 573
573 573 573 1694 573 573
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_POWER
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 573 573 573 573 1694
573 1694 573 573 573 1694
573 573 573 573 573 1694
573 1694 573 573 573 573
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_MUTE
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 573 573 573 573 1694
573 1694 573 573 573 573
573 573 573 573 573 1694
573 1694 573 573 573 573
573 1694 573 1694 573 1694
573 40906 9041 2267 573
name KEY_TEXT
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 573 573 573 573 573
573 1694 573 573 573 1694
573 573 573 573 573 1694
573 1694 573 1694 573 573
573 1694 573 573 573 1694
573 40906 9041 2267 573
name KEY_AUDIO
9041 4507 573 573 573 573
573 573 573 573 573 573
573 573 573 573 573 573
573 1694 573 1694 573 1694
573 1694 573 1694 573 1694
573 573 573 1694 573 1694
573 573 573 1694 573 573
573 1694 573 573 573 573
573 573 573 573 573 1694
573 573 573 1694 573 573
573 1694 573 1694 573 1694
573 40906 9041 2267 573
end raw_codes
end remote

I am experimenting with different solutions for a Raspberry Pi 2 Media Center. Both run KODI, the successor of XBMC.

Raspberry Pi

mount /flash -o remount,rw
nano /flash/config.txt

The following settings should be placed in config.txt of the boot partition:

# Enable infrared
dtoverlay=lirc-rpi

# Enable USB hard disk power
safe_mode_gpio=4
max_usb_current=1

OpenELEC

OpenELEC uses a read-only squashfs filesystem which is probably more robust than the read-write filesystem in OMSC.

Spin down hard disk

To spin down the hard disk, add hdparm -S12 /dev/sda to autostart.sh which you can easily access as a network share in the Configfiles directory.

Edit /flash/config.txt

I use the following Raspberry Pi config.txt settings

# Enable infrared
dtoverlay=lirc-rpi

# Enable USB hard disk power
safe_mode_gpio=4
max_usb_current=1

# Speed up
boot_delay=0
disable_splash=1

Edit /flash/cmdline.txt

I use the following cmdline.txt to make the boot even quieter and remove any kernel output:

boot=/dev/mmcblk0p1 disk=/dev/mmcblk0p2 quiet console=null 

Infrared remote

To install codes for a particular remote, put them into /storage/.config/lircd.conf. Note that we have to write to /storage because the rest of the system is read-only (this works similar to what OpenWrt does with /overlay). The example below is for a XORO HRS 8530 SAT Remote.

Make it load the kernel module with echo "modprobe lirc_rpi" >> /storage/.config/autostart.sh

Samsung remote control over HDMI

CEC allows to use the Samsung Smart TV remote control over HDMI without the need for an infrared receiver on the Raspberry Pi. To make the RETURN key work as intended, we need to remap it:

cp /usr/share/kodi/system/keymaps/remote.xml /storage/.kodi/userdata/keymaps/
sed -i -e 's|<title>ContextMenu</title>|<title>Back</title>|g' /storage/.kodi/userdata/keymaps/remote.xml
reboot

Note that we have to write to /storage because the rest of the system is read-only (this works similar to what OpenWrt does with /overlay).

OSMC

OSMC uses apt-get under the hood and is probably easier to customize than OpenELEC.

Infrared remote

sudo modprobe lirc_rpi
sudo kill $(pidof lircd)
mode2 -d /dev/lirc0 # press keys to see some output

To install codes for a particular remote, simply put them into $HOME/lircd.conf - the corresponding file from /etc links there in OSMC.

lircd.conf for XORO HRS 8530 SAT remote control generated with pronto2lirc using pronto hex codes generated from irdb.tk (I think this gives "cleaner" timings than using irrecord)

http://forum.osmc.tv/showthread.php?tid=6201&pid=116497#pid116497

Note that the lirc_rpi kernel module was not inserted automatically for me, so I had to add modprobe lirc_rpi to /usr/bin/mediacenter.

Samsung remote control over HDMI

CEC allows to use the Samsung Smart TV remote control over HDMI without the need for an infrared receiver on the Raspberry Pi. To make the RETURN key work as intended, we need to remap it:

sudo sed -i -e 's|<title>ContextMenu</title>|<title>Back</title>|g' /usr/share/kodi/system/keymaps/remote.xml

German Live TV Streaming

First, activate the PVR IPTV Simple Client.

Optionen → Addons → Aus Repository installieren → Openelec Mediacenter OS Add-ons → PVR-Clients → PVR IPTV Simple Client

With this one can watch most Free TV channels. There is also https://wownet.ro/ which apparently does a similar thing.

me@host:~$ cat /run/user/999/gvfs/sftp:host=openelec.local/storage/.kodi/userdata/addon_data/pvr.iptvsimple/settings.xml
<settings>
    <setting id="epgCache" value="true" />
    <setting id="epgPath" value="" />
    <setting id="epgPathType" value="1" />
    <setting id="epgTSOverride" value="false" />
    <setting id="epgTimeShift" value="0.000000" />
    <setting id="epgUrl" value="http://guide.tvip.ga/epg.xml.gz" />
    <setting id="logoBaseUrl" value="http://logo.tvip.ga/" />
    <setting id="logoPath" value="" />
    <setting id="logoPathType" value="1" />
    <setting id="m3uCache" value="true" />
    <setting id="m3uPath" value="" />
    <setting id="m3uPathType" value="1" />
    <setting id="m3uUrl" value="http://play.tvip.ga/iptvde.m3u" />
    <setting id="sep1" value="" />
    <setting id="sep2" value="" />
    <setting id="sep3" value="" />
    <setting id="startNum" value="1" />
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment