I am configuring my Zero to connect to wifi in advance. My steps are:

  • Format SD card with SDFormatter
  • Burn Raspbian Jessie with Win32DiskImager
  • Mount the SDCard in Windows with Paragon ExtFs For Windows
  • Modify /etc/network/interfaces

auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

  • Modify /etc/wpa_supplicant/wpa_supplicant.conf

network={ ssid="my network name" psk="my network password" proto=RSN key_mgmt=WPA-PSK pairwise=CCMP auth_alg=OPEN }

  • Connect a wifi dongle via OTG
  • Power on via USB cable to the laptop
  • Find the IP with SoftPerfect NetworkScanner
  • ssh in with Putty
  • Reboot with sudo reboot now

After waiting a few minutes to reboot I can no longer find the IP on my network scanner.

Unplugging and reboot has no effect either.

I have done it several times and each time I start for the first time I can ssh in (and even VNC in). However, as soon as I restart I can't connect.

Is there a log somewhere of the boot process to help understand why the second boot doesn't connect to wifi but the first does?

EDIT: Following the comments I checked the files again. This morning they were both full of NULLs (binary?) so I changed them to the new setup as mentioned by @Milliways.

I restarted, connected to wifi, did sudo reboot now and the following was in wpa_supplicant:

:38 raspberrypi dhcpcd[436]: dev: loaded udev
May 22 04:22:38 raspberrypi systemd[1]: Started getty on tty2-tty6 if dbus and 

And the following was in the interfaces file:

: Starting system-ifup.slice.
May 22 04:22:38 raspberrypi systemd[1]: Created slice system-ifup.slice.
May 22 04:22:38 raspberrypi console-setup[264]: Setting up console font and keymap...done.
May 22 04:22:38 raspberrypi systemd[1]: Started LSB: Set console font and keymap.
May 22 04:22:38 raspberrypi wpa_supplicant[372]: Successfully initialized wpa_supplicant
May 22 04:22:38 raspberrypi wpa_supplicant[373]: wlan0: Trying to associate with SSID 'RHAP1'
May 22 04:22:38 raspberrypi wpa_supplicant[373]: wlan0: Associated with 00:1e:13:1c:04:30
May 22 04:22:38 

Why is my Pi logging to the configuration files???

  • Can you check the sd card after reboot with your Windows PC, to see if your changes have been undermined by the Pi after a reboot? Commented May 22, 2016 at 5:47
  • 1
    What you have would have been unreliable under Wheezy and is obsolete on Jessie (although it may work if the network was available at boot). You should do it in a more robust manner. See How do I set up networking/WiFi/Static IP
    – Milliways
    Commented May 22, 2016 at 7:35


Your Answer

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

Browse other questions tagged or ask your own question.