disassociating from 00:25...[snip] by local choice (reason=3) ?

Hello Beagles!

I’ve been working on building my own kernel using this guide:

http://wiki.beyondlogic.org/index.php/BeagleBoneBlack_Building_Kernel

And I’ve got it working mostly except from the wifi driver.
I’m using the rtl8192cu chipset over USB and the modules loads and finds the device

but when I do: iwconfig wlan0 essid

I get this in dmesg:

[ 75.515169] rtl8192cu: MAC auto ON okay!
[ 75.546583] rtl8192cu: Tx queue select: 0x05
[ 75.928931] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 109.239494] wlan0: authenticate with 00:25:9c:4d:25:8e
[ 109.273784] wlan0: send auth to 00:25:9c:4d:25:8e (try 1/3)
[ 109.275778] wlan0: authenticated
[ 109.279173] wlan0: associate with 00:25:9c:4d:25:8e (try 1/3)
[ 109.284660] wlan0: RX AssocResp from 00:25:9c:4d:25:8e (capab=0x401 status=0 aid=4)
[ 109.285302] wlan0: associated
[ 109.288157] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 109.289127] wlan0: disassociating from 00:25:9c:4d:25:8e by local choice (reason=3)
[ 109.315802] wlan0: deauthenticating from 00:25:9c:4d:25:8e by local choice (reason=3)
[ 117.704790] wlan0: authenticate with 00:25:9c:4d:25:8e
[ 117.719241] wlan0: send auth to 00:25:9c:4d:25:8e (try 1/3)
[ 117.721346] wlan0: authenticated
[ 117.723125] wlan0: associate with 00:25:9c:4d:25:8e (try 1/3)
[ 117.747224] wlan0: RX AssocResp from 00:25:9c:4d:25:8e (capab=0x401 status=0 aid=4)
[ 117.747838] wlan0: associated
[ 117.748565] wlan0: disassociating from 00:25:9c:4d:25:8e by local choice (reason=3)
[ 117.766899] wlan0: deauthenticating from 00:25:9c:4d:25:8e by local choice (reason=3)

Can anyone tell me whats wrong?

Thanks!

/Jacob

What hardware do you have? You might to build a new driver out of tree,
the one that comes with the kernel doesn't work properly with some
devices. I managed to cross compile the kernel by following Robert's
instructions and then cross compiled the driver and now it's working fine.
I'm running ubuntu 13.04 armhf and I used the driver git repository
mentioned here:

<http://www.codealpha.net/864/how-to-set-up-a-rtl8192cu-on-the-beaglebone-black-bbb/>

You might also want to add a few options to the driver:

https://github.com/xbianonpi/xbian/issues/217#issuecomment-12995990

regards,
Nuno

- --
http://aeminium.org/nuno/

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> Can anyone tell me whats wrong?
>
> Thanks!
> /Jacob

What hardware do you have? You might to build a new driver out of tree,
the one that comes with the kernel doesn't work properly with some
devices. I managed to cross compile the kernel by following Robert's
instructions and then cross compiled the driver and now it's working fine.
I'm running ubuntu 13.04 armhf and I used the driver git repository
mentioned here:

I'm using a noname USB WiFi dongle labeled RTL8188 on a beaglebone black.

I tried removing avahi-daemon and wpa-supplement and after
a reboot I can now do:

iwconfig wlan0 essid <WIFISSID>

and get:

[ 153.579456] wlan0: authenticate with 00:25:9c:4d:25:8e
[ 153.619702] wlan0: send auth to 00:25:9c:4d:25:8e (try 1/3)
[ 153.623978] wlan0: authenticated
[ 153.627925] wlan0: associate with 00:25:9c:4d:25:8e (try 1/3)
[ 153.687483] wlan0: RX AssocResp from 00:25:9c:4d:25:8e (capab=0x401
status=0 aid=5)
[ 153.688098] wlan0: associated
[ 153.688673] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

iwconfig:

