I have a Raspberry Pi 3 with Jessie and I forgot to bring a keyboard and mouse. I am at a new location and I need to connect my Pi to the WiFi here. I do not have an Ethernet cable.
I can access the SD card from a Windows computer.
Any ideas?
I have a Raspberry Pi 3 with Jessie and I forgot to bring a keyboard and mouse. I am at a new location and I need to connect my Pi to the WiFi here. I do not have an Ethernet cable.
I can access the SD card from a Windows computer.
Any ideas?
First, you need to add a file called ssh
(with no file extension) to the /boot/ directory on your SD card so that it will enable the SSH access. The content of the file doesn't matter.
Create a file name onetimewifi.txt
and save it to SD card /boot/ directory, the content of onetimewifi.txt
looks like this:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="wifi_ssid"
psk="wifi_password"
Boot your Raspberry Pi, and find out your raspberry pi IP address from your router (raspberry pi MAC address always started as b8:28:xx:xx:xx:xx
. If you don't have access to router, try run linux command on your terminal arp -a
.
Login to your raspberry pi using ssh command from putty (terminal application) ssh pi@192.168.0.100
(replace 192.168.0.100 with your own raspberry pi IP address you found out in step 3).
Once login, run sudo mv /boot/onetimewifi.txt /etc/wpa_supplicant/wpa_supplicant/wpa_supplicant.conf
.
This is similar to hcheung's response above, but a little simpler.
As of about a year ago, Raspbian will automatically move any wpa_supplicant.conf file it finds in the boot partition (which contains the files that the CPU reads on boot up) to the correct folder for everything to work.
So connect the SD card to your computer and create a file called wpa_supplicant.conf
in the drive it shows up as.
Note that if you do this from Notepad, when you save it you'll want to find the drop-down menu that says Text files (*.txt)
and select the option All files (*.*)
instead, otherwise it won't work correctly.
Put this in that file:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="<your wifi network name>"
psk="<your wifi network password>"
}
It should connect when you plug it in. If not, try rebooting (if you have no way to access a command line, you should be able to just pull the plug to shut it down, though avoid that if possible). If it still doesn't work, hcheung's solution is your best bet.