meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
digital:hardware:rasppi31 [2018/10/27 22:01]
natrius
— (current)
Line 1: Line 1:
-# RaspberryPi 3  
- 
-## 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: 
- 
-<code>sudo dpkg-reconfigure keyboard-configuration</code> 
- 
-IBM 105 ist Europäisches Layout. Nach dem einstellen den Service neustarten mit 
- 
-<code>sudo service keyboard-setup restart</code> 
- 
-## Ganze SD-Karte benutzen (Raspbian) 
- 
-Kompletten Speicherplatz der SD-Karte einrichten 
- 
-<code>sudo raspi-config</code> 
-<code>Option 7 Advanced Option > Expand Filesystem  </code> 
- 
-Hiermit wird die SD-Karte erweitert. Danach neu starten. 
- 
-## WLAN Modul aktivieren 
- 
-==== Hat funktioniert ==== 
- 
-=== Editing WPA Supplicant Configuration: === 
-Once inside the Raspi, we will have to edit a file residing in /etc/wpa_supplicant/ directory using the following command. 
-<code>sudo nano /etc/wpa_supplicant/wpa_supplicant.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 wpa_supplicant.conf file 
-ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev 
-update_config=1 
-  
-network={ 
-ssid="your network name" 
-psk=" Password." 
-id_str="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. 
-<code>#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 
-}</code> 
-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. 
-<code>#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</code> 
- 
-Once you complete this step, you can either restart the Raspberry Pi or execute the following commands: 
-<code>#Restarting wireless interface 
-  
-$sudo ifdown wlan0 
-  
-$sudo ifup wlan0</code> 
- 
-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 ==== 
-  - <code>iwlist scan</code> Suchen, ob ein WLAN Adapter vorhanden ist. Üblicherweise im RaspberryPi <code>wlan0</code> 
-  - 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. <code>sudo iwlist wlan0 scan</code> oder <code>sudo iwlist wlan0 scan | egrep</code> 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 wpa_supplicant.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/wpa_supplicant/wpa_supplicant.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 power_save 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. <code>sudo ifdown wlan0 && sudo ifup wlan0</code> 
-  - <code>sudo ifconfig wlan0 | grep inet</code> Check, ob die IP korrekt bezogen wurde.  
-  - <code>ping -c 3 linuxundich.de</code> 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.