Solved6.05K viewsOperating system

Operating system defaults to Ethernet (cable)/DHCP. How to use and configure the wireless adapter instead?

Question is closed for new answers.
Answered question

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 give the following command:

rfkill unblock wifi; rfkill unblock all

and 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:

# loopback
auto lo
iface lo inet loopback
# ethernet
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
# wlan
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "YOUR_ESSID"

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

Changed status to publish

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.

Posted new comment


plug the SD card (with a SD to USB adapter) into a running Linux OS (a VirtualBox vm is ok as well) and modify the /etc/network/interfaces file.