[SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Test and fix the Kernel 4.14 features

Moderators: odroid, mdrjr

[SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Thu Jun 08, 2017 12:02 pm

I updated the KERNEL to 4.9 using http://odroid.com/dokuwiki/doku.php?id=en:xu4_upgrade_from_3.10_to_4.9. It worked but after I rebooted the odroid no longer acted like an AP. ODROID XU4 with wifi module 3.

I originally followed the directions found here... http://odroid.com/dokuwiki/doku.php?id=en:xu4_wlan_ap and was setup using kernel 3.x.

Now when I try and connect to it it just keeps asking for the password. The hostapd service would not start until I commented out the driver=rtl871xdrv line.

Here is the error the hostapd service would print until I removed the driver..
Jun 07 21:56:47 odroid systemd[1]: Starting LSB: Advanced IEEE 802.11 management daemon...
Jun 07 21:56:47 odroid hostapd[1282]: * Starting advanced IEEE 802.11 management hostapd
Jun 07 21:56:47 odroid hostapd[1282]: ioctl[SIOCSIWMODE]: Invalid argument
Jun 07 21:56:47 odroid hostapd[1282]: ...fail!
Jun 07 21:56:47 odroid systemd[1]: Started LSB: Advanced IEEE 802.11 management daemon.


Here is a snippet of the syslog file....
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 IEEE 802.11: authenticated
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 IEEE 802.11: association OK (aid 1)
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 IEEE 802.11: associated (aid 1)
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 MLME: MLME-ASSOCIATE.indication(40:f0:2f:a3:d7:40)
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 MLME: MLME-DELETEKEYS.request(40:f0:2f:a3:d7:40)
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 IEEE 802.11: binding station to interface 'wlan10'
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: event 1 notification
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: start authentication
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 IEEE 802.1X: unauthorizing port
Jun 7 21:32:47 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: sending 1/4 msg of 4-Way Handshake
Jun 7 21:32:48 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: EAPOL-Key timeout
Jun 7 21:32:48 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: sending 1/4 msg of 4-Way Handshake
Jun 7 21:32:49 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: EAPOL-Key timeout
Jun 7 21:32:49 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: sending 1/4 msg of 4-Way Handshake
Jun 7 21:32:50 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: EAPOL-Key timeout
Jun 7 21:32:50 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: sending 1/4 msg of 4-Way Handshake
Jun 7 21:32:51 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: EAPOL-Key timeout
Jun 7 21:32:51 odroid hostapd: wlan10: STA 40:f0:2f:a3:d7:40 WPA: PTKSTART: Retry limit 4 reached

So I believe the wlan_ap will need to be "tweaked" for kernel 4.x or maybe this is a quick fix.

Any help would be greatly appreciated. :)
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Thu Jun 08, 2017 9:35 pm

I feel their is need to check with the rtl8192cu driver support Software AP in 4.9.x
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Fri Jun 09, 2017 2:48 am

rtl8192cu driver do not support ap mode as the corresponding driver in hostapd is not compatible.

So either solution is to back port the driver so that it support the old version of driver.
I have some how manage to get this working at my end but with a hack.

Better approach is to integrate the old version of driver into the 4.9.x and let see if this works out.

Code: Select all
root@odroid:~# /usr/sbin/hostapd.rtl -dd /etc/hostapd/hostapd.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0x96c98
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Previous country code , new country code KR
Continue interface setup after channel list update
ctrl_iface not configured!
random: Got 20/20 bytes from /dev/random
Wireless event: cmd=0x8b06 len=8
Channel list update timeout - try to continue anyway
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=12 freq=2467 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=13 freq=2472 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=36 freq=5180 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=40 freq=5200 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=44 freq=5220 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=48 freq=5240 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=52 freq=5260 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=56 freq=5280 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=60 freq=5300 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=64 freq=5320 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=100 freq=5500 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=104 freq=5520 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=108 freq=5540 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=112 freq=5560 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=116 freq=5580 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=120 freq=5600 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=124 freq=5620 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=128 freq=5640 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=132 freq=5660 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=136 freq=5680 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=140 freq=5700 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=149 freq=5745 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=153 freq=5765 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=157 freq=5785 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=161 freq=5805 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=165 freq=5825 MHz max_tx_power=0 dBm
Completing interface initialization
Mode: IEEE 802.11g  Channel: 1  Frequency: 2412 MHz
DFS 0 channels required radar detection
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
hostapd_setup_bss(hapd=0x97298 (wlan0), first=1)
wlan0: Flushing old station entries
wlan0: Deauthenticate all stations
+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
rtl871x_set_key_ops
Using interface wlan0 with hwaddr 7c:dd:90:52:13:1e and ssid "OdroidAP"
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=8):
     4f 64 72 6f 69 64 41 50                           OdroidAP