wlan0 IEEE 802.11bgn ESSID:"R0x0r1337"
          Mode:Managed Frequency:2.412 GHz Access Point:
00:25:9C:4D:25:8E
          Bit Rate=72.2 Mb/s Tx-Power=20 dBm
          Retry long limit:7 RTS thr=2347 B Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=25/70 Signal level=-85 dBm
          Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:0 Missed beacon:0

But ifconfig shows that there is no inet4 address: ??

wlan0 Link encap:Ethernet HWaddr 00:13:ef:c0:16:ae
          inet6 addr: fe80::213:efff:fec0:16ae/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:566 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:142070 (142.0 KB) TX bytes:11306 (11.3 KB)

I'll try compileing this driver

<
http://www.codealpha.net/864/how-to-set-up-a-rtl8192cu-on-the-beaglebone-black-bbb/
>

Thanks!
/Jacob

You might be missing a few steps there. Did you configure wpa supplicant
with wifi password, etc ? You can check what wpa supplicant is doing
with wpa_cli

regards,
Nuno

- --
http://aeminium.org/nuno/

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> But ifconfig shows that there is no inet4 address: ??

You might be missing a few steps there. Did you configure wpa supplicant
with wifi password, etc ? You can check what wpa supplicant is doing
with wpa_cli

I'm not using wpa supplicant, just dhcp

(dhclient -1 -v -pf /run/dhclient.wlan0.pid -lf
/var/lib/dhcp/dhclient.wlan0.leases wlan0)

also,
I tried compiling the driver you linked.
I had to change the path to the kernel source but still I got this error:

CC [M] /home/dacobi/rtl8192cu_beaglebone/os_dep/osdep_service.o
CC [M] /home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.o
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c: In function
‘rtw_proc_init_one’:
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:278:3: error:
implicit declaration of function ‘create_proc_entry’
[-Werror=implicit-function-declaration]
   rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
   ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:278:11: warning:
assignment makes pointer from integer without a cast [enabled by default]
   rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
           ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:285:3: error:
implicit declaration of function ‘create_proc_read_entry’
[-Werror=implicit-function-declaration]
   entry = create_proc_read_entry("ver_info", S_IFREG | S_IRUGO, rtw_proc,
proc_get_drv_version, dev);
   ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:285:9: warning:
assignment makes pointer from integer without a cast [enabled by default]
   entry = create_proc_read_entry("ver_info", S_IFREG | S_IRUGO, rtw_proc,
proc_get_drv_version, dev);
         ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:296:21: warning:
