Raspbian: Difference between revisions

From Q
Jump to navigation Jump to search
Tgurr (talk | contribs)
Tgurr (talk | contribs)
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Install ==
== Install ==
dd bs=4M if=2016-09-23-raspbian-jessie-lite.img of=/dev/sdX
dd bs=4M if=2019-07-10-raspbian-buster-lite.img of=/dev/sdX conv=fsync


== Login ==
== Login ==
Line 6: Line 6:


Default password: raspberry
Default password: raspberry
== Static IP ==
/etc/dhcpcd.conf
<pre>
interface eth0
static ip_address=192.168.0.16/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
</pre>


== Update ==
== Update ==
sudo apt-get update
sudo apt update


sudo apt-get upgrade
sudo apt upgrade


== Configuration ==
== Configuration ==
Line 17: Line 28:


<pre>
<pre>
9 Advanced Options -> A0 Update
8 Update
1 Expand Filesystem
7 Advanced Options -> A1 Expand Filesystem
3 Boot Options -> B1 Console
4 Localisation Options -> I1 Change Locale -> de_DE.UTF-8 UTF-8
5 Internationalisation Options -> I1 Change Locale -> de_DE.UTF-8 UTF-8
4 Localisation Options -> I2 Change Timezone -> Europe -> Berlin
5 Internationalisation Options -> I2 Change Timezone -> Europe -> Berlin
4 Localisation Options -> I3 Change Keyboard Layout -> Generic 105-key (Intl) PC -> Other -> German -> German ->  
5 Internationalisation Options -> I3 Change Keyboard Layout -> Generic 105-key (Intl) PC -> Other -> German -> German -> rest default
4 Localisation Options -> I4 Change Wi-fi Country -> DE
5 Interfacing Options -> P2 SSH -> Yes
</pre>
=== Kodi ===
<pre>
7 Advanced Options -> A3 Memory Split -> 256
7 Advanced Options -> A4 Audio -> 2 Force HDMI
</pre>
</pre>


=== PiFace ===
=== PiFace ===
9 Advanced Options -> A5 SPI -> Yes -> Ok -> Yes
<pre>
5 Interfacing Options -> P4 SPI -> Yes -> Ok -> Yes
</pre>


=== Camera ===
=== Camera ===
6 Enable Camera -> Enable
<pre>
5 Interfacing Options -> P1 Camera -> Enable
</pre>


=== HiFiBerry AMP+ ===
=== HiFiBerry General ===


/boot/config.txt
/boot/config.txt
Line 40: Line 61:
#dtparam=audio=on
#dtparam=audio=on
</pre>
</pre>
=== HiFiBerry AMP+ ===
/boot/config.txt


Enable AMP/AMP+
Enable AMP/AMP+
Line 47: Line 72:
</pre>
</pre>


amixer sset Master 70%
sudo amixer sset Master 70%
 
sudo amixer sset Channels 70%,70%
 
=== HiFiBerry AMP2 ===
 
/boot/config.txt
 
Enable AMP2
<pre>
# Enable audio (HiFiBerry AMP2)
dtoverlay=hifiberry-dacplus
</pre>
 
sudo amixer sset Digital 90%
 
== Kodi ==
=== Repository ===
==== Add ====
 
Currently we need to use an external repository for Kodi 18.
 
<pre>
sudo su
echo "deb https://pipplware.pplware.pt/pipplware/dists/buster/main/binary /" > /etc/apt/sources.list.d/pipplware_buster.list
wget -O - https://pipplware.pplware.pt/pipplware/key.asc | sudo apt-key add -
apt update && apt dist-upgrade -y
exit
</pre>
 
==== Remove ====
<pre>
sudo rm /etc/apt/sources.list.d/pipplware_buster.list
sudo apt update -y
sudo apt remove kodi*
</pre>
 
=== Installation ===
<pre>
sudo apt search kodi*
sudo apt install kodi
sudo apt install kodi-inputstream-adaptive
sudo apt install kodi-vfs-nfs
sudo apt install udisks2
</pre>
 
<pre>
sudo useradd -m -U -G "audio,bluetooth,input,plugdev,video" -s /bin/bash kodi
</pre>
 
<pre>
/etc/systemd/system/kodi.service
 
[Unit]
Description = Kodi Media Center
After = systemd-user-sessions.service network.target sound.target
 
[Service]
User = kodi
Group = kodi
Type = simple
ExecStart = /usr/bin/kodi-standalone
Restart = always
RestartSec = 15
 
[Install]
WantedBy = multi-user.target
</pre>
 
<pre>
/etc/polkit-1/localauthority/50-local.d/kodi-reboot.pkla
 
[Actions for kodi user]
Identity=unix-user:kodi
Action=org.freedesktop.login1.*;org.freedesktop.upower.*;org.freedesktop.udisks2.*
ResultActive=yes
ResultAny=yes
ResultInactive=yes
</pre>
 
<pre>
/boot/config.txt
 
hdmi_ignore_cec_init=1
</pre>
 
