To start, I have been looking through alot of similar questions, but they all seemed to have the same solution that didnt work for me. I am working on a PI 1 Model B. This doesn't have Wifi onboard, so I have a 802.11n usb wifi connecter. I have used this PI before and have been able to connect to the internet, and while not impossible, i would highly doubt the board has been damaged since then.
I recently installed a fresh instance of the Raspbian from the imager, and have it set up a "connected to the wifi". I am able to ssh into the machine, and it shows wifi bars above, but I cannot use the terminal for any internet facing tasks, such as pinging a location off my network. Strangely I am to connect to use the browser to connect to the internet, though verrrrry slowly; sugesting the problem lies with the terminal set-up somehow.
Some of the solutions I have tried include:
1) Adding the one of following to my /etc/network/interfaces file
#Attempt 1
auto lo
inface lo inet loopback
inface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_suppliciant.conf
iface default inet dhcp
#Attempt 2
iface wlan0 inet static
address 192.168.1.212
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
#Both attempts disabled my connection not allowing me to ssh in until i removed them.
I also have this in my /etc/wpa_supplicant/wpa_supplicant.conf file
network={
ssid=NAME_OF_NETWORK
psk=PASSWORD_OF_NETWORK
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
where both name and password are correct.
2) Using a ethernet cable, didnt seem to change any of this, beyond the ip address being used.
3) A number of small changes to the above attempts, none of which were meaningfully different from what I could see, and none worked better, and weren't trying to solve my route problem.
The output of route -n is (note the Ip address was 192.168.1 113 for wifi and 101 for ethernet, not sure if they are meant to appear in the routing table or not.)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0
So, that leaves the underlying problem. Why can my terminal not ping www.google.com / install any packages, but it can browse the web?
EDIT: The wifi dongle being used works on a windows machine, and worked on the PI when i used it before a couple of years ago on a different install