Headless Raspberry Pi with WiFi
The very first thing I needed to do as part of my Raspberry Pi Thermostat Project was get a headless Raspberry Pi working on my WiFi. There were a couple of gotchas I ran into here since it was my first time actually booting up a Raspberry Pi.
Hardware involved:
- A Raspberry Pi 3 Model B
- A micro SD card with a capacity of at least 8 GB. This one should work.
- A micro USB power adapter that serves 5V at at least 2 amps. If you try to use an old phone adapter, it likely won’t provide enough power and the Raspberry Pi will reboot itself periodically. I bought this one from Amazon and it’s been working great for me.
Things I had to do:
- Download the Raspbian Linux distribution. Get the “Lite” version because we are not going to hook a monitor up to this.
- Flash it onto the micro SD card
- Create a file in the root directory of the micro SD card called
ssh
. This tells the Raspberry Pi to enable SSH. - Create a file in the root directory of the micro SD card called wpa_supplicant.conf and make it look like this with my WiFi SSID and password:
network={ ssid="SSID" psk="PASSWORD" }
- Put the micro SD card into the Raspberry Pi and boot it up.
- Log in to my router to find the IP address of the Raspberry Pi device.
- SSH into the Pi with
ssh pi@192.168.1.42
and passwordraspberry
And I’m in! Next step in the Raspberry Pi Thermostat Project: connect a thermometer.