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.
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:
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
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.
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
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.