Home Raspberry Pi Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without keyboard or cables

Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without keyboard or cables

Connecting Raspberry Pi board to WiFi in seconds

You can find 100s of guides how to connect a Raspberry Pi to a network online, even I wrote about connecting it in 4 steps, setting a static IP, or enabling SSH via USB. However unless your board has Ethernet, and you can plug it somewhere, getting your Raspberry Pi online will require a keyboard, screen or working SSH connection. With this tip you can configure Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without keyboard or cables in seconds.

Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without cables

I came across this tip recently, and I thought I’d share it with you especially that it is very relevant to the release of Raspberry Pi A+, but it is super handy for Raspberry Pi Zero boards and when you can’t find the Ethernet cable.

A new feature has been added since Raspbian “Stretch” release. A WiFi config file can be loaded directly from the SD card.

Access the /boot partition on your SD card. Create the following files in the root directory:

  • ssh (empty file) to enable SSH interface
    remember the file will disappear after 1st boot and you will have to do it again. To make the SSH permanent use sudo raspi-config to enable interfacing
  • wpa_supplicant.conf (make sure it’s not saved as .txt) to enter WiFi credentials
    you will need to fill the file in with your WiFi information
Please note that both files will be deleted after the 1st boot, so if something fails, you will have to dump the files again.

wpa_supplicant.conf

The fille should be filled with your WiFi credentials. Feel free to use the template below:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<ISO Country Code>

network={
    ssid="SSID"
    psk="PASSWORD"
}

You can find your ISO Country code here, just use 2 letters, drop the <> characters. If you want you can specify a list of networks that Raspberry Pi will try to connect to.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<ISO Country Code>

network={
    ssid="SSID"
    psk="PASSWORD"
    id_str="Work"
}
network={ 
    ssid="SSID" 
    psk="PASSWORD"
    id_str="Home" 
}

If more than one network is present, you can specify the priority of the connections too!

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<ISO Country Code>

network={
    ssid="SSID"
    psk="PASSWORD"
    priority=1
    id_str="Network1"
}
network={ 
    ssid="SSID" 
    psk="PASSWORD"
    priority=2
    id_str="Network2"
}

Save the file and then reboot the Rasberry Pi. After a couple of moments, you should be able to see a new device joining the network. I use Fingbox and Fing app to monitor my network.

Once the device is online, use Putty to connect to the board via SSH and run

sudo raspi-config

to change the password, enable SSH permanently and modify the hostname if needed.

It’s a quick and easy way of setting Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without keyboard or Ethernet. Frankly speaking, I will be using this method from now on, as it saves some time. I will create the zip file which I simply have to unpack to the /boot directory containing ssh & wpa_supplicant.conf files. This way, getting the Raspberry Pi online will only take seconds.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated in style with crypto-currency

SATA HAT

Add an SSD to Raspberry Pi 4 and turn it into a super-cooled NAS drive.

More HATs

Argon One

Enclose Raspberry Pi 4 inside this great case with custom I/O, cooling and GPIO

More cases on

Best Raspberry Pi Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

Free wireless doorbell (Amazon Dash button hack)

0
The most terrifying situation I can imagine* is missing a parcel

Raspberry Pi NAS: (NAS-pi) Modding like a boss #part2

0
Plex and RAID1 NAS drive build log

MagPi – auto-downloader

0
Grab each edition of Mag Pi as soon as possible!

HOW TO...

How to boot Raspberry Pi 4 from USB

0
How to set up and boot Raspberry Pi 4 from USB drive - headless guide.

Raspberry Pi Zero, Raspberry Pi 3A+ WiFi without keyboard or cables

0
Getting Raspberry Pi boards connected in seconds

Everything you need to start using JSON

0
It's JSON not Jason, just saying!

How to use Join App in NodeRED

0
The day finally comes where Join app is almost everywhere!

Driving LCD with Arduino and Raspberry Pi

0
Displaying things on an LCD screen is as easy as going through a cup of jellybeans while writing this tutorial!