please choosego to mobile | Continue to access the PC version
Author: y52

Kali 2 @ H3 boards doesn't switch to monitor mode

[Copy link]

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-5-2 05:22:21 | Show all floors
I also tried
root@orangepiplus:/usr/src/rtl8189ES_linux# patch -p1 < RTL8189ES-000-change-build-settings.patch
patching file Makefile
patching file platform/platform_ARM_SUNnI_sdio.c
Hunk #1 FAILED at 1 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file platform/platform_ARM_SUNnI_sdio.c.rej

Probably I am missing how to clone the content of a patch file from the GIT.
I just copied the text from the page in a text editor.

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-5-2 05:36:15 | Show all floors
Strange. I have a different
root@orangepiplus:/usr/src/rtl8189ES_linux# ls -al platform/platform_ARM_SUNnI_sdio.c
-rw-r--r-- 1 root root 3834 May  1 23:33 platform/platform_ARM_SUNnI_sdio.c

The patch requires 178 lines, while mine has 135 lines only.

What I made to clone the repository :

  git clone https://github.com/jwrdegoede/rtl8189ES_linux/
  cd rtl8189ES_linux
  git checkout 080f2aaf6bc8e08eeb3b51f0b8c377eae1ea7ed7

Am I doing something wrong ?

4

threads

1118

posts

9144

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9144
Published in 2016-5-2 05:43:09 | Show all floors
Yeah, that would be my patches But they are usable only for https://github.com/jwrdegoede/rtl8189ES_linux.git at commit 080f2aa.

You should never copy patch via text editor, because some text editor changes spaces to tabs or vice versa, changes end line markers etc and thus make patch file unusable. Why are you always using hard way for obtaining files? You can just go on that website and then download it through web browser. Just use wget or curl on this link: https://raw.githubusercontent.co ... uild-settings.patch

Execute this inside rtl8189ES_linux folder:
  1. patch -p1 < RTL8189ES-000-change-build-settings.patch
Copy code


But be aware that I didn't enabled monitor mode.

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-5-2 06:10:40 | Show all floors
I wget'ed the patch and it worked.
But the build didn't run :

