0

I get a RT5370 wireless adapter for my RPi 2b to connect the Internet. I check that my adapter works good (I can use it scan the network and truly see the wifi that I want to use), and when I run sudo

/etc/init.d/networking restart

It just says reconfiguring network interfaces...done. Nothing strange. I'm confused why I still cannot connect to the Internet. I ran

ping google.com

and it said

ping: unknown host google.com

For clarity, here is my /etc/network/interfaces:

auto wlan0
iface wlan0 inet manual
wpa_roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet static 
address xxxx
netmask xxxx
gateway xxxx

Here is my wpa_supplicant.conf

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

network = {
      ssid=
      password=
      xxxx
      xxxx
}

Does anyone have ideas? Thanks!

0

You have wrong wpa_supplicant.conf setting, It should be:

network={
    ssid="yourssid"
    psk="yourpassword"
}

Your /etc/network/interfaces should remain as default:

auto lo
iface lo inet loopback

iface eth0 inet manual

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

And if you want to assign a static IP, you do it in /etc/dhcpcd.conf, by adding the following lines to the end of the configuration file:

interface wlan0
static ip_address=192.168.0.xxx/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Replace the IP addresses with your own network/router IP addresses if it is different from the example.

  • Thanks! I tried your method. But I don't have dhcpcd.conf in /etc/. So I don't use a static address to check. But still, when I try ping google.com, it says unknown host google.com. Ping 8.8.8.8 says the network is unreachable. – Tian Xie Aug 15 '17 at 4:08
  • What OS and version you are using? Raspbian Jessie or something else? – hcheung Aug 15 '17 at 5:46
  • Yeah, I use Raspbian. – Tian Xie Aug 15 '17 at 17:30
  • That's strange, dhcpcd.conf should be there by default even on a fresh Raspbian Jessie installation. Without it, your DHCP and domain server won't function correctly. I would suggest you try to create a new SD card and test it out. – hcheung Aug 16 '17 at 0:49

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.