<pre>
sudo systemctl daemon-reload
sudo systemctl enable kodi
sudo systemctl start kodi
</pre>
 
=== Plugins ===
==== Netflix ====
https://github.com/castagnait/repository.castagnait/raw/master/repository.castagnait-1.0.0.zip
 
The Netflix Plugin complains about not being able to import pycryptodomex so we need to install it manually https://www.raspberrypi.org/documentation/linux/software/python.md.
 
<pre>
# sudo apt install python-pip
# sudo su -l kodi
kodi $ pip install pycryptodomex
</pre>
 
==== Amazon Prime (Amazon VOD) ====
https://github.com/Sandmann79/xbmc/releases/download/v1.0.2/repository.sandmann79.plugins-1.0.2.zip
 
==== InputStream Helper ====
The InputStream Helper does some fancy magic to download and install Widevine CDM, for this it needs to run several commands as root, like e.g. mount, unmount, losetup and modprobe. It supports running these commands via sudo so grant the kodi user the right to run sudo. The sudoers file can be removed afterwards, but might be needed again when there's an update.
 
<pre>
/etc/sudoers.d/010_kodi-nopasswd
 
kodi ALL=(ALL) NOPASSWD: ALL
</pre>
 
After that IntputStream Helper might complain about libnss3.so, libnssutil3.so and libnspr4.so might be needed for Widevine CDM, so we install libnss3 which pulls in libnspr4 as it's dependency:
 
<pre>
sudo apt install libnss3
</pre>
 
==== Steam Link ====
https://github.com/bigbrozer/kodi-steamlink-launcher/releases/download/v0.0.2/kodi-steamlink-launcher-v0.0.2.zip
 
<pre>
/etc/sudoers.d/steamlink-kodi
 
kodi ALL=(root) NOPASSWD: /bin/systemctl stop kodi, /bin/systemctl restart kodi, /bin/openvt
</pre>
 
== Snapcast ==
=== Installation ===
Download the latest snapclient release from https://github.com/badaix/snapcast/releases e.g. snapclient_0.15.0_armhf.deb


amixer sset Channels 70%,70%
Install via
 
sudo dpkg -i snapclient_0.15.0_armhf.deb
 
Install missing dependencies:
 
sudo apt -f install
 
sudo systemctl enable snapclient
 
== Steam Link ==
<pre>
sudo apt install steamlink
</pre>
And also some required dependencies steamlink will complain about when launching it.
<pre>
sudo apt install libxcb-xkb1
sudo apt install libxkbcommon-x11-0
sudo apt install cec-utils
</pre>


== DoorPi ==
== DoorPi ==
Line 72: Line 249:
==== mjpg-streamer ====
==== mjpg-streamer ====


apt-get install cmake libjpeg-dev
apt install cmake libjpeg-dev


wget https://github.com/jacksonliam/mjpg-streamer/archive/master.tar.gz
wget https://github.com/jacksonliam/mjpg-streamer/archive/master.tar.gz
Line 92: Line 269:


Default password: pi
Default password: pi
== Snapcast ==
=== Installation ===
Download the latest snapclient release from https://github.com/badaix/snapcast/releases e.g. snapclient_0.10.0_armhf.deb
Install via
sudo dpkg -i snapclient_0.10.0_armhf.deb
Install missing dependencies:
sudo apt-get -f install
sudo systemctl enable snapclient

Latest revision as of 16:40, 5 September 2020

Install

dd bs=4M if=2019-07-10-raspbian-buster-lite.img of=/dev/sdX conv=fsync

Login

Default user: pi

Default password: raspberry

Static IP

/etc/dhcpcd.conf

interface eth0
static ip_address=192.168.0.16/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Update

sudo apt update

sudo apt upgrade

Configuration

sudo raspi-config

8 Update
7 Advanced Options -> A1 Expand Filesystem
4 Localisation Options -> I1 Change Locale -> de_DE.UTF-8 UTF-8
4 Localisation Options -> I2 Change Timezone -> Europe -> Berlin
4 Localisation Options -> I3 Change Keyboard Layout -> Generic 105-key (Intl) PC -> Other -> German -> German -> 
4 Localisation Options -> I4 Change Wi-fi Country -> DE
5 Interfacing Options -> P2 SSH -> Yes

Kodi

7 Advanced Options -> A3 Memory Split -> 256
7 Advanced Options -> A4 Audio -> 2 Force HDMI

PiFace

5 Interfacing Options -> P4 SPI -> Yes -> Ok -> Yes

Camera

5 Interfacing Options -> P1 Camera -> Enable

HiFiBerry General

/boot/config.txt

Disable onboard sound:

# Enable audio (loads snd_bcm2835)
#dtparam=audio=on

HiFiBerry AMP+

/boot/config.txt

Enable AMP/AMP+

# Enable audio (HiFiBerry AMP/AMP+)
dtoverlay=hifiberry-amp

sudo amixer sset Master 70%

sudo amixer sset Channels 70%,70%

