{{tag> infoboard lubuntu}}
====== Infoboard mit Raspberry-Pi ======
Der Raspberry Pi ist ein ca. 9cm x 6cm großer Einplatinen-Computer mit einer 700 MHz ARM-CPU. -> [[http://de.wikipedia.org/wiki/Raspberry_Pi|Wikipedia]]. Für ein Digitales Infobrett ist nur das Model B mit Netzwerkanschluss brauchbar. Als "Festplatte" wird eine SD-Card verwendet. Für den Video-Ausgang steht nur Composite-Video und HDMI zur Verfügung. Mit einem einfachen HDMI-DVI-Adapter kann aber jeder DVI-Monitor angeschlossen werden. Er benötigt ca. 3 Watt.
Benötigte Hardware für ein Infoboard:
* Raspberry-Pi - Model B (viele Anbieter, teilweise als Bundle mit Netzteil, Gehäuse, ...)
* Stromversorgung: USB-Netzteil mind. 700 mA (besser: 1200 mA oder mehr) mit einem Micro-USB-Anschluss
* SD-Card: mind. 2 GB, max. 32 GB
* Monitor mit DVI oder HDMI Eingang
* Kabel von HDMI (Raspberry-Pi) zum Monitor (HDMI oder DVI), ggf. Adapter dazu
* zur Erst-Installation: USB-Maus und USB-Tastatur
* ggf. Gehäuse für den Pi
===== 1.) Betriebssystem auf SD-Card aufspielen =====
siehe auch -> [[http://elinux.org/RPi_Easy_SD_Card_Setup|elinux.org]]
Aktuelles Image herunterladen -> [[http://www.raspberrypi.org/downloads|Download wheezy]], auspacken und mit einem Disk-Manager auf SD-Card schreiben.
Unter Windows: [[http://sourceforge.net/projects/win32diskimager/|Win32DiskManager]]\\
**Hinweis:** Der Win32Diskmanager benötigt sehr lange zum Starten!
Unter Linux: [[http://elinux.org/RPi_Easy_SD_Card_Setup#Copying_an_image_to_the_SD_card_in_Linux_.28command_line.29|mit Kommandozeile]] oder über [[http://elinux.org/RPi_Easy_SD_Card_Setup#Copying_an_image_to_the_SD_card_in_Linux_.28graphical_interface.29|Desktop bei Ubuntu]]
===== 2.) Erster System-Start und Installation abschließen =====
Nun alles anschließen (Monitor, Tastatur, Maus, SD-Card) und zum Schluss die Stromversorgung.\\ Mit angeschlossenem Netzwerk holt er sich per dhcp eine IP.\\ Danach bootet der Pi und das "raspi-config" erscheint:
Raspi-config
info Information about this tool
expand_rootfs Expand root partition to fill SD card
overscan Change overscan
configure_keyboard Set keyboard layout
change_pass Change password for 'pi' user
change_locale Set locale
change_timezone Set timezone
memory_split Change memory split
ssh Enable or disable ssh server
boot_behaviour Start desktop on boot?
update Try to upgrade raspi-config
Folgende Erst-Einstellungen sind sinnvoll:
* Expand root fs
* ssh - Enable
* Set timezone (Europa/Berlin)
* Set locale (de.DE utf8)
* Set Keyboard Layout (Generic, Other-German-..., Ctrl+Alt+Back -> X-Server restart)
Das "raspi-config" kann auch später auf der Kommandozeile wieder aufgerufen werden.
Mit "Finish" wird dann das System neu gestartet und man kann sich als Benutzer pi mit Passwort "raspberry" anmelden.
Alle Befehle, die root-Rechte erfordern, muss man mit "sudo" ausführen. Am Besten gibt man dem User root ein Passwort um dann direkt als root zu arbeiten:
# sudo passwd root
===== 3.) Konfigurieren für Browser-Autostart im Fullscreen-Modus =====
Der User pi soll automatisch angemeldet werden, dazu die Datei **''/etc/inittab''** editieren. Eine Zeile (die mit 1:2345 beginnt) dabei abändern:
# nano /etc/inittab
...
1:2345:respawn:/bin/login -f pi tty1 /dev/tty1 2>&1
...
Den X-Server automatisch starten. Dazu in der Datei **''/etc/rc.local''** eine Zeile vor dem "exit 0" hinzufügen:
# nano /etc/rc.local
...
su -l pi -c startx
exit 0
Dann den Browser midori beim Login starten. Ggf. noch das Tool "xset" installieren (fehlte bei mir) und die Datei **''/etc/xdg/lxsession/LXDE/autostart''** editieren. Alle vorhandenen Zeilen auskommentieren oder löschen, 4 Zeilen hinzufügen und die eigene URL ergänzen:
# apt-get install x11-xserver-utils
# nano /etc/xdg/lxsession/LXDE/autostart
@xset s off
@xset -dpms
@xset s noblank
@midori -e Fullscreen -a http://
Und noch den Screensaver deaktivieren. Die Datei **''/etc/lightdm/lightdm.conf''** editieren. Eine Zeile in der Sektion [SeatDefaults] hinzufügen (Groß/Kleinschreibung beachten):
# nano /etc/lightdm/lightdm.conf
...
xserver-command=X -s 0 dpms
...
Schließlich noch ein Tool installieren, das den Mauszeiger abschaltet, und neu booten:
# apt-get install unclutter
# reboot
===== 4.) Zusätzliches =====
**Tastenkombinationen**:
* **'' + + ... ''** -> Weitere Konsolen aufrufen
* **'' + + ''** -> Desktop aufrufen
**System-Updates** wie gewohnt:
# apt-get update
# apt-get upgrade
**Weitere Pakete**:
# apt-get install mc # Dateinmanager
# apt-get install synaptic # Paketverwalter am Desktop
# apt-get install ntpdate # Zeit mit Zeitserver stellen
**X-Server** starten:
startx
**Netzwerkshare** vom Server mounten:
mount -t cifs -o username="peter",password="geheim" //server/pgm /mnt
**VNC** mit dem Pi -> [[raspberry-vnc|VNC und Raspberry Pi]]
**Zeit setzen**, mit der IP des IPcop oder mit externen Server, z.B. "ptbtime3.ptb.de":
sudo ntpdate -u 10.16.1.254
===== 5.) Auflösung und weitere Parameter beim Booten setzen =====
siehe -> [[http://raspberrycenter.de/handbuch/configtxt-konfigurationsdatei|Konfigurationsdatei config.txt]] und -> [[http://elinux.org/RPi_config.txt|Auflösungen]]
Mit folgenden Befehlen kann man alle verfügbare Modi des Monitors abrufen:
# /opt/vc/bin/tvservice -m DMT
# /opt/vc/bin/tvservice -m CEA
Folgender Befehl ruft den aktuell verwendeten Status ab:
# /opt/vc/bin/tvservice -s
Die zu editierende Datei liegt am Pi unter **''/boot/config.txt''**, z.B. habe ich folgendes ergänzt, um eine Auflösung für den DVI-Monitor von 1680x1050, 60Hz vorzugeben:
...
hdmi_group=2
hdmi_mode=58
**Problematik:** Beim gleichzeitigen Einschalten von Monitor und Pi erkannte der Pi (bootet sehr schnell) den DVI-Monitor nicht und aktivierte daraufhin __nicht__ den HDMI-Ausgang.\\ **Lösung:** Pi rebooten, falls der aktuelle Status falsch ist. Oder in der Datei **''/boot/config.txt''**:
...
hdmi_force_hotplug=1
===== 6.) Splash-Screen beim Booten =====
Siehe [[http://www.edv-huber.com/index.php/problemloesungen/15-custom-splash-screen-for-raspberry-pi-raspbian|www.edv-huber.com]].\\
Damit wird das Paket "fbi" - "Frame-Buffer-Image-Viewer" verwendet um während des Bootvorganges ein png-Bild anzuzeigen.
===== 7.) Login vom Server ohne Passwort mit Key =====
Dazu am Pi unter **''/root/.ssh/authorized_keys''** den öffentlichen ssh-Key des Servers ablegen. Damit kann man dann z.B. dem Pi vom Server per ssh einen reboot-Befehl senden.\\
Genaueres siehe-> [[clients:linux_clients:fernsteuerung_linuxclient?s[]=authorized&s[]=keys|Fernsteuerung Linux-Clients]]
===== 8.) Den Browser midori konfigurieren =====
Midori wird zwar im Kontext vom User pi gestartet, benutzt aber dessen Config-Datei nur, wenn man diese explizit beim Autostart angibt:
...
@midori -c /home/pi/.config/midori/ -e Fullscreen -a http://
...
Beispiel, um den Default-Font zu setzen:
[settings]
default-encoding=UTF-8
default-font-family=Century Schoolbook L
monospace-font-family=Nimbus Mono L
default-font-size=8
default-monospace-font-size=13
===== 9.) Präsentationen und LibreOffice =====
Der Befehl "apt-get install libreoffice" schlug bei mir leider fehl. Daraufhin habe ich LibreOffice über dem Pi-Store installiert ("Pi Store" Icon erscheint nach "apt-get upgrade"). Man muss sich registrieren (kostenlos). Das damit installierte LibreOffice hatte die Versionsnummer 3.6.1.2 (März 2013).
Folgende autostart-Datei startet automatisch eine im home vom User pi abgelegte Präsentation. Geeignete Konfiguration dieser odp-Datei siehe -> [[auto-praesentation#einstellungen_fuer_die_odp-praesentation|ODP-Präsentationseinstellungen]]
@xset s off
@xset -dpms
@xset s noblank
@libreoffice --nologo --norestore -show /home/pi/praesentation.odp
**Achtung:** Vor "show" nur ein Strich, sonst zwei!
Soll die Präsentation fortlaufend aktualisiert werden, ist folgendes Vorgehen möglich:
- am Server einen User dsb anlegen. In dessen Home dann die neue Präsentation ablegen (wird vom pi dann bei der Übernahme gelöscht!!)
- das home des Users dsb auf dem pi beim autostart mounten (mountpoint **''/home/pi/dsb''** vorher anlegen):
@xset s off
@xset -dpms
@xset s noblank
@sudo mount -t cifs -o username="dsb",password="geheim",noperm //server/dsb /home/pi/dsb
@libreoffice --nologo --norestore -show /home/pi/praesentation.odp
- durch einen cronjob des Users pi jede Minute auf eine neue Präsentation prüfen:* * * * * /home/pi/pruefe.sh
- Script, das die Prüfung durchführt, mit chmod ausführbar machen:#! /bin/sh
cd /home/pi
if test -e "/home/pi/dsb/praesentation.odp"
then
ps ax | grep soffice.bin && killall soffice.bin
mv /home/pi/dsb/praesentation.odp /home/pi/praesentation.odp
soffice --nologo --norestore --display :0 -show /home/pi/praesentation.odp &
fi
exit 0