Skip to content

Instantly share code, notes, and snippets.

@gkostadinov
Created May 7, 2015 14:03
Show Gist options
  • Save gkostadinov/40395b151d23d442d25b to your computer and use it in GitHub Desktop.
Save gkostadinov/40395b151d23d442d25b to your computer and use it in GitHub Desktop.
Raspberry Cinema Installation Steps - v1.0

Raspberry Cinema Installation Steps

Initial Setup

  1. Install MINIBIAN
  2. Change root password using passwd to 1%T9gjMkgaIn
  3. apt-get update to update package lists
  4. apt-get install vim sudo htop rpi-update raspi-config usbutils dosfstools -y to install some essentials
  5. Run raspi-config:
    1. Choose 7. Overclock then Pi2
    2. Choose 1. Expand Filesystem
    3. Choose Finish then Yes to reboot
  6. rpi-update to update firmware
  7. Run reboot
  8. apt-get upgrade -y to upgrade packages
  9. apt-get dist-upgrade -y to ugprade distro
  10. apt-get install firmware-linux-nonfree wireless-tools wpasupplicant -y to install wireless firmware
  11. adduser cinema to add user with name cinema and password p!303$LhZVpN
  12. usermod -G sudo cinema to add user cinema to sudo group
  13. Then run sudo apt-get clean
  14. Finally reboot and login as cinema

Install 8188eu Wireless Driver

  1. Make directory Downloads, then cd Downloads
  2. mkdir 8188eu-driver, then cd 8188eu-driver
  3. wget https://dl.dropboxusercontent.com/u/80256631/install-8188eu.tgz
  4. tar -zxvf install-8188eu.tgz
  5. ./install-8188eu.sh

Setup Wireless

  1. Run sudo vim /etc/network/interfaces
  2. Add the following at the bottom of the file (press i): allow-hotplug wlan0 auto wlan0 iface wlan0 inet dhcp     pre-up wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B Now the RPi will connect automatically to available Wi-Fi networks.
  3. Now add the following: iface usb0 inet static     address 192.168.42.42     netmask 255.255.255.0     network 192.168.42.0     broadcast 192.168.42.255 RPi can now connect through USB tethering from your Android phone. Press ESC and enter :wq to save and quit.
  4. Run sudo /etc/wpa_supplicant/wpa_supplicant.conf. Add the following: ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev ap_scan=2 update_config=1 network={     ssid="YOUR_SSID"     psk="YOUR_SSID_PASS"     proto=RSN     key_mgmt=WPA-PSK     pairwise=TKIP } Edit the network details, then ESC and enter :wq to save and quit.
  5. Run echo PATH="/sbin:\$PATH" >> ~/.profile
  6. Reboot with sudo reboot
  7. If everything is OK, wlan0 will be available when you run ifconfig

Install Kodi

  1. Run sudo vim /etc/apt/sources.list.d/mene.list
  2. Add the following (press i): deb http://archive.mene.za.net/raspbian wheezy contrib Press ESC, then :wq to save and quit.
  3. Import the archive signing key: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 5243CDED
  4. sudo apt-get update
  5. sudo apt-get install kodi -y to install Kodi
  6. The installation added a user kodi. Our kodi user must be a member of these groups: audio video input dialout plugdev tty cinema
  7. Run the following command sudo usermod -a -G <GROUP> kodi for each <GROUP> above. If a group does not exist, create it with sudo addgroup --system <GROUP>
  8. To enable keyboard support in Kodi, add the following udev rules to /etc/udev/rules.d/99-input.rules: # input KERNEL=="mouse*|mice|event*", MODE="0660", GROUP="input" KERNEL=="ts[0-9]|uinput", MODE="0660", GROUP="input" KERNEL=="js[0-9]", MODE="0660", GROUP="input" # tty KERNEL=="tty[0-9]*", MODE="0666" # vchiq SUBSYSTEM=="vchiq", GROUP="video", MODE="0660"
  9. Kodi need at least 96MB RAM to run normally. To configure this, change gpu_mem in /boot/config.txt to 128: gpu_mem=128
  10. Edit /etc/default/kodi and change the following: ENABLED=1 - in order to start Kodi automatically on boot
  11. Reboot using sudo reboot and after the reboot, Kodi will start automatically

Setup and Customize Kodi

  1. If you have a Mac computer, you might want to share Airport content. In order to do that, you must install the avahi package: sudo apt-get install avahi-utils -y
  2. SFTP connect to the RPi with root user
  3. Upload kodi(TODO: Must upload .kodi to some cloud and put link here) directory to /home/kodi
  4. Go to the terminal, cd /home/kodi, then rm .kodi and sudo mv kodi .kodi
  5. Reboot and voila

