Page 1 of 1

Wifi dongle not working with Raspbian Jessie 25-11-16

Posted: Fri Dec 16, 2016 7:09 pm
by abhishek.embsys
Hi all
I am using latest Raspbian Jessie with Pixel image 25-11-16 and trying to connect my wifi dongle TP-LINK TL-WN823N.
This dongle used to connect out of box with wheezy but fails with jessie.
I can see my wlan0 IP-address and see available wifi networks, connect to my network but could not browse web !! I can browse net when my laptop wifi is connected but that is not what i need.....Can any one tell me how to solve this issue ??

output of ifconfig
pi@raspberrypi:~ $ ifconfig

wlan0 Link encap:Ethernet HWaddr 60:e3:27:0b:df:92
inet addr:192.168.1.72 Bcast:192.168.xx.xx Mask:255.255.255.0
inet6 addr: fe80::c2fe:608d:7477:2e5c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:521 errors:0 dropped:0 overruns:0 frame:0
TX packets:50 errors:0 dropped:1 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:87805 (85.7 KiB) TX bytes:8509 (8.3 KiB)

Output for lsusb
pi@raspberrypi:~ $ lsusb
Bus 001 Device 004: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

pi@raspberrypi:~ $ iwconfig
wlan0 IEEE 802.11bg ESSID:"connect" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:2.437 GHz Access Point: 6C:FD:B9:43:01:B8
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=100/100 Signal level=61/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

lo no wireless extensions.

eth0 no wireless extensions.


/etc/network/interfaces -- default file

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

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

/etc/wpa_supplicant/wpa_supplicant.conf

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

network={
ssid="connect"
psk="mypassword"
}

/etc/dhcpcd.conf

Added following lines to make static IP address

interface wlan0
static ip_address=192.168.1.72
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
static domain_search=

pi@raspberrypi:~ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 10.42.0.1 icmp_seq=1 Destination Net Unreachable
From 10.42.0.1 icmp_seq=2 Destination Net Unreachable
From 10.42.0.1 icmp_seq=3 Destination Net Unreachable
From 10.42.0.1 icmp_seq=4 Destination Net Unreachable
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 2997ms

pi@raspberrypi:~ $ ping 192.168.1.72
PING 192.168.1.72 (192.168.1.72) 56(84) bytes of data.
64 bytes from 192.168.1.72: icmp_seq=1 ttl=64 time=0.179 ms
64 bytes from 192.168.1.72: icmp_seq=2 ttl=64 time=0.133 ms
64 bytes from 192.168.1.72: icmp_seq=3 ttl=64 time=0.133 ms
64 bytes from 192.168.1.72: icmp_seq=4 ttl=64 time=0.116 ms
^C
--- 192.168.1.72 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.116/0.140/0.179/0.024 ms
pi@raspberrypi:~ $ ping google.com
PING google.com (216.58.220.206) 56(84) bytes of data.
From 10.42.0.1 icmp_seq=1 Destination Net Unreachable
From 10.42.0.1 icmp_seq=2 Destination Net Unreachable
From 10.42.0.1 icmp_seq=3 Destination Net Unreachable
From 10.42.0.1 icmp_seq=4 Destination Net Unreachable
^C
--- google.com ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3001ms

pi@raspberrypi:~ $ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.42.0.1 0.0.0.0 UG 202 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0 0 wlan0
10.42.0.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 wlan0


10.42.0.44 is the address at which laptop is connected to pi over ethernet.

As far I can see, somehow, wifi uses the gateway of ethernet 10.42.0.1 to access google.com, whereas it should use the gateway of 192.168.1.1....How to tell pi to use the wifi gateway and not ethernet gateway......I am using ubuntu as host

Thank you for your time and help.

Re: Wifi dongle not working with Raspbian Jessie 25-11-16

