Recipe: 005-Wifi



Recipe Card

 

005 : Wifi Configuration

 

Recipe Files Ingredients
(flavour)_root.txt 005-wifi_INGREDIENTS.zip

See the markdown version of this recipe on the Pi-Kitchen GitHub site see:

005-Wifi Configuration.md

 

Description

 

WARNING: The following assumes that you have a working wired network (or a wireless adaptor which doesn’t need additional drivers).

Check out the Wifi driver recipe if you need help identifying the wifi adaptor or want to install the drivers without a working network connection.

Drivers

Installing the wifi drivers, using install_wifi-devices.sh

The install_wifi-devices.sh script will allow the required wifi drivers to be installed during the first start up. The install_wifi-devices.sh script should be placed in the _RUNONCE directory.

For each driver you want to install, where is the driver listed from searching apt-cache:

sudo apt-get install <packagename>

e.g. For firmware-ralink add the following to install_wifi-devices.sh:

sudo apt-get install firmware-ralink

Wifi Settings

The interfaces file

This replaces the standard etcnetworkinterfaces file with one which uses etcwpa.conf for the wifi settings.

auto lo



iface lo inet loopback

iface eth0 inet dhcp



iface default inet dhcp



auto wlan0

iface wlan0 inet dhcp



wpa-conf /etc/wpa.conf

NOTE: Some devices will have different names to wlan0 (i.e. ra0) so you may need to adjust this file.

The wpa.conf file

The wpa.conf file should detail the wifi settings as follows:

network={

  ssid="firstnetwork"

  key_mgmt=WPA-PSK

  psk="passphrase1"

}

network={

  ssid="secondnetwork"

  key_mgmt=WPA-PSK

  psk="passphrase1"

}

NOTE: We place this file in _SETTINGS so that it is easier to remove sensitive information from our configurations.

An example wpa.conf is provided in pi-kitchen005-wifietc directory.

 

How to use

 

1.Identify your Wifi adaptor.

2.Ensure install_wifi-devices.sh will install the correct package for your device.

3.Insert your Wifi settings into the wpa.conf file.

 

Ingredients

The ingredient files should be placed in the following location on the NOOBS RECOVERY partition:

 

pi-kitchen/005-wifi

 

This recipe uses the following files:

 

etc/network/interfaces

_RUNONCE/install_wifi-devices.sh

 

Plus the following files in the _SETTINGS folder:

It is assumed that the following file(s) are placed in the following location on the NOOBS RECOVERY partition:

 

pi-kitchen/_SETTINGS/005-wifi

 

You will need the following _SETTINGS file(s):

 

005-wifi/wifi_example/wpa.conf

 

NOTE: Files which are configured manually or may contain sensitive information are placed in the _SETTTINGS directory on the SD-Card. This is so that it is easier to support different configurations and remove sensitive information from the setup if needed.

Perform the following actions:

 

Ensure you update wpa.config with your own Wifi SSID and pass-phrase.

 

You can download all the ingredient files, and extracted directly to the NOOBS SD-Card (ensuring you remove the ZIP file’s name from the directory – the files should be extracted to pi-kitchen/005-wifi).

The Recipe Files

Each recipe will use one file for each of the partitions it installs to – boot, root and data).

You will need to suitably rename or copy the content of each of the following files into your recipe files (i.e. RaspbianPiKitchen_root.txt) and place them in your os folder in the NOOBS partition (i.e. os/Raspbian).

For more information see the Pi-Kitchen: Creating Flavours guide.

(flavour)_root.txt

#

#Recipe: 005-wifi

#- Setup Wifi interfaces file

../../pi-kitchen/005-wifi/etc/network/interfaces /etc/network

#- Apply the user wifi SETTINGS

../../pi-kitchen/_SETTINGS/005-wifi/wifi_example/wpa.conf /etc

../../pi-kitchen/_SETTINGS/005-wifi/wifi_home/wpa.conf /etc

#-Install driver(s) for Wifi Adaptor(s)

../../pi-kitchen/005-wifi/_RUNONCE/install_wifi-devices.sh /home/pi/bin/_RUNONCE


Enjoy baking your Raspberry Pi SD-Card fresh from the Pi-Kitchen.

Comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s