meta data for this page
- en
**This is an old revision of the document!**
RaspberryPi 3 Nextcloud
Raspberry Pi 3 mit Nextcloud und externen 2,5\'\' Festplatte.
SSH aktivieren
Im root Ordner einfach im Fileexplorer eine Datei ohne Dateiendung erstellen “ssh” genannt. Dazu auch die anzeige der bekannten Dateiendungen aktivieren.
Einrichten
Tastatur umstellen auf QWERTZ, dazu folgenden Befehl:
sudo dpkg-reconfigure keyboard-configuration
IBM 105 ist Europäisches Layout. Nach dem einstellen den Service neustarten mit
sudo service keyboard-setup restart
WLAN Modul aktivieren
Hat funktioniert
Editing WPA Supplicant Configuration:
Once inside the Raspi, we will have to edit a file residing in /etc/wpasupplicant/ directory using the following command. <code>sudo nano /etc/wpasupplicant/wpasupplicant.conf</code> This file is going to contain information regarding your Wi-Fi networks such as its SSID and password. Following is the accepted format and can be copy-pasted after replacing SSID and PSK with correct values. <code>#Your wpasupplicant.conf file ctrlinterface=DIR=/var/run/wpasupplicant GROUP=netdev updateconfig=1 network={ ssid=“your network name” psk=“ Password.” idstr=“home, office, etc.” }</code> If you want to prioritize the connection between two or more authorized networks in range, then you can use priority tag and assign a number to it. For example, in the following sample, the network with name Home will have more priority over the network Home2.
#For setting priorities network={ ssid="Home" psk="password" id_str="home, office etc" priority = 1 } network={ ssid="Home2" psk="password" id_str="home, office etc" priority = 2 }
Now depending on the editor, you used to edit the files, enter commands to save and quit. For Nano editor, press Control + O hit Return and then Control + X to exit.
Editing Interfaces File:
After this step, we will also need to make some changes in the interface file located in the /etc/network/ directory. Following is the content you can directly copy and paste, however, be sure to have the correct names in place. For example, some systems name your Wi-Fi network interface as wlan0 another call it wlan1, wlan2, etc. You can check the correct name by executing the ifconfig command on Raspberry Pi terminal.
#your network interfaces file auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp allow-hotplug wlan0 auto wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
Once you complete this step, you can either restart the Raspberry Pi or execute the following commands:
#Restarting wireless interface $sudo ifdown wlan0 $sudo ifup wlan0
Note: Be sure to cross check the name of the wireless you want to reset.
As soon as you perform this, you will be connected to the Wi-Fi network mentioned in previous steps.
Hat nicht funktioniert
iwlist scan
Suchen, ob ein WLAN Adapter vorhanden ist. Üblicherweise im RaspberryPi
wlan0
- Der Raspberry Pi muss zunächst via Ethernet mit dem Netzwerk verbunden werden, sodass wir eine SSH-Verbindung aufbauen können. Alternativ kann er mit einem Monitor, Maus und Tastatur verbunden werden, wo wir den Terminal aufrufen müssen.
- Zunächst sollten wir überprüfen welche Netzwerke in Reichweite sind. Die Netzwerke sind absteigend nach Signalstärke geordnet und in der Zeile ESSID findet sich der Netzwerkname, den wir im kommenden Schritt benötigen.
sudo iwlist wlan0 scan
oder
sudo iwlist wlan0 scan | egrep
Die Pipe egrep filtert die Ausgabe nach den SSID.
- Haben wir das richtige Netzwerk gefunden, zum Beispiel „TestNetzwerk“, so müssen wir das Netzwerk und dessen Schlüssel hinterlegen. Dieser Eintrag muss am Ende der Datei wpasupplicant.conf eingefügt werden und kann dort auch mehrfach hinterlegt werden, falls mehrere Netzwerke gespeichert werden sollen. Zum Bearbeiten der Datei verwenden wir den Editor nano in dem man mittels STRG + X (Oder F2), Y und Enter speichern kann. <code>sudo nano /etc/wpasupplicant/wpasupplicant.conf</code><code> network={ ssid=“TestNetzwerk” psk=“Mein1SuperGeheimesPasswort!” }</code> - <code>sudo raspi-config</code>Konfiguration noch einmal öffnen und den Country Code nach “ISO/IEC alpha2 code” korrekt ändern. - Außerdem sollten wir in der Zeit in der das WLAN-Modul aktiviert ist, dessen Energiesparmodus deaktivieren, da es ansonsten passieren kann, dass sich der Raspberry Pi vom Netzwerk trennt. Hierzu fügen wir folgende zwei Zeilen am Ende der folgenden Datei ein: <code>sudo nano /etc/network/interfaces</code><code>pre-up iw dev wlan0 set powersave off
post-down iw dev wlan0 set power_save on</code>
- Abschließend müssen wir das Netzwerkinterface wlan0, das verbaute WLAN-Modul, neustarten. Anschließend wird die Verbindung aufgebaut.
sudo ifdown wlan0 && sudo ifup wlan0
sudo ifconfig wlan0 | grep inet
Check, ob die IP korrekt bezogen wurde.
ping -c 3 linuxundich.de
zur Kontrolle, ob sonst die Verbidnung funktioniert.
Damit ist das WLAN auf dem Raspberry Pi 3 eingerichtet. Wer zusätzlich einen WLAN-Hotspot mit einem weiteren WLAN-Stick aufbauen möchte, erfährt im Artikel WLAN-Access-Point einrichten wie er das bewerkstelligen kann.