Embedded Systems Hobbyist Guide
Minimalist Raspberry Pi Headless Setup
“Everything is designed. Few things are designed well.” -Brian Reed
Raspberry Pi is your credit-card sized computer. It’s a must-have for techies and electronics lovers.
Usually the Pi requires some hardware to set up and use but if you are comfortable with the command line, and a lazy bum like me, the setup process can be breezed with minimal setup .
Hardware Needed :
- Raspberry Pi 3 or 4
- Micro SDCARD at least 16GB
- A computer or laptop with internet access
- 5V DC power supply with MicroUSB
Preparing your SDCARD
The Raspberry Pi foundation provides their Operating System, recently renamed from Raspbian to Raspberry Pi OS, you can download your preferred flavor from here: https://www.raspberrypi.org/downloads/raspberry-pi-os/.
After you’ve downloaded the OS, its time to format your SDCARD, it is necessary to format the card to the right format i.e FAT-32.
You can use sofware like Raspberry Pi Imager and SD Card Formatter to achieve this.
Moving on, after you’ve formatted your Card its time to etch/burn the OS image onto it, which can be achieved very easily with a software called ETCHER you can download it from here: https://www.balena.io/etcher. You just have to select the Raspberry Pi OS image then select your SDCARD and flash!
Note: You might have to eject and re-insert the card before the next step.
Configuring the Card for Headless Boot
After re-inserting the card, it will show up as ‘boot’ drive, now follow the steps below :
- Create a file named ‘ssh’ without any extensions in the boot drive.
- Create a file named ‘wpa_supplicant.conf’ with the following data :
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country= PK
network={
ssid=”WiFi_SSID”
psk=”WiFi_Password”
}
3. Change the country to your country, and change the SSID and PSK to your WiFi name and Password.
Save the file and remove your SDCARD.
Booting up the Pi using SSH
Insert your SDCARD into the Pi and connect it to power, wait a few seconds then shift your Computer/Laptop.To access your Pi remotely over SSH you will need two things PuTTY(in case of windows) and your Pi’s IP address.
You can download PuTTY from here: www.putty.org
You can find your Pi’s IP address from :
- Fing App
- From your routers access page, URL: 192.168.X.1
From Windows Shell type ping raspberrypi.local
and you should get a response like
PING raspberrypi.local (192.168.1.33): 56 data bytes
64 bytes from 192.168.1.33: icmp_seq=0 ttl=255 time=2.618 ms
The 192.168.X.X is your Pi’s IP address.
4. From Mac OS Terminal type: ping raspberrypi
Once you’ve got your Pi’s IP address now it can be accessed remotely.
With PuTTY on Windows:
Enter your Pi’s IP address in the ‘Host Name’ field.
Enter ’22’ in the port.
Select SSH as ‘connection type’
If you are prompted for a Username and Password then enter, ‘pi’ and ‘raspberry’
From Terminal on Mac/Linux :
1. Open your terminal and type: ssh pi@192.168.X.X
2. Enter ‘yes’ if prompted for fingerprint.
3. Enter the password: raspberry
Bonus Tips:
After you have got access to your pi, you should run some commands to get up to date and change the default password.
Changing the Password:
- In the terminal screen type:
sudo passwd pi
and enter your new password.
Updating the Software:
- In the terminal type:
sudo apt update && sudo apt upgrade -y