PSK (ASCII passphrase) - hexdump_ascii(len=10): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
GMK - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
Key Counter - hexdump(len=32): [REMOVED]
WPA: Delay group state machine start until Beacon frames have been configured
RSN pre-auth interface 'wlan0'
rtl871x_set_beacon_ops
rtl871x_set_hidden_ssid_ops
ioctl[RTL_IOCTL_HOSTAPD]: Invalid argument
WPA: Start group state machine to set initial keys
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=32): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
rtl871x_set_key_ops
wlan0: interface state COUNTRY_UPDATE->ENABLED
wlan0: AP-ENABLED
wlan0: Setup of interface done.
Wireless event: cmd=0x8b15 len=20
Wireless event: cmd=0x8b15 len=20
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
Wireless event: cmd=0x8b19 len=8
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=32): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=0
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
rtl871x_set_key_ops
Wireless event: cmd=0x8b19 len=8
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Fri Jun 09, 2017 4:16 am

I am willing to be a test unit if needed.
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Sat Jun 10, 2017 12:31 am

If you could give this instruction a try until the module gets tested and updated in the kernel.

http://randomstuffidosometimes.blogspot ... n-and.html

You probably don't need to recompile the hostapd and it's compatible with this driver.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Sat Jun 10, 2017 2:45 am

Thanks. I tried this...

UPDATE:
Des Flynn has made a great repository based partially (or maybe even fully) on my guide.
Check it out here: https://github.com/desflynn/realtek-8192cu-concurrent-softAP

I used this but ran into an error...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.9.30-41 /boot/vmlinuz-4.9.30-41
Error! Your kernel headers for kernel 4.9.30-41 cannot be found.
Please install the linux-headers-4.9.30-41 package,
or use the --kernelsourcedir option to tell DKMS where it's located

I will keep trying. Thanks.
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Sat Jun 10, 2017 3:01 am

You probably need to install the headers, hope this work.

Code: Select all
sudo apt-get install linux-headers-4.9.30-41
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Sat Jun 10, 2017 3:56 am

I tried this...

odroid@odroid:~$ sudo apt-get install linux-headers-4.9.30-41
[sudo] password for odroid:
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-4.9.30-41 is already the newest version (20170531).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

It is already installed in /usr/src/ directory. I have also tried sudo apt-get install --reinstall linux-headers-4.9.30-41.

root@odroid:/home/odroid/temp/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes# make
make ARCH=armv7l CROSS_COMPILE= -C /lib/modules/4.9.30-41/build M=/home/odroid/temp/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes modules
make[1]: *** /lib/modules/4.9.30-41/build: No such file or directory. Stop.
Makefile:584: recipe for target 'modules' failed
make: *** [modules] Error 2
root@odroid:/home/odroid/temp/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes#
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Sat Jun 10, 2017 5:11 am

Looks like I pointed to wrong repository. Pleases used these instruction to get this working.

https://github.com/pvaret/rtl8192cu-fix ... /README.md

Code: Select all
odroid@odroid:~$ sudo dkms add ./rtl8192cu-fixes

Creating symlink /var/lib/dkms/8192cu/1.10/source ->
                 /usr/src/8192cu-1.10

DKMS: add completed.
odroid@odroid:~$ sudo dkms install 8192cu/1.10

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=4.9.30-41 -C /lib/modules/4.9.30-41/build M=/var/lib/dkms/8192cu/1.10/build.............................
cleaning build area....

DKMS: build completed.

8192cu.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.9.30-41/updates/dkms/

depmod.....

Backing up initrd.img-4.9.30-41 to /boot/initrd.img-4.9.30-41.old-dkms
Making new initrd.img-4.9.30-41
(If next boot fails, revert to initrd.img-4.9.30-41.old-dkms image)
update-initramfs...........

DKMS: install completed.
odroid@odroid:~$


After this you update the blacklist rtl driver and reboot.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Sat Jun 10, 2017 6:04 am

