Raspberry Pi Network Setup

Submitted by code_admin on Wed, 07/25/2018 - 10:39


  1. sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add the following:

  1. network={
  2.     ssid="The_ESSID_from_earlier"
  3.     psk="Your_wifi_password"
  4.     id_str="main_net"
  5. }

Quotes are needed

Enable ssh

Place a file called "ssh" all lower case in the boot (FAT partition) of the image - the one called 'boot'

Old method:
rename /etc/rc2.d/K01ssh
to /etc/rc2.d/S01ssh

create a file /etc/SSHFLAG
insert the following code into etc/rc.local just above the exit 0 line

  1. if [ -e /etc/SSHFLAG ]; then
  2.   /usr/sbin/update-rc.d -f ssh defaults
  3.   /bin/rm /etc/SSHFLAG
  4.   /sbin/shutdown -r now
  5. fi
  7. /etc/init.d/ssh start

use raspi-config to enable properly

Change Hostname

Edit /etc/hosts, make point to the required hostname ( points to localhost)

An example file for light2

  1.   localhost
  2. ::1     localhost ip6-localhost ip6-loopback
  3. ff02::1     ip6-allnodes
  4. ff02::2     ip6-allrouters
  6.   light2

Edit /etc/hostname to include new hostname
(.lan not needed in hostname file)


  1. lsusb

If it dosen't show up here

  1. dmesg

I saw

  1. [  505.388184] r8188eu 1-1.4:1.0: Direct firmware load for rtlwifi/rtl8188eufw.bin failed with error -2
  2. [  505.388221] r8188eu 1-1.4:1.0: Firmware rtlwifi/rtl8188eufw.bin not available
  3. [  505.388238] MAC Address = 00:bb:0e:00:f6:1e
  4. [  507.033826] usb 1-1.4: USB disconnect, device number 5
  5. [  507.034323] R8188EU: ERROR indicate disassoc

The file is here

I put the SD into my laptop and manually copied the file to lib/firmware/rtlwifi
(I had to use SUDO)
I also had to chmod it to match other files in this directory.

Steps for setting up Raspbian image for pi zero

See this page
Create SD Card

Mount and edit the wifi and host settings
Add /home/pi/.ssh/authorized_keys file

Test boot the pi from the card

RJM Article Type
Quick Reference