I'm using VNC viewer to connect to my Raspberry Pi 3 running Raspbian Stretch. I set up my wifi connection using the wifi setting on the menu bar. However, after I reboot the Pi it does not connect to wifi automatically and I have to manually connect it. Extensive google research yielded no working solutions. I have tried editing the interfaces file and wpa_supplicant.conf but nothing has worked so far.

my /etc/network/interfaces file:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

my /etc/wpa_supplicant/wpa_supplicant.conf file:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

  • I can only assume that in the field psk you actually didn't write the wifi password itself but the encrypted version of it as provided by wpa_passphrase, right?
    – eftshift0
    Apr 25, 2018 at 14:45
  • er no I've written my wifi password as is. Unencrypted. Apr 25, 2018 at 15:14
  • and it actually connects to the wifi at any given time? I don't think that's going to hold water, to the best of my knowledge
    – eftshift0
    Apr 25, 2018 at 17:07
  • Apparently it's possible to use ascii text for the password so I think it's ok. Nevermind. raspberrypi.org/documentation/configuration/wireless/…
    – eftshift0
    Apr 25, 2018 at 17:11
  • What's your system clock time? [check it with date in the terminal] Apr 25, 2018 at 19:54

2 Answers 2


What you have looks correct (assuming SSID and Password are correct) and you haven't modified any other files.

How are you accessing VNC if networking is not set?

See How to set up networking/WiFi

  • I'm using an ethernet cable to connect the pi to my router Apr 25, 2018 at 12:30

Try adding a line auto wlan0 in the /etc/network/interfaces file. That should make it work.

  • You should at least explain why the OP should ignore the second line Please note that this file is written to be used with dhcpcd in /etc/network/interfaces and what he must do with dhcpcd. We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed or you risk to get down votes.
    – Ingo
    Feb 7, 2019 at 23:26

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.