I am soooooo close.... Here is the output....

odroid@odroid:~/temp/hostap-test$ sudo apt-get update
Hit:1 http://deb.odroid.in/5422-s xenial InRelease
Hit:2 http://ppa.launchpad.net/saiarcot895/myppa/ubuntu xenial InRelease
Hit:3 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports xenial-backports InRelease
Hit:6 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease
Reading package lists... Done
odroid@odroid:~/temp/hostap-test$ sudo apt-get install git linux-headers-generic build-essential dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
dkms is already the newest version (2.2.0.3-2ubuntu11.3).
git is already the newest version (1:2.7.4-0ubuntu1.1).
linux-headers-generic is already the newest version (4.4.0.79.85).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
odroid@odroid:~/temp/hostap-test$ git clone https://github.com/pvaret/rtl8192cu-fixes.git
Cloning into 'rtl8192cu-fixes'...
remote: Counting objects: 494, done.
remote: Total 494 (delta 0), reused 1 (delta 0), pack-reused 493
Receiving objects: 100% (494/494), 1.82 MiB | 179.00 KiB/s, done.
Resolving deltas: 100% (257/257), done.
Checking connectivity... done.
odroid@odroid:~/temp/hostap-test$ sudo dkms add ./rtl8192cu-fixes

Creating symlink /var/lib/dkms/8192cu/1.10/source ->
/usr/src/8192cu-1.10

DKMS: add completed.
odroid@odroid:~/temp/hostap-test$ sudo dkms install 8192cu/1.10
Error! Your kernel headers for kernel 4.9.30-41 cannot be found.
Please install the linux-headers-4.9.30-41 package,
or use the --kernelsourcedir option to tell DKMS where it's located