Install Filebot and Mediainfo

  1. Install JDK 8:
    1. mkdir ~/Downloads/JDK, then cd ~/Downloads/JDK
    2. Get the latest JDK from https://jdk8.java.net/download.html: wget --no-check-certificate http://www.java.net/download/jdk8u60/archive/b13/binaries/jdk-8u60-ea-bin-b13-linux-arm-vfp-hflt-28_apr_2015.tar.gz
    3. Unarchive: sudo tar zxvf jdk-8u60-ea-bin-b13-linux-arm-vfp-hflt-28_apr_2015.tar.gz -C /opt
    4. Make symlink for java: sudo ln -s /opt/jdk1.8.0_60/bin/java /usr/bin/java
    5. And jar: sudo ln -s /opt/jdk1.8.0_60/bin/jar /usr/bin/jar
    6. Test if it works: java -version
  2. Install Filebot:
    1. cd ~/Downloads, then mkdir Filebot and cd Filebot
    2. Get the latest ARM version of Filebot from http://sourceforge.net/projects/filebot/: wget http://sourceforge.net/projects/filebot/files/filebot/FileBot_4.5.6/filebot_4.5.6_arm.ipk/download -O filebot.ipk
    3. mkdir /tmp/filebot and sudo mv filebot.ipk /tmp/filebot
    4. cd /tmp/filebot and ar -x filebot.ipk
    5. tar zxvf data.tar.gz
    6. sudo cp -r opt/share/* /usr/share/
    7. sudo ln -s /usr/share/filebot/bin/filebot.sh /usr/bin/filebot
  3. Configure Filebot:
    1. cd /usr/share/filebot/bin
    2. sudo cp –p filebot.sh filebot.sh_old
    3. sudo vim /usr/share/filebot/bin/filebot.sh
    4. Replace the content with this one: https://gist.github.com/gkostadinov/e16bd0f47663001ba2e0
  4. Install JNA 4:
    1. sudo apt-get install libjna-java
    2. mkdir /tmp/jna-4.1.0 and cd /tmp/jna-4.1.0
    3. wget https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar
    4. wget https://maven.java.net/content/repositories/releases/net/java/dev/jna/jna-platform/4.1.0/jna-platform-4.1.0.jar
    5. jar xf jna-4.1.0.jar
    6. cd /usr/lib/jni
    7. sudo cp -p /tmp/jna-4.1.0/com/sun/jna/linux-arm/libjnidispatch.so libjnidispatch_4.1.0.so
    8. rm libjnidispatch.so and sudo ln -s libjnidispatch_4.1.0.so libjnidispatch.so
    9. cd /usr/share/java
    10. sudo rm jna.jar jna-platform.jar
    11. sudo cp /tmp/jna-4.1.0/*.jar .
    12. sudo ln -s jna-4.1.0.jar jna.jar
    13. sudo ln -s jna-platform-4.1.0.jar jna-platform.jar
    14. Test with java -jar jna.jar. Should output Version: 4.1.0
  5. Install and setup MediaInfo:
    1. sudo apt-get install mediainfo
    2. cd /usr/share/filebot
    3. sudo mv libzen.so libzen.so_old
    4. sudo mv libmediainfo.so libmediainfo.so_old
    5. sudo ln -s /usr/lib/arm-linux-gnueabihf/libmediainfo.so.0 libmediainfo.so
    6. sudo ln -s /usr/lib/arm-linux-gnueabihf/libzen.so.0 libzen.so
  6. Finally test if everything works: sudo filebot -script "fn:sysinfo". You should see something like this: FileBot 4.5.6 (r2818) JNA Native: 4.0.0 MediaInfo: MediaInfoLib - v0.7.58 7-Zip-JBinding: ERROR chromaprint-tools: fpcalc version 1.1.0 (/usr/share/filebot/fpcalc) Extended Attributes: OK Groovy Engine: 2.3.9 JRE: Java(TM) SE Runtime Environment 1.8.0_60-ea (headless) JVM: 32-bit Java HotSpot(TM) Client VM CPU/MEM: 4 Core / 208 MB Max Memory / 9 MB Used Memory OS: Linux (arm) uname: Linux raspberrypi 3.18.12-v7+ #782 SMP PREEMPT Tue Apr 28 19:54:13 BST 2015 armv7l GNU/Linux Done ヾ(@⌒ー⌒@)ノ

Install Transmission

1. Install it with `sudo apt-get install transmission-daemon -y`
  1. Go to Downloads - cd Downloads
  2. Make Complete and Inprogress directories: mkdir Inprogress & mkdir Complete
  3. Change permissions to 770: chmod 770 Inprogress chmod 770 Complete
  4. Create Media directory: mkdir ~/Media, mkdir ~/Media/Movies ~/Media/TV\ Shows ~/Media/Music ~/Media/Pictures and sudo chmod -R 770 ~/Media
  5. Transmission runs by default with user debian-transmission. Let's add this user to group cinema so that it has rights to modify the directories we created: sudo usermod -a -G cinema debian-transmission
  6. Configure Transmission. Open Transmission settings: sudo vim /etc/transmission-daemon/settings.json
  7. Replace the settings with these here: https://gist.github.com/gkostadinov/86e9768e153a7212db87
  8. Create a postprocess script that will run after a torrent completes: sudo vim /etc/transmission-daemon/transmission-postprocess The script runs Filebot and organizes your library.
  9. Add this content to the script: https://gist.github.com/gkostadinov/bbe96a58ae3d7cea4066
  10. sudo chmod +x /etc/transmission-daemon/transmission-postprocess and sudo chown debian-transmission:debian-transmission /etc/transmission-daemon/transmission-postprocess and sudo chown -R debian-transmission:debian-transmission /usr/share/filebot so that Transmission can run the script.
  11. Reload the daemon: sudo service transmission-daemon reload
  12. Open your browser and navigate to http://<YOUR_RPI_ADDRESS>:9091/
  13. Enter raspberrycinema for username and c1n3mat1c for password
  14. That's it! Now you can download torrents from here to your Raspberry Pi. Note: If the postprocess script does not work, it is propbaly due to permission errors. To fix this edit /etc/init.d/transmission-daemon and set USER to root (generally not a good idea, but it is an easy fix).
@Pomax
Copy link

Pomax commented Mar 2, 2020

dropbox links for 8188 is dead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment