shesk
Posts: 4
Joined: Fri May 26, 2017 1:45 pm

Jessie-lite setup for Raspberry Pi Zero W

Fri May 26, 2017 6:34 pm

tl;dr This will setup integrated Wifi and fix keyboard on Raspberry Pi Zero W

I've been looking for a concise article on how to get the raspberry pi zero w setup through the Wi-Fi and locale issues that everyone seems to be having. Since I did not find one, I figured I would give it a shot.

It seems that the integrated Wifi does not work out of the box and an update is required. The below steps will walk you through how to do that using a separate usb wireless card. This is the only way I've figure out how to get the Zero W working.

Prerequisites:
Raspberry Pi Zero W
Jessie Lite flashed to SD Card
USB wireless card (I have TP-Link TL-WN722N)
Bluetooth Keyboard
USB Keyboard
Micro USB to USB adapter
Monitor
Power

Two keyboards are required because there is only one spare USB on the Raspberry Pi Zero W (PiZW). If you have a duel adapter/hub that works you can do away with the Bluetooth keyboard and a few of the steps.

1. Plugin the monitor, USB Micro to USB adapter (all future references to usb keyboard and usb wireless devices assume you are using the appropriate adapter), plugin keyboard and finally plug in the power. Let the PiZW boot and go through its initial setup phase.

2. Once complete, login with the default username and password. (This article has info on setting up a new user if interested: dimabobkov.blogspot.com/2015/11/install ... essie.html)
Username: pi
Password: raspberry

3. Connect the Bluetooth keyboard - Agent will confirm Bluetooth is running.

Code: Select all

$ bluetoothctl
$ power on
$ agent on
This will start the Bluetooth search

Code: Select all

$scan on
This will connect to Bluetooth keyboard - where xx's are the MAC address of the keyboard

Code: Select all

$connect XX:XX:XX:XX:XX:XX

Type something to confirm it works. Remember the MAC address as we will need it in the next step.

4. Update crontab to auto reconnect Bluetooth keyboard (I set the Bluetooth keyboard to connect mode during the 'enable Interface' step on bootup, it connects shortly afterwards, prior to dhcp step).

Code: Select all

$ sudo crontab -e
Add the following line in cron - where XX:XX:XX:XX:XX:XX is the MAC address of the Bluetooth keyboard

Code: Select all

@reboot sleep 5 && /bin/echo -e 'connect XX:XX:XX:XX:XX:XX \n quit \n' | bluetoothctl


5. Shutdown, swap wired usb keyboard for wireless usb card.

Code: Select all

$ sudo shutdown -h -P now
6. Turn on PiZW and login - using the Bluetooth keyboard
7. Setup wireless card - someone confirm this step, it is the only part I don't remember

Code: Select all

$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

It should look like this:

Code: Select all

network={
		ssid="Your WiFi name"
		psk="Your WiFi password"
	}
8. Confirm Wifi connection
To find out which device is your usb card - mine was wlan1

Code: Select all

$ifconfig
Then

Code: Select all

$iw wlan1 link

9. Update and upgrade - the -y is auto Yes to upgrade prompts. Leave off if you want to verify upgrade before proceeding.

Code: Select all

$ sudo apt-get update && upgrade -y
$ sudo apt-get dist-upgrade

10. Install rpi-update and run

Code: Select all

$ sudo apt-get install rpi-update
$ sudo rpi-upgrade
11. Shutdown, swap usb wireless card for usb keyboard again.
This is required because raspi-config doesn't behave well with Bluetooth keyboards.

Code: Select all

$ sudo shutdown -h -P now

12. Turn on PiZW and login - using the usb keyboard
13. Update Locales, timezone, and keyboard layout

Code: Select all

$sudo raspi-config
Use Arrow Keys to scroll down to option 4. Localisation Options and hit Enter
Update Locale, Timezone, and Keyboard layout using arrow keys to navigate, spacebar to select/deselect options and Enter to proceed/Save

alternate keyboard instructions.

Code: Select all

$ sudo nano /etc/default/keyboard
change gb to us
Variant and Options blank
Not sure about backspace=guess

Should look like this:

Code: Select all

XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""

BACKSPACE="guess"
If the keyboard now works correctly, " | are the important ones, proceed to step 14, otherwise reboot and hopefully it will take effect.

14. Run wpa_passphrase to get psk keyboard and pipe to /etc/network/interfaces
Complained about /etc/network/interfaces if you just do sudo wpa_passphrase...

Code: Select all

$ sudo -i
$ wpa_passphrase "SSID" >> /etc/network/interfaces
Here it will wait for you to enter the password, so type that in and hit enter

15. Edit interfaces with new psk key

Code: Select all

$sudo nano /etc/network/interfaces
Following this template:

Code: Select all

auto wlan0
	iface wlan0 inet dhcp 
                wpa-ssid {ssid}
                wpa-psk  {password}

Should look like this (at the bottom of the file, ignore everything above it):

Code: Select all

auto wlan0
	iface wlan0 inet dhcp
		wpa-ssid MySSID
		wpa-psk xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

16. (Optional) Reboot

Code: Select all

$ sudo shutdown -r now

17. Confirm the onboard wifi is working - after login

Code: Select all

$ iw wlan0 link
Last edited by shesk on Sat May 27, 2017 5:43 am, edited 2 times in total.

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Setting up the Raspberry Pi Zero W