And I stopped here since I received an error :(

I also tried the following...
odroid@odroid:~/temp/hostap-test$ sudo apt-get install git linux-headers-$(uname -r) build-essential dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
dkms is already the newest version (2.2.0.3-2ubuntu11.3).
git is already the newest version (1:2.7.4-0ubuntu1.1).
linux-headers-4.9.30-41 is already the newest version (20170531).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So it appears the headers are installed....
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Sat Jun 10, 2017 6:53 am

I believe I got it!!!

In the /lib/modules/4.9.30-41 directory. The link build -> /usr/src/linux-headers-4.9.30-41 was NOT built. I created the link and the commands completed correctly.

Now I can connect to the box with the wifi. Thanks for the help! :D
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mad_ady » Sat Jun 10, 2017 3:44 pm

@mtdew365. That link probably doesn't exist if you install the kernel headers after the kernel is installed.
Also, note that the module will break after you update the kernel, so you'll either have to redo the steps or hold the kernel package
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Sun Jun 11, 2017 12:59 am

I created a couple of scripts to help automate this function....

hostapdgit (Downloads the current version from github)
Code: Select all
#!/bin/bash

owner=`id -u`
group=`id -g`

ERROR='\033[0;31m' # Error in RED
SUCCESS='\033[0;32m' # Success in GREEN
NC='\033[0m' # No Color


cd $HOME

if [ ! -d "$HOME/rtl8192cu-fixes" ]; then
   mkdir $HOME/rtl8192cu-fixes
   chown $owner.$group $HOME/rtl8192cu-fixes
   chmod 775 $HOME/rtl8192cu-fixes
   echo
   echo '--------------------------'
   echo 'Setup & Download rtl8192cu-fixes'
   git clone https://github.com/pvaret/rtl8192cu-fixes.git $HOME/rtl8192cu-fixes/
   echo '--------------------------'
   echo
fi

cd $HOME/rtl8192cu-fixes

# Default to working directory
LOCAL_REPO="."
# Default to git pull with FF merge in quiet mode
GIT_COMMAND="git pull --quiet"

# User messages
GU_ERROR_FETCH_FAIL="${ERROR}Unable to fetch the remote repository.  (rtl8192cu-fixes)${NC}"
GU_ERROR_UPDATE_FAIL="${ERROR}Unable to update the local repository.  (rtl8192cu-fixes)${NC}"
GU_ERROR_NO_GIT="${ERROR}This directory has not been initialized with Git.  (rtl8192cu-fixes)${NC}"
GU_INFO_REPOS_EQUAL="The local repository is current. No update is needed.  (rtl8192cu-fixes)"
GU_SUCCESS_REPORT="${SUCCESS}Update complete.  (rtl8192cu-fixes)${NC}"
GU_RESET="${ERROR}RESET GIT.  (rtl8192cu-fixes)${NC}"


if [ $# -eq 1 ]; then
  LOCAL_REPO="$1"
  cd "$LOCAL_REPO"
fi

if [ -d ".git" ]; then
  # update remote tracking branch
  git remote update >&-
  if (( $? )); then
      echo -e $GU_ERROR_FETCH_FAIL >&2
      exit 1
  else
      LOCAL_SHA=$(git rev-parse --verify HEAD)
      REMOTE_SHA=$(git rev-parse --verify FETCH_HEAD)
      if [ $LOCAL_SHA = $REMOTE_SHA ]; then
          echo -e $GU_INFO_REPOS_EQUAL
          exit 0
      else
          $GIT_COMMAND
          if (( $? )); then
              echo -e $GU_ERROR_UPDATE_FAIL >&2
              git clean -f -d
              git fetch --all
              git reset --hard origin/master
              echo -e $GU_RESET >&2
              exit 1
          else
              echo -e $GU_SUCCESS_REPORT
          fi
      fi
  fi
else
  echo -e $GU_ERROR_NO_GIT >&2
  exit 1
fi
exit 0


This one compiles the driver with the kernel (called compile_rtl8192cu-fixes)
Code: Select all
#!/bin/bash

sudo -v

echo "Installing packages required to build rtl8192cu"

sudo apt-get -y update
sudo apt-get -y install \
     git \
     linux-headers-generic \
     linux-headers-$(uname -r) \
     build-essential \
     dkms

cd /lib/modules/$(uname -r)

if [ ! \( -e "build" \) ]
then
   echo 'Building link to build'
   sudo ln -s /usr/src/linux-headers-$(uname -r) build
fi

cd $HOME

echo 'Compiling ftl8192cu-fixes'
echo 'Set it up as a DKMS module'
sudo dkms add ./rtl8192cu-fixes

echo 'Build and install it'
sudo dkms install 8192cu/1.10

echo 'Refresh the module list'
sudo depmod -a

echo 'Ensure the native (and broken) kernel driver is blacklisted'
cd /etc/modprobe.d

if [ ! \( -f "blacklist-native-rtl8192.conf" \) ]
then
   echo "Copying blacklisted file"
   sudo cp $HOME/rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/
fi

echo 'PLEASE REBOOT SYSTEM TO COMPLETE'


I sure it can be optimized but it works. I just backed everything out and used these scripts and the module installed correctly :) Hope it will help...
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mad_ady » Sun Jun 11, 2017 2:37 am

You can go one step further. You can place a script in /etc/kernel/postinst.d/ which will be called automatically (with the new kernel version as parameter) when a new kernel is installed via apt.
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Tue Jun 13, 2017 1:27 pm

@mtdew365 I confirm that you provided script has successfully configured and install old RTL drive
which can be used to setup access point for Wifi Module 3.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby clem » Fri Mar 16, 2018 4:02 am

@mtdew365 I've applied your scripts on a Kernel 4.14.5-92 (Ubuntu 16.04.3) but I've run into some issues (wlan0 is not detected anymore)
The details are in my post here: viewtopic.php?f=99&t=30467
Any thoughts on what went wrong?
clem
 
Posts: 28
Joined: Sat Apr 30, 2016 3:30 pm
languages_spoken: english
ODROIDs: XU4

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Fri Mar 16, 2018 11:26 am

@clem,
I feel this happens with some build package missing, source code for rtl8192cu will probably get merge, so no need to build external dependent module.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Fri Mar 16, 2018 10:07 pm

clem wrote:@mtdew365 I've applied your scripts on a Kernel 4.14.5-92 (Ubuntu 16.04.3) but I've run into some issues (wlan0 is not detected anymore)
The details are in my post here: viewtopic.php?f=99&t=30467
Any thoughts on what went wrong?


I am not good with all the particulars but, I don't believe you can build this with 4.14 kernel because all the generic kernel headers files are not available.... when I try and download... I still get linux-headers-4.4.0-116-generic as the latest one with 4.14 kernel installed. Other have stated to use another method, but it doesn't give me the same options and this did. I still have one ODROID running 4.9 when this worked.
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Mon Mar 19, 2018 8:13 pm

@mtddev365 and @clem

Could you try
Code: Select all
http://odroid.com/dokuwiki/doku.php?id=en:xu4_wlan_ap
rtl8192xx driver has been merged in 4.14.x

You need to block native rtl driver loading.
Code: Select all
sudo wget -nv https://raw.githubusercontent.com/hardkernel/linux/odroidxu4-4.14.y/drivers/net/wireless/rtl8192cu/blacklist-native-rtl8192.conf -O /etc/modprobe.d/blacklist-native-rtl8192.conf
Last edited by moon.linux on Tue Mar 20, 2018 12:56 pm, edited 1 time in total.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby odroid » Mon Mar 19, 2018 8:31 pm

Kernel 4.14.28 will include the driver. We are working on it.
A new Kernel update package will be released within two days.
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby mtdew365 » Tue Mar 20, 2018 8:23 am

Finally!!! :) Thank you. I look forward to this update.
mtdew365
 
