0

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?

0
  1. 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.

  2. 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"
    
  3. 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.

  4. 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).

  5. Once login, run sudo mv /boot/onetimewifi.txt /etc/wpa_supplicant/wpa_supplicant/wpa_supplicant.conf.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.