Fri May 26, 2017 8:40 pm

I've been looking for a concise article on how to get the raspberry pi zero w setup through the Wi-Fi and locale issues that everyone seems to be having

It seems that the integrated Wifi does not work out of the box
I'm befuddled by your post

I can get a PiZeroW up and running headlessly by simply creating an ssh.txt file and placing a copy of an exisiting wpa_supplicant file onto the FAT32 partition and powering it up
I then ssh using putty and use raspi-config to enable vnc server - I then reboot and VNC in.

Works every time in my house - got about 4 of them

I believe 99.9% of others can do this as well (some people decide to try lite version and make small typos in their config file(if they use full Raspbian - their problems go away :) - a smaller percentage have a bit of trouble with their routers)

No need for all this other stuff - do you want to tell us what happens when you do the above on your system?

User avatar
B.Goode
Posts: 10439
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Setting up the Raspberry Pi Zero W

Fri May 26, 2017 8:52 pm

2. Once complete, login with the default username and password. (This article has info on setting up a new user if interested: dimabobkov.blogspot.com/2015/11/install ... essie.html)
Username: Pi
Password: raspberry
The default username for the Raspbian OS is pi

shesk
Posts: 4
Joined: Fri May 26, 2017 1:45 pm

Re: Setting up the Raspberry Pi Zero W

Fri May 26, 2017 9:38 pm

mattmiller wrote:
I've been looking for a concise article on how to get the raspberry pi zero w setup through the Wi-Fi and locale issues that everyone seems to be having

It seems that the integrated Wifi does not work out of the box
I'm befuddled by your post

I can get a PiZeroW up and running headlessly by simply creating an ssh.txt file and placing a copy of an exisiting wpa_supplicant file onto the FAT32 partition and powering it up
I then ssh using putty and use raspi-config to enable vnc server - I then reboot and VNC in.

Works every time in my house - got about 4 of them

I believe 99.9% of others can do this as well (some people decide to try lite version and make small typos in their config file(if they use full Raspbian - their problems go away :) - a smaller percentage have a bit of trouble with their routers)

No need for all this other stuff - do you want to tell us what happens when you do the above on your system?
I guess it is an issue with using jessie-lite. But I've found several people with this issue. The steps above get WiFi working and a 'us' keyboard layout.

shesk
Posts: 4
Joined: Fri May 26, 2017 1:45 pm

Re: Setting up the Raspberry Pi Zero W

Fri May 26, 2017 9:38 pm

B.Goode wrote:
2. Once complete, login with the default username and password. (This article has info on setting up a new user if interested: dimabobkov.blogspot.com/2015/11/install ... essie.html)
Username: Pi
Password: raspberry
The default username for the Raspbian OS is pi
Oops, corrected.

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Setting up the Raspberry Pi Zero W

Sat May 27, 2017 5:39 am

I guess it is an issue with using jessie-lite.
How about changing title of post to say Jessie-lite so that other don't think this is the way to setup standard Raspbian?

UNfrotunately, this is irrelevant info for the vast majority of people to follow and will just cause further problems if people come across it in searches
Last edited by mattmiller on Sat May 27, 2017 10:12 pm, edited 1 time in total.

rdmcginnes
Posts: 9
Joined: Thu Mar 21, 2013 10:08 am

Re: Jessie-lite setup for Raspberry Pi Zero W

Sat May 27, 2017 10:48 am

Please post an example of a wpa-supplicant file that goes in /boot. Also please post an example of an ssh.txt file and tell us where to store it. Finally tell us how to set up and use vnc and or putty to then login to the pizw,

Can this all be done to get the pizw up and running with ssh from a remote system, without a keyboard or display on the pizw?

klricks
Posts: 7211
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Jessie-lite setup for Raspberry Pi Zero W

Sat May 27, 2017 1:55 pm

rdmcginnes wrote:Please post an example of a wpa-supplicant file that goes in /boot. Also please post an example of an ssh.txt file and tell us where to store it. Finally tell us how to set up and use vnc and or putty to then login to the pizw,

Can this all be done to get the pizw up and running with ssh from a remote system, without a keyboard or display on the pizw?
-Find many examples of wpa_supplicant.conf on this forum.
-Place an empty file with filename ssh or ssh.txt in /boot (The only folder visible with the boot files when using Windows). It does not matter if the file is empty or contains any amount of text...The file can be created with notepad in Windows.
-Boot the SD in the RPi.
-If successful then the wpa file will be moved and the ssh file will be deleted.
-Logon from remote computer using PuTTy or other ssh client.
* I don't know if RealVNC is installed in Jessie Lite? If not then it must be installed.
-Enable VNC by using sudo raspi-config (reboot required).
-Use client Realvnc viewer from here: https://www.realvnc.com/download/viewer/
Last edited by klricks on Sat May 27, 2017 2:04 pm, edited 1 time in total.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

jahboater
Posts: 5960
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: Jessie-lite setup for Raspberry Pi Zero W

Sat May 27, 2017 2:01 pm

rdmcginnes wrote: Can this all be done to get the pizw up and running with ssh from a remote system, without a keyboard or display on the pizw?
My Pi Zero W has never had a keyboard or a monitor connected to it. Runs fine!

Return to “Beginners”