assignment makes pointer from integer without a cast [enabled by default]
   padapter->dir_dev = create_proc_entry(dev->name,
                     ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:327:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("write_reg", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:333:7: error:
dereferencing pointer to incomplete type
  entry->write_proc = proc_set_write_reg;
       ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:335:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("read_reg", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:341:7: error:
dereferencing pointer to incomplete type
  entry->write_proc = proc_set_read_reg;
       ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:344:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("fwstate", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:352:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("sec_info", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:360:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("mlmext_state", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:368:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("qos_option", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:375:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("ht_option", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:382:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("rf_info", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:389:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("ap_info", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:396:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("adapter_state", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:403:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("trx_info", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:412:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("all_sta_info", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:421:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("_malloc_cnt", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:430:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("best_channel", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:438:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("rx_signal", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:444:7: error:
dereferencing pointer to incomplete type
  entry->write_proc = proc_set_rx_signal;
       ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:446:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("ampdu_enable", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:452:7: error:
dereferencing pointer to incomplete type
  entry->write_proc = proc_set_ampdu_enable;
       ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:454:8: warning:
assignment makes pointer from integer without a cast [enabled by default]
  entry = create_proc_read_entry("rssi_disp", S_IFREG | S_IRUGO,
        ^
/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.c:460:7: error:
dereferencing pointer to incomplete type
  entry->write_proc = proc_set_rssi_disp;
       ^
cc1: some warnings being treated as errors
make[2]: *** [/home/dacobi/rtl8192cu_beaglebone/os_dep/linux/os_intfs.o]
Error 1
make[1]: *** [_module_/home/dacobi/rtl8192cu_beaglebone] Error 2
make[1]: Leaving directory `/home/dacobi/kernel/kernel'
make: *** [modules] Error 2

/Jacob

regards,

Cross-compiling from a x86_64 machine, with gnuabihf:

~$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3

driver source:
rtl8192cu_beaglebone $ git remote -v
origin https://github.com/cmicali/rtl8192cu_beaglebone.git (fetch)
origin https://github.com/cmicali/rtl8192cu_beaglebone.git (push)

rtl8192cu_beaglebone $ make KSRC=../kernel/linux-dev/KERNEL/
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -C
../kernel/linux-dev/KERNEL/ M=...

where KSRC=../kernel/linux-dev is Robert Nelson's kernel checkout:

kernel/linux-dev $ git remote -v
origin git://github.com/RobertCNelson/linux-dev.git (fetch)
origin git://github.com/RobertCNelson/linux-dev.git (push)

Install the module (and kernel) into the BBB.

wlan0 entry in /etc/network/interfaces:
auto wlan0
iface wlan0 inet dhcp
    wpa-ssid "MYSSID"
    wpa-psk "MYPASSWORD"

/etc/modprobe.d/blacklist-rtl8192.conf:
blacklist rtl8192cu
blacklist rtl8192c_common
blacklist rtlwifi

/etc/modprobe.d/8192cu.conf:
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0

uname -a
Linux bb1 3.8.13-nuno-bone28 #1 SMP Sat Oct 19 17:58:59 EDT 2013 armv7l
armv7l armv7l GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 13.04
Release: 13.04
Codename: raring

regards,
Nuno

- --
http://aeminium.org/nuno/

I tried compiling using your instructions but still get the same error:

dacobi@ubuntu:~/rtl8192cu_beaglebone2$ make KSRC=…/linux-dev/KERNEL/ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

make[1]: Entering directory `/home/dacobi/linux-dev/KERNEL’
CC [M] /home/dacobi/rtl8192cu_beaglebone2/os_dep/linux/os_intfs.o
/home/dacobi/rtl8192cu_beaglebone2/os_dep/linux/os_intfs.c: In function ‘rtw_proc_init_one’:
/home/dacobi/rtl8192cu_beaglebone2/os_dep/linux/os_intfs.c:278:3: error: implicit declaration of function ‘create_proc_entry’ (and so on…)

dacobi@ubuntu:~/rtl8192cu_beaglebone2$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.8.1-10ubuntu7) 4.8.1

dacobi@ubuntu:~/rtl8192cu_beaglebone2$ git remote -v
origin https://github.com/cmicali/rtl8192cu_beaglebone.git (fetch)
origin https://github.com/cmicali/rtl8192cu_beaglebone.git (push)

dacobi@ubuntu:~/linux-dev$ git remote -v
origin git://github.com/RobertCNelson/linux-dev.git (fetch)
origin git://github.com/RobertCNelson/linux-dev.git (push)

/Jacob

Did you cross-compile the kernel successfully before building the 8192
module? Which kernel version are you building?

Nuno

The problem seems to be that create_proc_entry is deprecated:
(https://github.com/raspberrypi/linux/pull/328)

When I compiled I did

git checkout 3.12-bone8 and ran the build_kernel.sh

which invoked:

make -j8 ARCH=arm LOCALVERSION=-bone8 CROSS_COMPILE=/home/dacobi/linux-dev/dl/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- zImage modules

and it was successful, but the rtl8192cu_beaglebone gave the same error.

/Jacob

I applied the patch from the raspberrypi git and it compiled :slight_smile:

I will test the module later tonight.

https://raw.github.com/cybertronic/linux/0fdfdc69c275018b29f5350b4ba64c5241fb1010/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c

Thanks!

/Jacob

Nice to know when I try to upgrade mine :slight_smile:

regards,
Nuno

- --
http://aeminium.org/nuno/