Posts: 104
Joined: Mon Apr 25, 2016 1:39 pm
languages_spoken: english
ODROIDs: ODROID-XU4 (Cloudshell configuration)
ODROID-XU4 (HOST AP)(5Ghz)
ODROID-XU4 (HOST AP)(Dual Band)

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby clem » Tue Mar 20, 2018 9:18 am

Thanks all for the prompt answer!

@odroid I'll wait for the release of the new kernel package.
Just to confirm that the error is the same as the one you're trying to fix, when I try to launch hostapd, here is the error I get:
Code: Select all
odroid@odroid:~$ sudo hostapd -dd /etc/hostapd/hostapd.conf
[sudo] password for odroid:
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
ctrl_interface_group=0
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0x54a40
ioctl[SIOCSIWMODE]: Invalid argument
Could not set interface to mode(3)!
Could not set interface to master mode!
rtl871xdrv driver initialization failed.
rmdir[ctrl_interface]: No such file or directory


@moon.linux, I've removed the file blacklist-native-rtl8192.conf from /etc/modprobe.d/ and now wlan0 shows up when I run iconfig. So the blacklisting part of script #2 seems to be working.
The script fails at this line:
Code: Select all
sudo dkms add ./rtl8192cu-fixes

It returns the following:
Code: Select all
Error! DKMS tree already contains: 8192cu-1.11
You cannot add the same module/version combo more than once.

(Also when I run "dkms status" I get "8192cu, 1.11: added")
I'm not very proficient with kernel stuff but maybe the issue is coming from the following command in the script?
Code: Select all
   sudo ln -s /usr/src/linux-headers-$(uname -r) build

Since I'm on a newer kernel version, the symlink will point to my current kernel headers instead of the older ones I just downloaded?
clem
 
Posts: 28
Joined: Sat Apr 30, 2016 3:30 pm
languages_spoken: english
ODROIDs: XU4

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Tue Mar 20, 2018 5:37 pm

I am afraid this driver updated is not working, although I have compile the driver correctly but sill it failed to set the interface into AP mode.

Code: Select all
root@odroid:~#  /usr/sbin/hostapd -dd -P /run/hostapd.pid  /etc/hostapd/hostapd-2.6.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd-2.6.conf
ctrl_interface_group=0
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0x96ca8
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Previous country code , new country code US
Continue interface setup after channel list update
ctrl_iface not configured!
random: Got 15/20 bytes from /dev/random
Channel list update timeout - try to continue anyway
Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=12 freq=2467 MHz max_tx_power=0 dBm
Allowed channel: mode=1 chan=13 freq=2472 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=0 dBm
Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=36 freq=5180 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=40 freq=5200 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=44 freq=5220 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=48 freq=5240 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=52 freq=5260 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=56 freq=5280 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=60 freq=5300 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=64 freq=5320 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=100 freq=5500 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=104 freq=5520 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=108 freq=5540 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=112 freq=5560 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=116 freq=5580 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=120 freq=5600 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=124 freq=5620 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=128 freq=5640 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=132 freq=5660 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=136 freq=5680 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=140 freq=5700 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=149 freq=5745 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=153 freq=5765 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=157 freq=5785 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=161 freq=5805 MHz max_tx_power=0 dBm
Allowed channel: mode=2 chan=165 freq=5825 MHz max_tx_power=0 dBm
Completing interface initialization
Mode: IEEE 802.11g  Channel: 1  Frequency: 2412 MHz
DFS 0 channels required radar detection
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
hostapd_setup_bss(hapd=0x972b8 (wlan0), first=1)
wlan0: Flushing old station entries
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
wlan0: Could not connect to kernel driver
wlan0: Deauthenticate all stations
+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=0)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=1)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=2)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=3)
Using interface wlan0 with hwaddr 7c:dd:90:52:13:1e and ssid "OdroidAP"
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=8):
     4f 64 72 6f 69 64 41 50                           OdroidAP
