If you click on
CMD + SHIFT + x
while running the Raspberry Installer it opens a menu with allows you to set up ssh and wifi in GUI.
In order to connect your raspberry pi to the internet, start a mobile hotspot and connect your laptop to it.
Then remove the SD card from the raspberry pi and slot it into your sd card reader (please ask for an apapter if needed).
After a few seconds should see a boot folder appearing on your desktop, you will need to the folder in your computer terminal. In order to do this use CMD + SPACE and type `terminal`
on Mac or use the start button on Windows to look for `Powershell`. If you're using Linux, then I assume you know what to do :).
In your terminal first type `pwd` to see the directory you are in.
pwd
Now, we need to move inside the boot directory to access files which are used by the raspberry pi.
To navigate to the right directory type:
cd /Volumes/boot
Notice there is a "/" in front of Volumes, this is important and can easily be forgotten.
Now let's first create a file that allows us to ssh into our raspberry pi. SSH is a way to securely connect two or more computers, usually via command line interface.
You can imagine ssh as a secret tunnel that will allows us to reach the raspberry pi and run commands on it from another laptop.
Type the following command to enable ssh on the raspberry pi.
touch ssh
Next we will create configuration file to set up the wifi.
Create a new file called wpa_supplicant.conf using the touch command.
touch wpa_supplicant.conf
Now we will need to add a few lines to this file.
sudo vim wpa_supplicant.conf
This will prompt you for your admin password (the same as when you log into your computer) and will then open a terminal based editor.
Now type the letter "i" to get into insert mode.
i
Then copy/paste the following code snippet, which I found on
the raspberry pi spy website.
country=gb
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="yourHotspotSSID"
psk="yourHotspotPassword"
}
The first line is a definition which explains the raspberry pi computer how to load the file.
The second line contains the country code, which we can leave as GB (unless you're not in the UK), then there are two fields for the mobile hotspot
name and password. You can find the information on your mobile phone, where you set up the hotspot.
The only thing left to do is closing vim (which even some experienced Software Engineers find challenging ;) )
In order to close vim type: first Esc, then : (colon) followed by wq and press enter.
ESC : wq ENTER
Nice work! Now leave the /boot directory by typing `cd ..` and eject the SD card.
cd ..
Now let pop the SD card back into the raspberry pi and connect it to the power source. You should see a constant red light and a flashing yellow one.
There are several ways of checking your pi has connected to your hotspot.
Fing is a useful and user friendly app,
which you can download on your phone to check all the pis that are connected to the WIFI. Make sure you see your Raspberry Pi (with the right name) show up.