Wifi - RetroPie Docs
Technology

Wifi – RetroPie Docs

Wifi – RetroPie Docs

How to connect retropie to wifi

if you have a raspberry pi 3, wifi is built into the pi, if you have a pi2 or earlier then you will need a wifi dongle. you can check if your wifi dongle is compatible here. you may want to use wifi usb dongle, then check here.

note: to use wifi on the raspberry pi, you will first need to set the wlan country via raspi-config. it’s in the 5 localization options menu in raspi-config. you can start raspi-config from the retropie menu in emulationstation or from the command line with sudo raspi-config.

there are 5 main methods to configure wifi:

  1. wifi module
  2. connect to wifi without keyboard
  3. manual configuration (interfaces)
  4. manual configuration (wpa_supplicant)
  5. wicd-curses

wifi module

you can access this from the retropie menu in emulationstation (you can also access it from option 3 in the retropie config script):

retropiemenuwifi

will open in this menu:

wifi1

choose your ssid from a list:

wifi2

Type your Wi-Fi password (you may have to wait a bit after you’re done for the settings to save)

wifi3

after you’re done configuring, you should see your wifi information in the original menu:

wifiinfo

connect to wifi without keyboard

if you want to connect to wifi without the need for an additional keyboard, you can add a file to the boot partition of the sd card called wifikeyfile.txt

put your network details here (note only works on wpa networks)

You can then access the wifi module and select the option to “import wifi credentials from /boot/wifikeyfile.txt”

wifi_text

connect to wifi without keyboard

starting with raspbian stretch, there is no need to load the wifikey file from the installation script.

Create a file called wpa_supplicant.conf on the boot partition using the following template. (this will be moved on boot to the /etc/wpa_supplicant directory).

make sure to include the retropie config… lines as shown to ensure that the retropie-setup wifi configuration module can cleanly edit/remove your configuration if you want to change it later.

wifi will not start if you have a wired ethernet connection. after unplugging the ethernet cable, you will need to reboot for wifi to start.

If you want ssh to be enabled by default as well, you can also create a blank file called ssh on the boot partition. this is a ‘flag’ file and will be removed on boot after ssh is enabled.

manual configuration (interfaces)

sudo nano /etc/network/interfaces

wpa/wpa2

You can also add wireless shutdown at the end if you’re having trouble turning your wifi dongle on and off and can’t maintain a connection.

wep

open network

hidden ssid

static ip

the following only applies to raspbian jessie

you can use the default /etc/network/interfaces, then you’ll need to edit /etc/dhcpcd.conf and add it to the top modifying it for your own router and ip address:

if you want a static ip with ethernet, change it to:

restart sudo for the changes to take effect.

upon reboot (if configured correctly), your wifi will be working.

manual configuration (wpa_supplicant)

taken from the raspberry pi foundation here:

This method is suitable if you don’t have access to the graphical user interface normally used to configure wifi on the raspberry pi. It’s especially suitable for use with a serial console cable if you don’t have access to a wired ethernet network or display. Also note that no additional software is required; everything you need is already included in the raspberry pi.

getting network details

To scan for Wi-Fi networks, use the command sudo iwlist wlan0 scan. this will list all available wifi networks along with other useful information. watch out for:

  1. essid:”test”. this is the name of the wifi network.

    ie: ieee 802.11i/wpa2 version 1. this is the authentication used; in this case it is wpa2, the newest and most secure wireless standard that replaces wpa1. this guide should work for wpa or wpa2, but may not work for wpa2 enterprise; for wep hex keys, see the last example here. you will also need the password for the wifi network. for most home routers, it’s on a label on the back of the router. the essid (ssid) for the network in this case is testing and the password (psk) testingpassword.

    add network details to raspberry pi

    You’ll first need to modify /etc/network/interfaces to point to wpa-supplicant if it isn’t already:

    We’ve changed it to wpa-roam so it will reconnect if the connection is dropped.

    open the wpa-supplicant configuration file in nano:

    sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

    go to the end of the file and add the following:

    the following are different ways to configure your network depending on the encryption your router is configured with.

    wpa/wpa2

    wep

    open network

    hidden ssid

    now save the file by pressing ctrl+x then y, and finally press enter.

    at this point, wpa-supplicant will typically notice a change has occurred within a few seconds and attempt to connect to the network. if not, manually reboot the interface with sudo ifdown wlan0 and sudo ifup wlan0, or reboot your raspberry pi with sudo reboot.

    you can check if it has connected correctly using ifconfig wlan0. if the inet addr field has an address next to it, the pi has connected to the network. if not, check that your password and essid are correct.

    wicd curses

    Note that this may cause a small amount of cpu usage in the background, which may prevent the cpu from scaling to the lower frequency.

    You must first install it with sudo apt install wicd wicd-curses and then type wicd-curses in the terminal to open it.

    (of course you will need to be connected via ethernet to install)

    navigate to your wireless network and press the right arrow to configure your wifi

    untitled drawing 2

    check automatically connect to this network (by pressing enter) and type your wifi password where it says “key” press f10 to save then press shift+c to connect and press q to return to terminal.

    There are some issues noted with the daemon using some cpu and preventing pi from scaling to the lower frequency, so if that’s the case you can remove wicd-curses by typing sudo apt remove wicd-curses and proceed to configure your wifi using method 2 or 3.

    you might want to use an external wifi dongle – maybe your pi case is blocking or slowing down the signal (with a metal case it’s quite common) for example.

    The easiest way is to first configure wifi with the internal driver, using one of the methods above. plug in your dongle, reboot and make sure it’s connected using ifconfig – it should show up as wlan1 and have an ip address. then disable built-in wifi by editing /boot/config.txt and adding dtoverlay=pi3-disable-wifi. that’s all 🙂

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button