Headless RPI

I picked up this nifty hack when setting up a new Raspberry Pi 4 without a monitor connected. In fact I’m just acting as a parrot from the web, but here goes:

  1. Burn your Raspberry OS to the SD card using W32imagewriter
  2. Create a blank file named SSH on the root of the drive, no content,no extension
  3. Create a file called wpa_supplicant.conf on SD card root with the following content:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
country=<Insert 2 letter ISO 3166-1 country code here>

 ssid="<Name of your wireless LAN>"
 psk="<Password for your wireless LAN>"

And you’re all set 🙂

And by the way, if you’re wondering about your little tweaked RPI4 system temperatures, you could create a small bash script showing this

echo “$(date) @ $(hostname)”
echo “——————————————-“
echo “GPU => $(/opt/vc/bin/vcgencmd measure_temp)”
echo “CPU => $((cpu/1000))’C”
pitemp.sh script

antoher alternative could be to use Sysinfo PHP, put in on your webserver.

Edit phpsysinfo.new and change line SENSOR_PROGRAM to SENSOR_PROGRAM=Pitemp

Save the file as phpsysinfo.ini

More articles