PSK (ASCII passphrase) - hexdump_ascii(len=10): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
random: Cannot read from /dev/random: Resource temporarily unavailable
random: Got 0/5 bytes from /dev/random
random: Only 15/20 bytes of strong random data available from /dev/random
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
Get randomness: len=32 entropy=0
GMK - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
Key Counter - hexdump(len=32): [REMOVED]
WPA: Delay group state machine start until Beacon frames have been configured
rtl871x_set_beacon_ops
rtl871x_set_hidden_ssid_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set beacon parameters
wlan0: Flushing old station entries
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
wlan0: Could not connect to kernel driver
wlan0: Deauthenticate all stations
+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=3
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=0)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=1)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=2)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=3)
hostapd_free_hapd_data(wlan0)
Interface initialization failed
wlan0: interface state COUNTRY_UPDATE->DISABLED
wlan0: AP-DISABLED
hostapd_interface_deinit_free(0x966f8)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x966f8)
wlan0: interface state DISABLED->DISABLED
hostapd_bss_deinit: deinit bss wlan0
wlan0: Flushing old station entries
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
wlan0: Could not connect to kernel driver
wlan0: Deauthenticate all stations
+rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=3
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=0)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=1)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=2)
rtl871x_set_key_ops
ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported
Failed to set encryption.
Failed to clear default encryption keys (ifname=wlan0 keyidx=3)
wlan0: AP-DISABLED
hostapd_cleanup(hapd=0x972b8 (wlan0))
hostapd_free_hapd_data: Interface wlan0 wasn't started
hostapd_interface_deinit_free: driver=0x72364 drv_priv=0x96c18 -> hapd_deinit
hostapd_interface_free(0x966f8)
hostapd_interface_free: free hapd 0x972b8
hostapd_cleanup_iface(0x966f8)
hostapd_cleanup_iface_partial(0x966f8)
hostapd_cleanup_iface: free iface=0x966f8
ELOOP: remaining socket: sock=6 eloop_data=0x96d50 user_data=(nil) handler=0x4f121
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby clem » Thu Mar 22, 2018 1:17 pm

What would be the normal process to solve that kind of issue? Is there any way to debug that faulty driver?
clem
 
Posts: 28
Joined: Sat Apr 30, 2016 3:30 pm
languages_spoken: english
ODROIDs: XU4

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Thu Mar 22, 2018 2:21 pm

Actually it's my mistake I ported this driver to 4.14.x kernel :evil:
https://github.com/pvaret/rtl8192cu-fixes.git

I have been debugging this for some time, but it seem to me that their is no proper registration of the driver.
Code: Select all
iw list
dose not show the hardware capability of wireless interface and the extra IOCTL are not getting registered.

Realtek wireless module are not well documented and supported in the mainline either.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby odroid » Thu Mar 22, 2018 2:35 pm

Does the "WPA_SUPPLICANT" method have the same issue with the old as well as the new driver?
https://wiki.odroid.com/accessory/conne ... plicant_ap
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby clem » Fri Mar 23, 2018 12:01 pm

