Problem enabling network in linux

Started by sqt, November 14, 2014, 01:52:07 PM

Previous topic - Next topic

sqt

I am using buildroot to generate a minimal linux with QT4. I used the sunxi-linux HEAD from github https://github.com/linux-sunxi/linux-sunxi. I enabled the <Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter> wifi driver in the linux  menuconfig.

When it is run on an a13 board, everything loads fine. Then I loaded the module
modprobe rtl8192cu

Here is the debug info produced

[   60.038078] rtl8192cu: Chip version 0x10
[   60.136612] rtl8192cu: MAC address: 48:02:2a:eb:1e:85
[   60.144490] rtl8192cu: Board Type 0
[   60.153163] rtlwifi: rx_max_size 15360, rx_urb_num 8, in_ep 1
[   60.164021] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw.bin
[   60.182843] usbcore: registered new interface driver rtl8192cu
[   60.211218] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[   60.262204] rtlwifi: wireless switch is on


However upon bringing the network up
ip link set wlan0 up

It shows link is not ready.
[  171.991724] rtl8192cu: MAC auto ON okay!
[  172.032026] rtl8192cu: Tx queue select: 0x05
[  172.413886] ADDRCONF(NETDEV_UP): wlan0: link is not ready

I am not able to proceed any further as dhcp and other steps does not work.
Seems like a bug in the driver. I don't know if its solved or is there any workaround.

Please help.

JohnS

The driver is in use by countless people so you've a config problem or you've chosen out of date software or left something out.

John

Gerrit

Quote from: sqt on November 14, 2014, 01:52:07 PM
I am using buildroot to generate a minimal linux with QT4. I used the sunxi-linux HEAD from github https://github.com/linux-sunxi/linux-sunxi. I enabled the <Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter> wifi driver in the linux  menuconfig.

That is not the right driver, you need "Realtek 8192C USB Wifi for SW"

this module is named 8192cu not rtl8192cu

sqt

Quote from: Gerrit on November 14, 2014, 04:07:27 PM

That is not the right driver, you need "Realtek 8192C USB Wifi for SW"

this module is named 8192cu not rtl8192cu

Gerrit,
  At first I used the "Realtek 8192C USB Wifi for SW". With that I was able to bring UP the link using |ip link set wlan0 up|. I was also able to scan and connect to an ssid. However, no matter what I tried I was not able to get an ip and connect to the internet. I used both static as well as dhcp method.

So, I thought to try out the <Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter> driver. Since, it was at least showing some debug.

Also, |iw dev| produced nothing for 8192cu, whereas it showed wlan0 in the list of devices while using rtl8192cu. So, I thought rtl8192cu was the correct one. Shouldn't 8192cu have produced a list of detected wlan devices with |iw dev|?

May be you are right about using 8192cu and not rtl8192cu. But either way I'm not able to connect to the internet.

Could someone give the correct procedure to connect to a WPA/WPA2 encrypted network. May be I'm missing something. Also please let me know if I need to enable any special kernel modules or kernel options. Like I have enabled IPv6, suspecting that it might be the problem.

Gerrit

what does iwconfig say ?
I get this result


wlan5     IEEE 802.11bg  ESSID:"MyNetwork"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:11:F5:CA:2F:D4   
          Bit Rate:54 Mb/s   Sensitivity:0/0 
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:****-****-****-****-****-****-****-****   Security mode:open
          Power Management:off
          Link Quality=100/100  Signal level=94/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


Did you use this config ?
https://drive.google.com/file/d/0B-bAEPML8fwlZ2huM3JPV3JpMTg/edit?usp=sharing

for your kernel, i would start with it and if things work see how you can change it to your liking.

sqt

#5
I can now connect to the internet. It was my mistake.  ???

@Gerrit I was using a13_defconfig and that seems to be working.

I finally got a message like yours. The problem was that I was using the WEP command to connect to WPA. The steps I followed said to use the command below for WPA as well
iwconfig wlan0 essid NETWORK_ID key s:WIRELESS_KEY
And so I did. The ifconfig -a showed connected to the SSID, but it was false. Later on digging deep I found that the above command only works for WEP.

So here is the procedure I followed. Maybe it will help someone.

Load the wifi module
modprobe 8192cu
See if wlan module appeared
ifconfig -a
look if a wlan device appear in the output similar to this
wlan0     Link encap:Ethernet  HWaddr 48:02:2A:EB:1E:85 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


To bring up the device (if your device is wlan0)
ifconfig wlan0 up
Now ifconfig -a should give something like this
wlan0     Link encap:Ethernet  HWaddr 48:02:2A:EB:1E:85 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:15 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


To scan for available AP
iwlist wlan0 scan
If the AP is WAP/WAP2 encoded then use wpa_supplicant to make a config file for your network AP
wpa_passphrase SSID PASSPHRASE > /etc/wpa_supplicant.conf
or
wpa_passphrase SSID > /etc/wpa_supplicant.conf
PASSPHRASE

now use the config file to connect to the SSID
wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf -Dwext
Check if wlan0 is connected to that SSID
iwconfig
something like this should appear
wlan0     IEEE 802.11bgn  ESSID:"SSID"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.412 GHz  Access Point: C0:3F:0E:A5:A0:EC   
          Bit Rate:150 Mb/s   Sensitivity:0/0 
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:****-****-****-****-****-****-****-****   Security mode:open
          Power Management:off
          Link Quality=100/100  Signal level=71/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


If the SSID name dont appear or the Encrytion Key is empty then connection must have failed.
Next to get an ip adresss
dhcpcd  wlan0
with some output like this
dhcpcd[136]: version 6.4.3 starting
dhcpcd[136]: all: IPv6 kernel autoconf disabled
dhcpcd[136]: wlan0: adding address fe80::fa78:d0f0:d474:41da
dhcpcd[136]: if_addaddress6: Operation not supported
dhcpcd[136]: DUID 00:01:00:01:c7:92:c3:3b:48:02:2a:eb:1e:85
dhcpcd[136]: wlan0: IAID 2a:eb:1e:85
dhcpcd[136]: wlan0: rebinding lease of 10.0.0.38
dhcpcd[136]: wlan0: leased 10.0.0.38 for 86400 seconds
dhcpcd[136]: wlan0: adding route to 10.0.0.0/24
dhcpcd[136]: wlan0: adding default route via 10.0.0.1
dhcpcd[136]: forked to background, child pid 140


To check the ip address and route
ip addr show wlan0
ip route show


Finally to check network is OK
ping 8.8.8.8