Operating system defaults to Ethernet (cable)/DHCP. How to use and configure the wireless adapter instead?
In order to make use of a Wi-Fi network with Raspberry Slideshow, follow the steps below.
- Raspberry Pi 3 and newer/Zero W and newer have got an internal 802.11 Wi-Fi adapter, no external wireless network adapter is needed.
- In the case you are using Raspberry Pi 1/2/Zero you have to plug a compatible USB Wi-Fi adapter in, then (if required) install the kernel module and firmware as well – just Google for that if uncertain.
Plug an Ethernet cable into the Raspberry Pi running Raspberry Slideshow and re/boot; find out the IP associated to your Raspberry Pi (it’s printed on screen upon boot) and connect to it from your client PC via SSH (as root) in a LAN environment.
The output of ifconfig -a must show a wlan0 inteface. On the contrary, you will need to install a proper kernel module (driver) for the adapter, first, as said for older Pis.
Now modify the /etc/network/interfaces file with mc -e /etc/network/interfaces (then F10 to save) and put your network parameters in.
For example, with WPA-PSK and DHCP:
iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet dhcp
If you do not know the name of your wireless network, you can find the above YOUR_ESSID parameter with the iwlist scanning command.
You also should run the iwlist scanning command in order to see if your wlan0 interface is able to “see” your Wi-Fi router/access point, first.
Use wireless-essid instead of wpa-ssid and wireless-key instead of wpa-psk directives in case of WEP encryption (deprecated, i.e. don’t do it, don’t use WEP).
Then type in:
ifdown wlan0 && ifup wlan0
If no error is shown, you can verify everything is ok with ifconfig -a: make sure your wlan0 interface has an IP address associated. If so, you can safely reboot (by using the reboot command – do not ever, ever, unplug the power cable) and then unplug the wired network cable.
If something is going wrong, you may need to debug what’s happening. Install the syslog first, with apt update && apt install rsyslog and then, in another terminal session, before doing a new attempt, launch:
tail -f /var/log/syslog
With the Pi Zero W, you do not have an Ethernet Port, so you just have to edit the /etc/network/interfaces file by mounting the SD card in a running Linux OS an modify it from there.