I've followed all the steps in the wpa_supplicant method (except Internet forwarding over Wifi as I don't need it). The AP starts and is visible from other computers but connection attempts fail (I've tried connecting from a Linux machine and an Android phone).

At least the AP shows up so we've made some good progress :)
Now just need to figure out what's wrong with the connection attempts.
clem
 
Posts: 28
Joined: Sat Apr 30, 2016 3:30 pm
languages_spoken: english
ODROIDs: XU4

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Fri Mar 23, 2018 3:47 pm

Latest kernel update you will be able to set AP mode via wpa_supplicant.

Code: Select all
root@odroid:~# uname -a
Linux odroid 4.14.29-125 #1 SMP PREEMPT Thu Mar 22 21:40:52 UTC 2018 armv7l armv7l armv7l GNU/Linux
root@odroid:~# iw list
Wiphy phy0
        max # scan SSIDs: 4
        max scan IEs length: 2257 bytes
        RTS threshold: 2347
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports RSN-IBSS.
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
                * 00-0f-ac:10
                * GCMP (00-0f-ac:8)
                * 00-0f-ac:9
                * CMAC (00-0f-ac:6)
                * 00-0f-ac:13
                * 00-0f-ac:11
                * 00-0f-ac:12
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * mesh point
                 * P2P-client
                 * P2P-GO

I have check this at my setup vi connecting two Android Phone. You might need to set harder the passphrase to connect to AP.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Mon Mar 26, 2018 2:10 pm

@clem and @mtdew365
I have check the following instruction to work on Wifi module 3 on the latest Linux odroid 4.14.29-125

Code: Select all
root@odroid:~# modinfo rtl8192cu
filename:       /lib/modules/4.14.29-125/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rtl8192cu.ko
firmware:       rtlwifi/rtl8192cufw_TMSC.bin
firmware:       rtlwifi/rtl8192cufw_B.bin
firmware:       rtlwifi/rtl8192cufw_A.bin
firmware:       rtlwifi/rtl8192cufw.bin
description:    Realtek 8192C/8188C 802.11n USB wireless
license:        GPL
author:         Larry Finger    <Larry.Finger@lwfinger.net>
author:         Ziv Huang       <ziv_huang@realtek.com>
author:         Georgia         <georgia@realtek.com>
alias:          usb:v7392p7822d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0100d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p624Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB2Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p330Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p330Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3309d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3307d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0E66p0019d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0061d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8186d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p17ABd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846pF001d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9021d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07B8p8178d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07AAp0056d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0586p341Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp2103d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp2102d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1004d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019p1201d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04F2pAFFCd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04F2pAFFBd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04F2pAFF8d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04F2pAFFAd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04F2pAFF9d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v04F2pAFF7d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp317Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v9846p9041d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v4855p0091d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v4855p0090d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v13D3p3359d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v13D3p3358d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v7392p7811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v20F4p648Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pED17d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB2Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019pAB2Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2019p4902d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3308d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v13D3p3357d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v103Cp1629d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v4856p0091d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0EB0p9071d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0077d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0070d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p005Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0052d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp5088d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p17BAd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9043d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0846p9041d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07B8p8189d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07B8p8188d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v06F8pE033d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp11F2d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v050Dp1102d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp817Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8178d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8754d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp819Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp818Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp817Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp817Ed*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp817Dd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp817Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp817Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8177d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8176d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8170d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp018Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8191d*dc*dsc*dp*ic*isc*ip*in*
depends:        mac80211,rtlwifi,rtl8192c-common,rtl_usb
intree:         Y
name:           rtl8192cu
vermagic:       4.14.29-125 SMP preempt mod_unload ARMv7 p2v8
parm:           swenc:Set to 1 for software crypto (default 0)
 (bool)
parm:           debug_level:Set debug level (0-5) (default 0) (int)
parm:           debug_mask:Set debug mask (default 0) (ullong)


Configure Network Interface and Dnsmasq (dhcp server) and Network Forwarding and iptables as per the WiKi instructions.

Build Hostapd for Wifi Module 3.
Code: Select all
wget https://w1.fi/releases/hostapd-2.6.tar.gz
tar xvfz hostapd-2.6.tar.gz
cd hostapd-2.6
cd hostapd
cp defconfig .config
echo CONFIG_LIBNL32=y >> .config
echo CONFIG_IEEE80211N=y >> .config
make
cp /usr/sbin/hostapd /usr/sbin/hostapd.back
cp hostapd /usr/sbin/hostapd


Hostapd config for 2.4 GHz Wifi Module 3/4/5
Code: Select all
# HostAPD

# Interface
interface=wlan0

# driver
driver=nl80211

# Logging
logger_syslog=-1
logger_syslog_level=3
logger_stdout=-1
logger_stdout_level=2

# CTRL-Interface
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

# WLAN
country_code=KR
ssid=OdroidAPn
hw_mode=g
channel=6
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
preamble=1

# WPA2
wpa=2                            # WPA2 only
wpa_passphrase=hardkernel
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=3                      # 1=wpa, 2=wep, 3=both
macaddr_acl=0
wmm_enabled=1
eap_reauth_period=360000
fragm_threshold=2346
rsn_preauth=1
rsn_preauth_interfaces=wlan0
wpa_group_rekey=600
wpa_ptk_rekey=600
wpa_gmk_rekey=86400

# N-WLAN
ieee80211n=1
ht_capab=[HT20+][SHORT-GI-20][DSSS_CCK-20]
require_ht=0
obss_interval=0


On other Odroid C2
I am able to scan the AP features and connect to OdroidAPn and also connect to internet via wlan0

Code: Select all
root@odroid64:~# sudo iwlist wlan0 scanning | egrep 'Cell |Encryption|Quality|Last beacon|ESSID'
          Cell 01 - Address: 2C:30:33:5E:8C:9D
                    Quality=70/70  Signal level=-25 dBm
                    Encryption key:on
                    ESSID:"GoToHell-2G"
                    Extra: Last beacon: 50ms ago
          Cell 02 - Address: 7C:DD:90:52:13:1E
                    Quality=70/70  Signal level=-37 dBm
                    Encryption key:on
                    ESSID:"OdroidAPn"
                    Extra: Last beacon: 50ms ago
          Cell 03 - Address: C4:6E:1F:BD:13:A2
                    Quality=33/70  Signal level=-77 dBm
                    Encryption key:on
                    ESSID:"CLICKATOUR"
                    Extra: Last beacon: 50ms ago

root@odroid64:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1e:06:33:ed:2d
          inet addr:10.0.0.138  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:6ff:fe33:ed2d/64 Scope:Link
          inet6 addr: 2002:ac10:e295:e472:bfeb:e7ca:d9e9:60be/64 Scope:Global
          inet6 addr: 2002:ac10:e295:e472:d510:a13d:b60b:540e/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:573 errors:0 dropped:0 overruns:0 frame:0
          TX packets:245 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:59143 (59.1 KB)  TX bytes:30315 (30.3 KB)
          Interrupt:40

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:152 errors:0 dropped:0 overruns:0 frame:0
          TX packets:152 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:19265 (19.2 KB)  TX bytes:19265 (19.2 KB)

wlan0     Link encap:Ethernet  HWaddr 7c:dd:90:eb:be:9e
          inet addr:192.168.1.41  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::7edd:90ff:feeb:be9e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1515 (1.5 KB)  TX bytes:7868 (7.8 KB)
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby tam1111574 » Mon Mar 26, 2018 6:50 pm

Hi Odriod, Kernel 4.14.29+, Have support AP mode with hotapd ?..
After I download, compile the 4.14.29+ and test AP mode but same result:

Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0x96c98
ioctl[SIOCSIWMODE]: Invalid argument
Could not set interface to mode(3)!
Could not set interface to master mode!
rtl871xdrv driver initialization failed.
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED
hostapd_free_hapd_data: Interface wlan0 wasn't started

Thank Odroid...
tam1111574
 
Posts: 105
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby moon.linux » Mon Mar 26, 2018 7:29 pm

@tam1111574 can you try the
viewtopic.php?f=146&t=27287#p219559
hostapd configuration to set up AP mode.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby tam1111574 » Mon Mar 26, 2018 7:50 pm

Thank for your reply moon.linux, but I use Odorid XU4 @@...
tam1111574
 
Posts: 105
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby clem » Tue Mar 27, 2018 3:54 am

Wow, @moon.linux you rock!
I confirm the AP is now working on my XU4, kernel 4.14.29-125. I'm able to connect to it from an Android phone and a laptop.

So just switching to nl80211 driver did the trick? (instead of using rtl871xdrv?)
If that's the case @odroid maybe the following 2 lines in the wiki need to be updated https://wiki.odroid.com/accessory/conne ... fi/wlan_ap

In the build instructions:
Code: Select all
echo CONFIG_IEEE80211N=y >> .config


In the hostapd config file:
Code: Select all
driver=nl80211
clem
 
Posts: 28
Joined: Sat Apr 30, 2016 3:30 pm
languages_spoken: english
ODROIDs: XU4

Re: [SOLVED] Upgrade to Kernel 4.9 broke wlan_ap

Unread postby tam1111574 » Wed Mar 28, 2018 7:33 pm

Thank @moon.linux, clem, I config AP and is working with module wifi DWA 171. Thank all very much...
tam1111574
 
Posts: 105
Joined: Tue Jan 12, 2016 3:51 pm
languages_spoken: english
ODROIDs: oddroid xu4


Return to Linux Kernel 4.14 Debugging Party

Who is online

Users browsing this forum: No registered users and 1 guest