Headless Raspberry Pi Setup

I’ve been using a raspberry pi as a ADSB data feeder for FlightAware and FlightRadar24 for a while and the micro sd card developed a bad sector. That meant I needed to rebuild the installation. I really didn’t want to deal with connecting a keyboard, monitor, and mouse to the Pi for the installation. I found https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html giving me useful information on how to avoid all that. I’m documenting my steps here for my own memory.

Step 1. Download the most recent version of Raspian Buster Lite from https://www.raspberrypi.org/downloads/raspbian/

Step 2. Download balenaEtcher portable from https://www.balena.io/etcher/

Step 3. Use Etcher to overwrite an SD card with the Raspian image I downloaded earlier.

2019-09-09 (28)2019-09-09 (29)2019-09-09 (30)2019-09-09 (31)2019-09-09 (33)2019-09-09 (34)

Step 4. Eject the flash card and close Etcher, then insert the flash card again, rejecting the option to format the drive.  The flash card is now formatted with multiple partitions, only the first is easily read in windows.

Step 5. create two files on the sd card boot partition. ssh and wpa_supplicant.conf. ssh is an empty file. wpa_supplicant.conf should have the following contents, customized for your WiFi Network:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
       ssid="MyNetworkSSID"
       psk="MyNetworkPassword"
}

Step 6. Eject your micro sd card, put it in the Raspberry Pi and power on the raspberry. You’ll need to wait a couple of minutes for the raspberry to finish several steps before you can connect to it over the network. The Raspberry Pi is expanding the native filesystem to fill the available space on the flash card, then rebooting another time with the new filesystem. You’ll need to figure out what IP address the Raspberry retrieved on your network. If you have access to your router, you may be able to see the attached devices and find the new Raspberry that way. I like the NirSoft Wireless Network Watcher to find what’s on my network https://www.nirsoft.net/utils/wireless_network_watcher.html.

Step 7. Connect to the Raspberry Pi with ssh. You’ll be using the default user and password to connect: “pi” and “raspberry”. I used the new Microsoft Windows Terminal in Windows 10 for this example. https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701#activetab=pivot:overviewtab

2019-09-09 (35)

The Raspberry is up and running now. There are several steps I recommend to do immediately. Use sudo raspi-config to set the user password, the machine hostname, and the timezone you want the machine to use.

2019-09-09 (36)2019-09-09 (37)2019-09-09 (38)2019-09-09 (39)2019-09-09 (40)2019-09-09 (41)2019-09-09 (42)2019-09-09 (49)2019-09-09 (50)2019-09-09 (51)2019-09-09 (52)2019-09-09 (53)2019-09-09 (44)

After waiting for the raspberry to reboot and reconnecting via ssh, updating the software to the latest version is the next step.

sudo apt-get update -y
sudo apt-get upgrade -y
sudo shutdown -r now

2019-09-09 (47)

Then I install several tools that I like to have.

sudo apt-get install lighttpd mc mrtg lrzsz nmap dnsutils etherwake snmpd snmp arp-scan shairport-sync -y

My next steps are to get PiAware and FlightRadar up and running.

Advertisements

One thought on “Headless Raspberry Pi Setup

  1. Pingback: Raspberry PiZeroW Camera Module | WimsWorld

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s