https://www.raspberrypi.org/documentation/configuration/wireless/wirele…
-
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Add the following:
-
network={
-
ssid="The_ESSID_from_earlier"
-
psk="Your_wifi_password"
-
id_str="main_net"
-
}
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
-
if [ -e /etc/SSHFLAG ]; then
-
/usr/sbin/update-rc.d -f ssh defaults
-
/bin/rm /etc/SSHFLAG
-
/sbin/shutdown -r now
-
fi
-
-
/etc/init.d/ssh start
use raspi-config to enable properly
Change Hostname
Edit /etc/hosts, make 127.0.1.1 point to the required hostname (127.0.0.1 points to localhost)
An example file for light2
-
127.0.0.1 localhost
-
::1 localhost ip6-localhost ip6-loopback
-
ff02::1 ip6-allnodes
-
ff02::2 ip6-allrouters
-
-
127.0.1.1 light2
Edit /etc/hostname to include new hostname
(.lan not needed in hostname file)
reboot
Troubleshooting
-
lsusb
If it dosen't show up here
-
dmesg
I saw
-
[ 505.388184] r8188eu 1-1.4:1.0: Direct firmware load for rtlwifi/rtl8188eufw.bin failed with error -2
-
[ 505.388221] r8188eu 1-1.4:1.0: Firmware rtlwifi/rtl8188eufw.bin not available
-
[ 505.388238] MAC Address = 00:bb:0e:00:f6:1e
-
[ 507.033826] usb 1-1.4: USB disconnect, device number 5
-
[ 507.034323] R8188EU: ERROR indicate disassoc
The file is here
https://github.com/lwfinger/rtl8188eu
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