Introduction: VNC Configuration Without Display on Pi Zero W
This tutorial is for those who do not have access to a display and want to set up their new Pi Zero W. Get started with Pi Zero W without a display. This tutorial helps you to enable SSH, VNC and configure VNC on your smartphone.
Pi Zero W is the latest version of Pi Zero launched on the last birthday of Raspberry Pi. Comparing to the previous version the new model comes with inbuilt Wifi and Bluetooth making it truly wireless as the W represents. Pi zero being a stripped down version of the Pi series lacks many things seen on the Raspberry Pi's. They have low power processor and ram, also lacks the no of ports. The lack of an ethernet port makes setting up Pi zero without a display harder and the recent changes in the SSH enabling also make ssh-ing into the Pi tougher. Well, this tutorial will guide you to solve these problems. The first problem many users have reported is that upon starting Pi Zero W up for the first time it behaves like dead. Even the SD cards working on other Pi's did not work on Pi zero w. The reason for this is that the Pi zero w only supports the latest version of raspbian. If you use an SD card with an old image of raspbian it will behave like dead. Even many sellers are selling Pi zero W kits with SD card containing an old raspbian image. The kit that I had bought from Adafruit had an SD card with old NOOBS. So it's good to burn the new raspbian image onto your SD card before powering up your Pi zero w.
Step 1: Things Used
1. Raspberry Pi Zero W Kit or source the items in the kit
2. Android Device
3. Portable WIFI Hotspot
3. Raspbian OS
4. JuiceSSH (Android app)
5.Network IP Scanner (Android app)
Step 2: Preparing the SD Card
You can download the latest version of raspbian from https://www.raspberrypi.org/downloads/
To burn your image onto your SD card you will need a software called Etcher by Resin.io. Download Etcher from here https://etcher.io/
NOTE: Use at least an 8GB SD card
1.Using an SD card adapter connect the SD card to your computer
2.Run the Etcher program
3.Select the downloaded raspbian file.
4.Select the connected SD card
5.Then click on Flash
Step by step images are given above
Let the program do it's work until you get a message showing success. This process can take up to 10minutes or more depending upon the write speed of your SD card.
Step 3: Enabling SSH
As per the new versions of raspbian SSH is not enabled by default. We must enable it so we can enable VNC without the help of a display. For enabling SSH we must make some modifications in the files
1. Now remount the SD card and open Notepad in Windows.
2. Save that empty notepad file as SSH.txt in the Boot folder of SD card (the folder sd card opens into).
3. Rename that SSH.txt and remove .txt. This way you will get a file named SSH without any extension.
4. Remove the SD card from its adapter and slide it into the SD card slot in Pi zero W.
Step 4: Booting Up
1.Connect the 5v adapter to the power port
You should see the LED blinking. When the rate of blinking is reduced the Pi zero w has booted into the interface. Since we do not have a display at the moment we cannot see the interface. Now we must connect to the Pi using SSH so as to enable VNC. For SSH-ing we must know the IP address of Pi.
Step 5: Finding the IP Address
the terminal to know the current IP address of Pi. But in our case, it is not possible. If you search the internet you can find many ways by which you can find IP address of your Pi without a display.
I had a WIFI hotspot lying around, So I just connected the hotspot using a USB cable onto my Pi zero w with the help of an OTG cable.
Using the configuration address of my WIFI hotspot I was able to get hold of the IP address of Pi zero W
Step 6: SSH-ing Into the Pi
For SSH-ing we need SSH client. Since I'm using Android to SSH I downloaded Juice SSH from playstore. If you are using PC you can use putty.
Install and open the app.Click on the lighting icon above the app type in your IP address and name as pi. Then you will be asked to enter the password, default password for pi is raspberry. The SSH windows will open up.
1. At first type in and press enter.
sudo apt-get update
. It will take some time before it updates everything.
2. When it finishes type in
It should open a window as shown in the images above.
3.Using the arrow key get down to Interface options and click select using the arrow key and enter.
4.Select VNC in the upcoming window and enable it and click finish.
That's it you have enabled VNC in your Pi
Step 7: VNC Remote Desktop
Note: Connect your smartphone to the same network as that of the Pi.
Open VNC app and click the + icon and type the IP address you have found earlier.
Click connect and it will ask you whether you want to connect click continue and then type the username as pi and password as raspberry and click continue.
You will be welcomed with the wonderful UI of Raspbian. You can do everything you do after connecting Pi with a display apart from playing Minecraft. After many tries, I could not get video output working while playing Minecraft.
Step 8: Conclusion
So far we used the help of a hotspot to reach up to this level. There is an intermediate between PI and smartphone. What if we could avoid that intermediate and create our own network so as to communicate between the pi and smartphone.
Switch On the Wifi Hotspot on your phone for few minutes and then connect back to the Pi using VNC. Click on the network icon in VNC you can see 2 network names one from the Hotspot and other from your phone. Click the one with the name of your smartphone hotspot and type in the password(if any)
Close VNC and switch on WIFI hotspot and after sometime Pi will automatically connect to your WIFI hotspot. install an IP scanner from playstore .
Scan your network using that Network IP Scanner, when it finishes you can find the new IP address of your PI.
Using that IP address connect to your Pi using VNC.
Now you have created your own small network between Pi and smartphone. You can control your Pi zero W wirelessly around the wifi range :)
Thank you for your time.