root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-$(uname -r)
make ARCH=arm CROSS_COMPILE=/home/android_sdk/Allwinner/a23/android-kk44/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi- -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux  modules
make[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i'
make[1]: /home/android_sdk/Allwinner/a23/android-kk44/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-gcc: Command not found
  CC [M]  /usr/src/rtl8189ES_linux/core/rtw_cmd.o
/bin/sh: 1: /home/android_sdk/Allwinner/a23/android-kk44/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-gcc: not found
scripts/Makefile.build:307: recipe for target '/usr/src/rtl8189ES_linux/core/rtw_cmd.o' failed
make[2]: *** [/usr/src/rtl8189ES_linux/core/rtw_cmd.o] Error 127
Makefile:1367: recipe for target '_module_/usr/src/rtl8189ES_linux' failed
make[1]: *** [_module_/usr/src/rtl8189ES_linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'
Makefile:1634: recipe for target 'modules' failed
make: *** [modules] Error 2
root@orangepiplus:/usr/src/rtl8189ES_linux#


I cloned the repository:
root@orangepiplus:/usr/src# git clone https://github.com/jwrdegoede/rtl8189ES_linux.git
root@orangepiplus:/usr/src# cd rtl8189ES_linux
root@orangepiplus:/usr/src/rtl8189ES_linux# git checkout 080f2aa
root@orangepiplus:/usr/src/rtl8189ES_linux# patch -p1 < RTL8189ES-000-change-build-settings.patch
patching file Makefile
patching file platform/platform_ARM_SUNnI_sdio.c

4

threads

1118

posts

9144

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9144
Published in 2016-5-2 14:39:59 | Show all floors
add also CROSS_COMPILE= (nothing after equal) sign

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-5-3 03:49:48 | Show all floors
You made all the magic ! Thanks a lot for your assistance.

The driver is building without errors:
root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-$(uname -r) CROSS_COMPILE=
make ARCH=arm CROSS_COMPILE= -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux  modules
make[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i'
  CC [M]  /usr/src/rtl8189ES_linux/core/rtw_cmd.o
  CC [M]  /usr/src/rtl8189ES_linux/core/rtw_security.o

I switched
CONFIG_WIFI_MONITOR = y

The module loads without problem :
root@orangepiplus:/usr/src/rtl8189ES_linux# insmod 8189es.ko
root@orangepiplus:/usr/src/rtl8189ES_linux# lsmod
Module                  Size  Used by
8189es               1082364  0

May  2 21:34:07 localhost kernel: [ 1382.566732] *******************Try sdio*******************
May  2 21:34:07 localhost kernel: [ 1382.578184] mmc1: new high speed SDIO card at address 0001
May  2 21:34:07 localhost kernel: [ 1382.578505] *******************sdio init ok*******************


root@orangepiplus:/usr/src/rtl8189ES_linux# iw list

        Supported interface modes:
                 * IBSS
                 * managed   <<-- appeared now
                 * AP
                 * monitor
                 * P2P-client
                 * P2P-GO

Another improvement could be observed as the previous driver alwas showed two wlan's. Now a single one is present:

root@orangepiplus:/usr/src/rtl8189ES_linux# iwconfig
wlan0     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.412 GHz  Access Point: Not-Associated   
          Sensitivity:0/0  
          Retryff   RTS thrff   Fragment thrff
          Encryption keyff
          Power Managementff
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

The major deception comes from the ultimate goal to make the Monitor mode working, but it still doesn't :
[+] scanning for wireless devices...
[!] no wireless interfaces were found.
[!] you need to plug in a wifi device or install drivers.

I believe the Monitor mode was just not been implemented into the driver.

I shall try installing the driver and reboot OPI+ now to see if the changes are persistent.

How  could the iperf be used for testing the speed ?

4

threads

1118

posts

9144

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9144
Published in 2016-5-3 06:46:39 | Show all floors
Not sure about iperf. Generally, you need PC which acts like server and it should be connected with higher speed than WIFI (e.g. use ethernet connected PC to router and OPi board). Check man help for iperf what arguments are.

About monitor mode:
Put card in monitor mode with "iwconfig wlan0 mode monitor" and then for example use airodump from aircrack suite to confirm that monitor mode is working.

2

threads

12

posts

65

credits

Registered member

Rank: 2

credits
65
Published in 2016-5-5 08:48:03 | Show all floors
maybe look into this? http://patches.aircrack-ng.org/rtl8187_2.6.35-monitor_only.patch
also there are more patches for rtl8187 driver there

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-5-6 05:44:40 | Show all floors
The above driver is too obsolete and is for a different chipset 8187, while we are trying building for IC 8189 integrated on OPI+. I am not sure to be able building the 8187 driver on OPI's. Probably you will succeed.

I am waiting for the bug fix in a new Armbian 5.10 release "make scripts"  on sun8i/h3. There is no fix yet. Then I'll rebuild the driver based on the Jernej guidelines. It was building well on the 5.05 Armbian.

15

threads

105

posts

387

credits

Intermediate member

Rank: 3Rank: 3

credits
387
 Author| Published in 2016-5-26 05:00:12 | Show all floors
The Armbian team has finally fixed the header scripts generation error and released the minor version 5.11

I was able upgrading the 5.10 image to 5.11

root@orangepiplus:~# apt-get update && apt-get upgrade

Then I was able building the driver again following the same steps as in the post above "Post time 2016-5-3 03:49:48".

root@orangepiplus:/usr/src/rtl8189ES_linux# modinfo 8189es.ko
filename:       /usr/src/rtl8189ES_linux/8189es.ko
version:        v4.3.18.1_15373.20151005 <== 5 october 2015
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     AD6BE9C509ECC03E70462BA
alias:          sdio:c*v024Cd8179*
depends:        
vermagic:       3.4.112-sun8i SMP preempt mod_unload modversions ARMv7 p2v8


I enabled the Monitor mode in the Make file.

It even shows up in the module capabilities:
root@orangepiplus:/usr/src/rtl8189ES_linux# iw list
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * monitor   <----
                 * P2P-client
                 * P2P-GO
        software interface modes (can always be added):
                 * monitor

Unfortunately, the switch to monitor mode doesn't run :

"iwconfig wlan0 mode monitor"

oot@orangepiplus:/usr/src/rtl8189ES_linux# iwconfig wlan0 mode monitor
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Operation not permitted.

Despite this, the positive bug fix for this driver is that the wlan interface shows up correctly in the single instance :

root@orangepiplus:~# iwconfig
lo        no wireless extensions.

tunl0     no wireless extensions.

wlan0     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.412 GHz  Access Point: Not-Associated  

I haven't tested the driver performance and the packets drop rate.
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list