So you have just bought your first Raspberry Pi and you are eager to start using it? This post will provide you a beginners guide to Raspberry Pi including all the ways to connect to it.
–Win32DiskImager or Etcher
-Latest release of Raspbian
-Unzipping tool such as 7-zip
-Raspberry Pi (Of Course!)
-Raspberry Pi Power supply
-Micro SD card (8Gb minimum)
-Your PC (We used Windows 10)
-Ethernet cable (optional)
Getting the Raspberry Pi OS
Install Raspbian on the SD card by following the steps described here. This is called the headless configuration which allows the Pi to be setup without the need of connecting the Pi to a monitor and without a mouse and keyboard.
In summary, image the latest Raspbian on the SD card using Etcher or Win32DiskImager. After the SD card is imaged, place a file name “ssh” without quotes and without any extension on the SD card root. Then also place your wpa_supplicant.conf file in the root. An example of a config for a WPA2-PSK AES router is:
Once you have done that, eject the SD card from your PC and plug it in your Raspberry Pi and power your Pi.
Check the connection
In principle, the Raspberry Pi should now have automatically connected to your Wifi. Log on to your router gateway or admin url, 192.168.0.1 or similar to see if you can see the connected devices. You should also see the IP address assigned to the Raspberry Pi.
If you don’t know the login details to your router, you can also use an IP Scanner software.
If for some reason or another, you don’t see the Raspberry Pi connection, it means that your Wifi wpa_supplicant.conf was not configured properly. You will need to connect the Pi to your router using an ethernet cable and configure your wifi using VNC, steps shown below. Please bear in mind that the Raspberry Pi Zero do not have a physical ethernet port!
Login to your Raspberry Pi through SSH using Putty
Once you have the Pi IP address, you can connect to Pi through SSH by using Putty. The default login details are: pi/raspberry.
Now that you have an IP address for your Raspberry Pi, fire up Putty on your Windows PC and connect to the Pi through SSH with the Pi’s IP address as the host name. Leave the port as default.
The connections should be successful if you have put the file “ssh” as described above.
The default login details are: pi/raspberry.
Now that you have an active session with your Pi, you can configure a few more things such as VNC. VNC is, in simple words, a remote desktop GUI.
In your putty terminal, type:
Press enter and you will see this screen:
Then, go into interfacing options and enable the VNC:
4. Connection to your Raspberry Pi with VNC
On your PC, open the VNC Viewer and put the Pi IP to remotely connect to it:
Then, you’ll see the Raspbian interface, Stretch in our case 🙂
If your Wifi connection was not successful before and you have been using your ethernet connection, you can now configure your Wifi through the GUI interface.
If the Pi is connected to the router through Ethernet, the WiFi connection may not work so you can open the CLI/putty and type this command:
wpa_passphrase "mywireless_ssid" "yourpassphrase" | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf
This will modify the wpa_supplicant.conf file where you WiFi connection details are stored.
Then, type sudo reboot so the Pi will restart and automatically connect to the WiFi. From now, you can use the VNC connection using the WiFi IP address your Pi and you can forget about the ethernet cable. Now, if you connect to a new router, and don’t want to use the monitor and keyboard, you need to repeat the process again.
Transferring file to and from your Raspberry Pi
On some occasion, you may want to transfer data and files to and from your Raspberry Pi and to do this, we are going to use FileZilla. The Pi uses SSH File Transfer Protocol.
In the FileZilla window, go to File-> Site Manager..
Select SFTP for the protocol and put the Pi IP address, Username and Password and connect.
If you find any problem with this option, just drop an email at email@example.com.