1

I want to be able to enter wireless details such as SSID and password onto the OS and have the Pi boot up for the first time and connect to an access point, without having to first configure it via an ethernet connection. How can I do that?

Apart from the Pi I only have access to Mac hardware.

3
  • You can configure it to a extent from editing files on the card - which OS are you using on the Pi (and the computer you are configuring it from)?
    – Wilf
    Sep 20, 2015 at 19:03
  • I'm using Raspbian for the most part. I also don't have access to any other Linux clients than the Pi.
    – yusf
    Sep 22, 2015 at 18:13
  • Either use the first pi as your editing platform, or probably more efficiently use a live linux image in a virtual machine on the mac. Nov 22, 2015 at 0:17

2 Answers 2

1

If you're using Raspbian then the easiest way is by using wpa_supplicant.

First make sure wpa_supplicant is managing your WLAN (I'm assuming it's wlan0 here) by editing /etc/network/interfaces:

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

Then input your WiFi details in /etc/wpa_supplicant/wpa_supplicant.conf

network={
    ssid="Your SSID here"
    psk="Your password here"
    key_mgmt=WPA-PSK
}
11
  • BEWARE This may not work with the latest Raspbian, which uses dhcpcd
    – Milliways
    Sep 20, 2015 at 23:53
  • @Milliways I'm using this on Raspbian Jessie with dhcpcd disabled. Sep 20, 2015 at 23:55
  • In which case it probably won't work for the questioner, who is unlikely to be using a prerelease.
    – Milliways
    Sep 21, 2015 at 4:32
  • @Milliways this exact configuration is on my Raspbian Wheezy as well. I haven't touched dhcpcd there. Sep 21, 2015 at 11:39
  • I am not saying this can't be made to work. Are you using the May 2105 issue of Raspbian? If not have you installed raspberrypi-net-mods? If not your installation is unlikely to be representative of most new users asking questions here.
    – Milliways
    Sep 21, 2015 at 12:11
1

This should actually work pretty much out of the box. If you are able to mount an ext4 partition (which as far as I understand should be feasible with Mac OS) you can mount the second partition of the sd card (not the one labeled boot, but the other one with the root file system) and edit /etc/wpa_supplicant.conf to your needs.

Assuming your AP is protected with WPA/WPA2 you will have to add the password to the wpa_supplicant.conf. Easiest way is by doing following as root:

wpa_passphrase "AP-name" "password" >> /etc/wpa_supplicant/wpa_supplicant.conf

That's the only thing you should need to change. Having a compatible USB wifi adapter it shouldn't require anything else. This is tested on Raspbian Jessie and Jessie lite as of jan 2016.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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