HiFiBerry AMP2

/boot/config.txt

Enable AMP2

# Enable audio (HiFiBerry AMP2)
dtoverlay=hifiberry-dacplus

sudo amixer sset Digital 90%

Kodi

Repository

Add

Currently we need to use an external repository for Kodi 18.

sudo su
echo "deb https://pipplware.pplware.pt/pipplware/dists/buster/main/binary /" > /etc/apt/sources.list.d/pipplware_buster.list
wget -O - https://pipplware.pplware.pt/pipplware/key.asc | sudo apt-key add -
apt update && apt dist-upgrade -y
exit

Remove

sudo rm /etc/apt/sources.list.d/pipplware_buster.list
sudo apt update -y
sudo apt remove kodi*

Installation

sudo apt search kodi*
sudo apt install kodi
sudo apt install kodi-inputstream-adaptive
sudo apt install kodi-vfs-nfs
sudo apt install udisks2
sudo useradd -m -U -G "audio,bluetooth,input,plugdev,video" -s /bin/bash kodi
/etc/systemd/system/kodi.service

[Unit]
Description = Kodi Media Center
After = systemd-user-sessions.service network.target sound.target

[Service]
User = kodi
Group = kodi
Type = simple
ExecStart = /usr/bin/kodi-standalone
Restart = always
RestartSec = 15

[Install]
WantedBy = multi-user.target
/etc/polkit-1/localauthority/50-local.d/kodi-reboot.pkla

[Actions for kodi user]
Identity=unix-user:kodi
Action=org.freedesktop.login1.*;org.freedesktop.upower.*;org.freedesktop.udisks2.*
ResultActive=yes
ResultAny=yes
ResultInactive=yes
/boot/config.txt

hdmi_ignore_cec_init=1
sudo systemctl daemon-reload
sudo systemctl enable kodi
sudo systemctl start kodi

Plugins

Netflix

https://github.com/castagnait/repository.castagnait/raw/master/repository.castagnait-1.0.0.zip

The Netflix Plugin complains about not being able to import pycryptodomex so we need to install it manually https://www.raspberrypi.org/documentation/linux/software/python.md.

# sudo apt install python-pip
# sudo su -l kodi
kodi $ pip install pycryptodomex

Amazon Prime (Amazon VOD)

https://github.com/Sandmann79/xbmc/releases/download/v1.0.2/repository.sandmann79.plugins-1.0.2.zip

InputStream Helper

The InputStream Helper does some fancy magic to download and install Widevine CDM, for this it needs to run several commands as root, like e.g. mount, unmount, losetup and modprobe. It supports running these commands via sudo so grant the kodi user the right to run sudo. The sudoers file can be removed afterwards, but might be needed again when there's an update.

/etc/sudoers.d/010_kodi-nopasswd

kodi ALL=(ALL) NOPASSWD: ALL

After that IntputStream Helper might complain about libnss3.so, libnssutil3.so and libnspr4.so might be needed for Widevine CDM, so we install libnss3 which pulls in libnspr4 as it's dependency:

sudo apt install libnss3

Steam Link

https://github.com/bigbrozer/kodi-steamlink-launcher/releases/download/v0.0.2/kodi-steamlink-launcher-v0.0.2.zip

/etc/sudoers.d/steamlink-kodi

kodi ALL=(root) NOPASSWD: /bin/systemctl stop kodi, /bin/systemctl restart kodi, /bin/openvt

Snapcast

Installation

Download the latest snapclient release from https://github.com/badaix/snapcast/releases e.g. snapclient_0.15.0_armhf.deb

Install via

sudo dpkg -i snapclient_0.15.0_armhf.deb

Install missing dependencies:

sudo apt -f install

sudo systemctl enable snapclient

Steam Link

sudo apt install steamlink

And also some required dependencies steamlink will complain about when launching it.

sudo apt install libxcb-xkb1
sudo apt install libxkbcommon-x11-0
sudo apt install cec-utils

DoorPi

Installation

sudo easy_install pip || (wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python) && sudo easy_install pip

sudo pip install linphone4raspberry python-daemon

sudo pip install doorpi && sudo doorpi_cli --trace

cd /tmp

wget https://raw.githubusercontent.com/motom001/DoorPi/master/doorpi/docs/service/create_daemon_file.py -O - | sudo python

sudo systemctl daemon-reload

sudo systemctl enable doorpi

sudo systemctl start doorpi

mjpg-streamer

apt install cmake libjpeg-dev

wget https://github.com/jacksonliam/mjpg-streamer/archive/master.tar.gz

tar xf master.tar.gz

cd mjpg-streamer-experimental

make

sudo make install

mjpg_streamer -i "input_raspicam.so" -o "output_http.so -n -w /usr/local/www -p 9000"

mjpg_streamer -i "input_uvc.so -d /dev/video0 -n -r 1024x768 -f 24 –q 80 -l off " -o "output_http.so -n -w /usr/local/www -p 9000"

Webinterface

Default user: door

Default password: pi