Posted: Sat Dec 17, 2016 12:41 am
by tweak42
What encryption is your wifi network, wep or wpa2? Instead of a static address, can you try dhcp assigned?
In the examples of wpa_supplicant.conf I could find, they all had a key_mgmt entry under the network entry, even it it was set to NONE. For wpa2 encryption I think it should be WPA-PSK.


network={
ssid="connect"
psk="mypassword"
key_mgmt=WPA-PSK
}

Re: Wifi dongle not working with Raspbian Jessie 25-11-16

Posted: Sat Dec 17, 2016 2:43 pm
by abhishek.embsys
Thank you for reply
Tried as per suggestion by adding WPA-PSK or using dhcp (without static IP) but not success :x . When I disconnect my laptop wifi, pi could not find internet using its wifi dongle and network not reachable. You can see the problem in GUI image file attached

Re: Wifi dongle not working with Raspbian Jessie 25-11-16

Posted: Sun Dec 18, 2016 4:51 am
by tweak42
abhishek.embsys wrote:Thank you for reply
Tried as per suggestion by adding WPA-PSK or using dhcp (without static IP) but not success :x . When I disconnect my laptop wifi, pi could not find internet using its wifi dongle and network not reachable. You can see the problem in GUI image file attached
How about if you use dhcp and temporarily turning off wifi encryption on your router and see if it connects and pings? It sounds like the interface is up, but none of the IP packets are reaching the wifi router. This points to the encryption not lining up or the radio on the adapter isn't physically transmitting.

Re: Wifi dongle not working with Raspbian Jessie 25-11-16

Posted: Tue Dec 20, 2016 3:36 pm
by abhishek.embsys
Nothing works are suggested ! I have even reset my router to factory setting.
I cannot connect my wifi dongle in wheezy image also. Same problem exists there as well
Same wifi dongle works fine when connected in my laptop using ubuntu...so dongle is also working fine

I think this info can be of some help but could not find the solution:

pi@raspberrypi:~ $ ping google.com
PING google.com (216.58.220.206) 56(84) bytes of data.
From 10.42.0.1 icmp_seq=1 Destination Net Unreachable
From 10.42.0.1 icmp_seq=2 Destination Net Unreachable
From 10.42.0.1 icmp_seq=3 Destination Net Unreachable
From 10.42.0.1 icmp_seq=4 Destination Net Unreachable
^C
--- google.com ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3001ms

10.42.0.44 is my ethernet connection address.....but while pinging from pi,it searches ethernet address and not wifi dongle. Why?? Even though i can access router page using 198.168.1.1 and change any setting from pi but internet packet are not exchanged......I am really stuckup...this problem does not use to be there till last 15 days....suddenly everything does not work

Re: Wifi dongle not working with Raspbian Jessie 25-11-16

Posted: Tue Dec 20, 2016 4:01 pm
by 6by9
You've actually quoted the relevant data in your first post

Code: Select all

pi@raspberrypi:~ $ route -n
Kernel IP routing table
Destination Gateway     Genmask       Flags Metric Ref Use Iface
0.0.0.0     10.42.0.1   0.0.0.0       UG    202    0   0   eth0
0.0.0.0     192.168.1.1 0.0.0.0       UG    303    0   0   wlan0
10.42.0.0   0.0.0.0     255.255.255.0 U     202    0   0   eth0
192.168.1.0 0.0.0.0     255.255.255.0 U     303    0   0   wlan0
The lower the metric, the better the route is. So your configuration says that going via 10.42.0.1 on eth0 is lower cost than your wifi, therefore that is the preferred route.
Stackoverflow would imply that adding

Code: Select all

interface eth0
metric 400
to /etc/dhcpd.conf should do the trick by dropping the priority / increasing the metric for eth0, therefore wlan0 should be preferred.

Re: Wifi dongle not working with Raspbian Jessie 25-11-16

Posted: Tue Dec 20, 2016 11:28 pm
by abhishek.embsys
perfect solution !!
works on both wheezy and jessie versions of raspbian OS
Thanks man :D U r genius....it was really frustating

Thank you again