Intro: RaspberryPi: Set-up WIFI in Jessie-Lite
If you don't need graphics Raspbian Jessie-Lite may be just the operating system you need. And it can fit on a two gig sd card. However setting up WIFI can be hard because the documentation is hard to find. There are times I have loaded the whole Raspbian system just because I needed it to set up the WIFI. I want to run my Pi headless so I looked long and hard to find all the information and condense it into one place.
This was tested on a model three with Jessie-Lite version 2016-5-17. It should work with any version of RaspberryPi but I recommend using the latest version of Jessie-Lite.
Step 1: Prepare the SD Card
I prepared my SD card on a Ubuntu desktop machine, follow these instructions.
Download the latest Raspbian Jessie-Lite image here: https://www.raspberrypi.org/downloads/raspbian/
Unzip the file, this will create a file named 2016-05-27-raspbian-jessie-lite.img
Insert the SD card
Run gparted to find the device name for your SD card.
(If you have one disk drive it will probably be /dev/sdb)
Open a terminal in the directory where you unzipped the file.
Unmount any partitions on the SD card with the command sudo umount /dev/sdb1
Use the same command to unmount any other partitions on the card.
Copy the disk image file to the SD card with the command
sudo dd if=2016-05-27-raspbian-jessie-lite.img of=/dev/sdb
(Be very careful with the dd command. dd stands for duplicate disk but it is often called destroy data. If you don't have the target device right it will do real damage.)
Step 2: Edit the /etc/network/interfaces File
Edit your /etc/network/interfaces file with the command:
sudo nano /etc/network/interfaces
The file will look look this:
# interfaces(5) file used by ifup(8) and ifdown(8) # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d auto lo iface lo inet loopback iface eth0 inet manual allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf allow-hotplug wlan1 iface wlan1 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Edit the file to look like this:
# interfaces(5) file used by ifup(8) and ifdown(8) # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d auto lo iface lo inet loopback allow-hotplug eth0 iface eth0 inet dhcp allow-hotplug usb0 iface usb0 inet dhcp allow-hotplug wlan0 iface wlan0 inet dhcp wpa-ssid [YOUR_SSID] wpa-psk [YOUR_PASSKEY]
Step 3: Run It Headless
If you do not need to run your RaspberryPi headless you are done, if you want to run it headless read on.
Run raspi-config with the command sudo raspi-iconfig
Make any changes necessary to suit your needs, make sure you go into the advanced section and enable ssh.
Boot your RaspberryPi with monitor and keyboard attached and run the ifconfig command.
Make note of the MAC address.
Most routers have a setting to reserve an IP address for a specific machine. Setup a reserved IP address for your RPi so the script described here will always find it. This will link a MAC address to a permanent IP address.
The installation procedure for setting up the client computer to communicate with the Raspberry is for a Linux desktop and has been tested with Ubuntu. It should work the same on any derivative of Debian.
If you are running Windows use Putty.
On your client computer:
Open a terminal and install zenity with the command: sudo apt-get install zenity
Download the RPi-Lite script into your home directory.
Make it executable with the command: sudo chmod +x RPi-Lite
The zenity program gives you a GUI interface to access the RaspberryPi. With some versions of zenity you can double click on the desired option and it will work. On others you must click on the option then click on OK.
The RPi-Lite script provides two options:
- ssh - You have a terminal attached to the PRi you can run any text based program in the terminal.
- sftp - This option opens a file manager window so you can easily move files to and from your RPi.
Open a terminal and run the script with the command ./RPi-Lite