Baroiu
Posts: 2
Joined: Mon May 21, 2018 5:12 am

Trouble connecting to wifi

Mon May 21, 2018 5:17 am

Hello all,

I bought a Raspberry Pi 3 about 10 months ago but only recently started playing around with it again. I have been experiencing a lot of trouble trying to connect my device to my wifi. I have been successful in using a wired ethernet connection, however the application for which I have planned to use the Pi lends itself more to a wireless connection. I am a beginner and have very little experience working with a raspberry pi. If anyone is able to offer any insight into how to solve this problem, I would be very appreciative!

I have tried the method outlined in this link: https://docs.dataplicity.com/docs/get-p ... e-internet, which edits: sudo nano /etc/network/interfaces with no success.

Thanks!

User avatar
rados-dataplicity
Posts: 40
Joined: Wed Aug 03, 2016 11:56 am
Location: UK
Contact: Website Facebook Twitter

Re: Trouble connecting to wifi

Mon May 21, 2018 9:42 am

Hmmm, have you a version of Raspberry Pi with wifi module built in?
I tinker around with Raspberry Pis daily and make sure that people can easily access theirs remotely.

Community outreach @ dataplicity.com

jbudd
Posts: 988
Joined: Mon Dec 16, 2013 10:23 am

Re: Trouble connecting to wifi

Mon May 21, 2018 12:06 pm

I have tried the method outlined in this link: https://docs.dataplicity.com/docs/get-p ... e-internet, which edits: sudo nano /etc/network/interfaces
That tutorial is out of date. With the current version of Raspbian you setup wifi in /etc/wpa_supplicant/wpa_supplicant.conf not /etc/network/interfaces.

/etc/network/interfaces should contain

Code: Select all

# 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


/etc/wpa_supplicant/wpa_supplicant.conf should contain

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
        ssid="Your network SSID in quotes"
        psk="Your wifi key in quotes"
}
rados-dataplicity - any chance of getting your tutorial updated?

MaxK1
Posts: 1043
Joined: Sun Aug 26, 2012 11:34 pm

Re: Trouble connecting to wifi

Mon May 21, 2018 4:36 pm

Past the "sell by" date is a common problem, you are better off using the Pi forums than going off the reservation for bit rotted "how-to's" written by individuals who may or may not have known what they were talking about when the information was current!
You are in a maze of twisty little passages, all alike.
When General Failure and Major Disaster get together, Private Parts usually suffers.

Baroiu
Posts: 2
Joined: Mon May 21, 2018 5:12 am

Re: Trouble connecting to wifi

Mon May 21, 2018 5:18 pm

Hi all, thank you for the quick replies!

jbudd - I tried your method, but I still have not successfully been able to connect to WiFi. The network shows up when I open the drop down menu and when I enter in the password for my network, the dialog box disappears as if the password is correct and the connection is going to be established. However, nothing changes and the WiFi is still disconnected. It may also be possible that in my tinkering I've accidentally altered the settings in some other part of the software which is now causing my connectivity issues. Do you have any other recommendations?

Thanks!

jbudd
Posts: 988
Joined: Mon Dec 16, 2013 10:23 am

Re: Trouble connecting to wifi

Mon May 21, 2018 5:34 pm

I've never used the GUI WiFi setup.

What sort of encryption do you use? The sample wpa supplicant file I posted is for the commonest - WPA2 PSK.

Make sure you set the right locale And timezone in raspi-config. After doing that check that the country code line is in wpa supplicant.conf

If you can't get it to work, burn a new raspbian image with etcher and don't touch /etc/network/interfaces.

User avatar
HawaiianPi
Posts: 4597
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Trouble connecting to wifi

Mon May 21, 2018 5:43 pm

Here is a way to pre-configure Raspbian to connect to your WiFi at first boot.
  1. Grab the latest Raspbian image from https://www.raspberrypi.org/downloads/raspbian/
  2. Grab the Etcher software from https://etcher.io/
  3. Install Etcher and use it to write the Raspbian image to your SD card.
    • You don't need to extract the image or format the card prior to writing.
    • Just run Etcher, choose the Raspbian .zip you downloaded, pick your SD card and write.
    • If you have trouble, verify the SHA256 checksum of the download.
    • Writing an image to your card will erase everything previously on it!
  4. Remove and reinsert the SD card so that your Windows or Mac PC can see the small FAT32 partition on the card (labelled "boot").
    • If you get a message telling you the card must be formatted, cancel it.
  5. On that small FAT32 partition, create a file with the name wpa_supplicant.conf, which has the following inside:

    Code: Select all

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    country=GB
    
    network={
         ssid="Your network name/SSID"
         psk="Your WPA/WPA2 security key"
         key_mgmt=WPA-PSK
    }
    • Edit country=, ssid= and psk= with your information and save the file.
    • Use the 2 letter country abbreviation in CAPS (without this you will have no WiFi).
    • Use a pure text editor, not a word processor, to edit the wpa_supplicant.conf file.
  6. Make sure the wpa_supplicant.conf file is in the main directory of the small FAT32 partition, not in any folder.
  7. Safely eject the card from your PC and use it to boot the Pi.
It should boot up and automatically connect to your WiFi.

You don't have your location in your profile, so I don't know if this could be an issue, but Raspbian comes configured for the British English (GB) keyboard layout by default, and there are some differences between that and the USA keyboard layout, which could affect entering passwords.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Return to “Beginners”