y52 Posted May 1, 2016 Author Share Posted May 1, 2016 I have a question to Igor Pecovnik on which sources have he built his v4.3.10.1_13373.20150129 driver from? The driver v4.3.18.1_15373.20151005, which was built from https://github.com/rdm-dev/rtl8189ES_linux.git doesn't recognize the SDIO RTL8189ETV module the OPI+ and wifi interface doesn't show up despite, that the module is loaded without errors: the logs on the system boot up:[ 3.915685] RTL871X: module init start[ 3.915701] RTL871X: rtl8189es v4.3.18.1_15373.20151005[ 3.915710] RTL871X: build time: Apr 30 2016 21:01:55[ 3.915814] RTL871X: module init ret=0root@orangepiplus:~# lsmodModule Size Used by8189es 1212556 0root@orangepiplus:~# iw listroot@orangepiplus:~# iwconfiglo no wireless extensions.tunl0 no wireless extensions.eth0 no wireless extensions. My understanding is that the sources fromhttps://github.com/rdm-dev/rtl8189ES_linux.gitare not meant to work with the SDIO RTL8189ETV module the OPI+ is equipped with.They are designed for the different WIFI IC, as listed in the Makefile below:########################## WIFI IC ############################CONFIG_MULTIDRV = nCONFIG_RTL8188E = yCONFIG_RTL8812A = nCONFIG_RTL8821A = nCONFIG_RTL8192E = nCONFIG_RTL8723B = nCONFIG_RTL8814A = nCONFIG_RTL8703B = nCONFIG_RTL8188F = n How is the Makefile configured so that it recognizes the SDIO RTL8189ETV module in your build sources? I knocked upon another explanations here :http://www.spinics.net/lists/linux-wireless/msg140294.htmlThey are several ways possible:1) to add support of the SDIO RTL8189ETV to the main tree herehttps://github.com/rdm-dev/rtl8189ES_linux.git2) rely on another driver3) wait for the mainstream development. 4) forget the SDIO RTL8189ETV module. Any solution would be helpful. Link to comment Share on other sites More sharing options...
Igor Posted May 1, 2016 Share Posted May 1, 2016 I have a question to Igor Pecovnik on which sources have he built his v4.3.10.1_13373.20150129 driver from? I wrote where I took source but I made changes to a code, since it's not working out of the box, and provide a patch against kernel. Since I was in a hurry I did not made any optimizations or else. It's build into kernel and it's working. Good enough? We will see. Link to comment Share on other sites More sharing options...
y52 Posted May 1, 2016 Author Share Posted May 1, 2016 It is getting more clear, that the driver source code has been provided by Amlogic openlinux. I opened their Makefile, which still shows the setting for a different IC, namely : CONFIG_RTL8188E = y Do you have an idea of how the 8189 chip is recognized ? I approached the developer of the source I've mentioned. What we told is: > I have no clue where an official maintained project maintaining public part of rtl8189 driver.> The repository you mentioned (https://github.com/rdm-dev/rtl8189ES_linux/) has the only goal to make the BSP for the HomePilot device compilable by external developers. >> Best regards,> Jens As I understand it, the Realtek themselves don't care much about the generic driver for their equipment. Is that the same approach with the OrangePI ? Link to comment Share on other sites More sharing options...
Igor Posted May 1, 2016 Share Posted May 1, 2016 As I understand it, the Realtek themselves don't care much about the generic driver for their equipment. Is that the same approach with the OrangePI ? Yes, I guess we are on our own. BTW: Another approach: https://github.com/igorpecovnik/lib/commit/dec2e54b062ac9086d8bcd073508183372d3c990 Link to comment Share on other sites More sharing options...
y52 Posted May 1, 2016 Author Share Posted May 1, 2016 Thanks Igor, this is encouraging. Could you switch the CONFIG_WIFI_MONITOR = to yes ? The only thing, which troubles me until I see the result, is that jernejsk has a 8188 adapter (USB), which, I believe, is different from 8189 SDIO How could the patch be applied as mentioned on the link ? https://github.com/jernejsk/OpenELEC-OPi2/blob/openelec-7.0/packages/linux-drivers/RTL8189ES/patches/RTL8189ES-000-change-build-settings.patch Link to comment Share on other sites More sharing options...
rufik Posted May 2, 2016 Share Posted May 2, 2016 I've installed and it works fine so far. About 2% rx dropped on 2GB download, so not that bad. We'll see yet... After few days of low activity, rx dropped packages rises to ca 12%. Link to comment Share on other sites More sharing options...
y52 Posted May 2, 2016 Author Share Posted May 2, 2016 How could the iperf be used for testing the speed ? Jernejsk has kindly helped me building the new driver from BTW: Another approach: https://github.com/i...508183372d3c990 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 modulesmake[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.oI switchedCONFIG_WIFI_MONITOR = yThe module loads without problem :root@orangepiplus:/usr/src/rtl8189ES_linux# insmod 8189es.koroot@orangepiplus:/usr/src/rtl8189ES_linux# lsmodModule Size Used by8189es 1082364 0May 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 0001May 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-GOAnother improvement could be observed as the previous driver always showed two wlan's. Now a single one is present:root@orangepiplus:/usr/src/rtl8189ES_linux# iwconfigwlan0 unassociated Nickname:"<WIFI@REALTEK>" Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated 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:0The major deception comes from the ultimate goal to make the Monitor mode working with RTL8189, 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 has not just been implemented into the driver.I had trouble installing it: root@orangepiplus:/usr/src/rtl8189ES_linux# make installinstall -p -m 644 8189es.ko install: missing destination file operand after ‘8189es.ko’Try 'install --help' for more information.Makefile:1640: recipe for target 'install' failedmake: *** [install] Error 1 How could the driver be properly installed to the running system? Link to comment Share on other sites More sharing options...
Igor Posted May 3, 2016 Share Posted May 3, 2016 If you already done it - post the recipe and I'll try to put it into kernel and put out an update. Link to comment Share on other sites More sharing options...
y52 Posted May 3, 2016 Author Share Posted May 3, 2016 Igor, What do you mean by recipe ? Is it a step by step procedure or anything else? The only difficulty I have is installing the driver with make: root@orangepiplus:/usr/src/rtl8189ES_linux# make installinstall -p -m 644 8189es.ko install: missing destination file operand after ‘8189es.ko’Try 'install --help' for more information.Makefile:1640: recipe for target 'install' failedmake: *** [install] Error 1 Link to comment Share on other sites More sharing options...
Igor Posted May 3, 2016 Share Posted May 3, 2016 yes, recipe = step by step. "install" want's to have a destination. install -p -m 644 8189es.ko destination That's a problem here, but don't bother since I will try to put it into kernel. Link to comment Share on other sites More sharing options...
y52 Posted May 3, 2016 Author Share Posted May 3, 2016 Based on my 5.05 release experience, I was trying to reproduce the driver building on your new image root@orangepiplus:/usr/src/linux-headers-3.4.112-sun8i# uname -aLinux orangepiplus 3.4.112-sun8i #30 SMP PREEMPT Sat Apr 30 19:49:10 CEST 2016 armv7l GNU/Linux It not building on this new build. I 1st tried without "make scripts" as I read in the release history that scripts are rebuilt on initial boot: "installing headers autocompile scripts" But the driver build needs the scripts anyway : 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.112-sun8i M=/usr/src/rtl8189ES_linux modulesmake[1]: Entering directory '/usr/src/linux-headers-3.4.112-sun8i' CC [M] /usr/src/rtl8189ES_linux/core/rtw_cmd.o/bin/sh: 1: /usr/src/linux-headers-3.4.112-sun8i/scripts/recordmcount: not foundscripts/Makefile.build:307: recipe for target '/usr/src/rtl8189ES_linux/core/rtw_cmd.o' failedmake[2]: *** [/usr/src/rtl8189ES_linux/core/rtw_cmd.o] Error 127Makefile:1368: recipe for target '_module_/usr/src/rtl8189ES_linux' failedmake[1]: *** [_module_/usr/src/rtl8189ES_linux] Error 2make[1]: Leaving directory '/usr/src/linux-headers-3.4.112-sun8i'Makefile:1634: recipe for target 'modules' failedmake: *** [modules] Error 2root@orangepiplus:/usr/src/rtl8189ES_linux# Then I tried to "make scripts" but in vain : root@orangepiplus:/usr/src/linux-headers-3.4.112-sun8i# cd /usr/src/linux-headers-$(uname -r)root@orangepiplus:/usr/src/linux-headers-3.4.112-sun8i# make scriptsscripts/kconfig/conf --silentoldconfig Kconfigfs/Kconfig:287: can't open file "fs/fs_compat.kconfig"/usr/src/linux-headers-3.4.112-sun8i/scripts/kconfig/Makefile:33: recipe for target 'silentoldconfig' failedmake[2]: *** [silentoldconfig] Error 1/usr/src/linux-headers-3.4.112-sun8i/Makefile:493: recipe for target 'silentoldconfig' failedmake[1]: *** [silentoldconfig] Error 2make: *** No rule to make target 'include/config/auto.conf', needed by 'scripts'. Stop.root@orangepiplus:/usr/src/linux-headers-3.4.112-sun8i# The driver build end up in an error : root@orangepiplus:/usr/src/linux-headers-3.4.112-sun8i# cd /usr/src/rtl8189ES_linux/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.112-sun8i M=/usr/src/rtl8189ES_linux modulesmake[1]: Entering directory '/usr/src/linux-headers-3.4.112-sun8i' CC [M] /usr/src/rtl8189ES_linux/core/rtw_cmd.o/bin/sh: 1: /usr/src/linux-headers-3.4.112-sun8i/scripts/recordmcount: not foundscripts/Makefile.build:307: recipe for target '/usr/src/rtl8189ES_linux/core/rtw_cmd.o' failedmake[2]: *** [/usr/src/rtl8189ES_linux/core/rtw_cmd.o] Error 127Makefile:1368: recipe for target '_module_/usr/src/rtl8189ES_linux' failedmake[1]: *** [_module_/usr/src/rtl8189ES_linux] Error 2make[1]: Leaving directory '/usr/src/linux-headers-3.4.112-sun8i'Makefile:1634: recipe for target 'modules' failedmake: *** [modules] Error 2 Could you figure out, why the scripts are not By the way, the Armbian's 5.10 wifi driver is outdated and doesn't correct the duplicated wlan: root@orangepiplus:~# modinfo /lib/modules/3.4.112-sun8i/kernel/drivers/net/wireless/rtl8189es/8189es.ko version: v4.3.10.1_13373.20150129 root@orangepiplus:~# iwconfigwlan1 unassociated Nickname:"<WIFI@REALTEK>"wlan0 unassociated Nickname:"<WIFI@REALTEK>" Another remark for the 5.10 release is that boots significantly slower and the 1st phase of booting is not indicated by any LED (all off). It is very confusing, as one may think, that the boot doesn't run. Link to comment Share on other sites More sharing options...
y52 Posted May 3, 2016 Author Share Posted May 3, 2016 The 5.10 release "make scripts" is broken. Will you correct it, so that I could build the driver and post the building steps? Link to comment Share on other sites More sharing options...
y52 Posted May 5, 2016 Author Share Posted May 5, 2016 Igor, have you confirmed the "make script" bug on a 5.10 release ? Link to comment Share on other sites More sharing options...
Igor Posted May 5, 2016 Share Posted May 5, 2016 Yes, bug is present on sun8i/h3 boards only. No fix yet. Wrote on mobile phone Link to comment Share on other sites More sharing options...
y52 Posted May 12, 2016 Author Share Posted May 12, 2016 Will it take long to fix it ? Is it on schedule? Link to comment Share on other sites More sharing options...
zador.blood.stained Posted May 12, 2016 Share Posted May 12, 2016 Kernel headers scripts compilation for sun8i was fixed a week ago, so it should work in self-built kernels or after next official release. Link to comment Share on other sites More sharing options...
y52 Posted May 13, 2016 Author Share Posted May 13, 2016 Unfortunately, I have no possibility to rebuild the kernel at that stage. Could the scripts compilation fix be posted or a minor release be published? Link to comment Share on other sites More sharing options...
Igor Posted May 14, 2016 Share Posted May 14, 2016 Minor release might happen next week. Link to comment Share on other sites More sharing options...
y52 Posted May 17, 2016 Author Share Posted May 17, 2016 This would be great to complete at least this task ... find other bugs Link to comment Share on other sites More sharing options...
Igor Posted May 18, 2016 Share Posted May 18, 2016 This would be great to complete at least this task ... find other bugs We are still in the fixing phase and small things can be done withing this release. Link to comment Share on other sites More sharing options...
y52 Posted May 25, 2016 Author Share Posted May 25, 2016 Thanks to the Armbian team for the headers scripts generation bug fixing and the minor version 5.11 release.I was able upgrading the 5.10 image to 5.11 and building the 5 october . Here is a recipe :root@orangepiplus:~# apt-get update && apt-get upgrade root@orangepiplus:~# cd /usr/src/linux-headers-$(uname -r)root@orangepiplus:/usr/src/linux-headers-3.4.112-sun8i# make scripts root@orangepiplus:~# cd /usr/src root@orangepiplus:/usr/src# git clone https://github.com/jwrdegoede/rtl8189ES_linux/ root@orangepiplus:/usr/src# cd rtl8189ES_linuxroot@orangepiplus:/usr/src/rtl8189ES_linux# git checkout 080f2aaf6bc8e08eeb3b51f0b8c377eae1ea7ed7 root@orangepiplus:/usr/src/rtl8189ES_linux# wget https://raw.githubusercontent.com/jernejsk/OpenELEC-OPi2/openelec-7.0/packages/linux-drivers/RTL8189ES/patches/RTL8189ES-000-change-build-settings.patch root@orangepiplus:/usr/src/rtl8189ES_linux# patch -p1 < RTL8189ES-000-change-build-settings.patch root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-$(uname -r) CROSS_COMPILE= The "make install" doesn't run. I copied it manually : cp -a 8189es.ko /lib/modules/3.4.112-sun8i/kernel/drivers/net/wireless/rtl8189es/ root@orangepiplus:/usr/src/rtl8189ES_linux# modinfo 8189es.kofilename: /usr/src/rtl8189ES_linux/8189es.koversion: v4.3.18.1_15373.20151005 <== 5 october 2015author: Realtek Semiconductor Corp.description: Realtek Wireless Lan Driverlicense: GPLsrcversion: AD6BE9C509ECC03E70462BAalias: sdio:c*v024Cd8179*depends: vermagic: 3.4.112-sun8i SMP preempt mod_unload modversions ARMv7 p2v8I 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): * monitorUnfortunately, the switch to monitor mode doesn't run :"iwconfig wlan0 mode monitor"oot@orangepiplus:/usr/src/rtl8189ES_linux# iwconfig wlan0 mode monitorError 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 and is not duplicated:root@orangepiplus:~# iwconfiglo 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. I believe it is worth integrating in the new release. 1 Link to comment Share on other sites More sharing options...
Igor Posted May 26, 2016 Share Posted May 26, 2016 I'll merge it asap. Thanks too you too. BTW. Now we are extending task to include support for 8189ftv found on latest OPi boards. Link to comment Share on other sites More sharing options...
jernej Posted May 26, 2016 Share Posted May 26, 2016 @y52, I don't have time to test it just now, but are you sure that simple "ifconfig wlan0 down" before changing mode wouldn't help? Link to comment Share on other sites More sharing options...
y52 Posted May 26, 2016 Author Share Posted May 26, 2016 This is easy to check. Here is a log : root@orangepiplus:~# dateThu May 26 23:20:49 CEST 2016 root@orangepiplus:~# iwconfigwlan0 unassociated Nickname:"<WIFI@REALTEK>" Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated root@orangepiplus:~# ifconfig wlan0 down The wlan0 still present :root@orangepiplus:~# iwconfigwlan0 unassociated Nickname:"<WIFI@REALTEK>" Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated root@orangepiplus:~# iwconfig wlan0 mode monitorError for wireless request "Set Mode" (8B06) : SET failed on device wlan0 ; Operation not permitted. root@orangepiplus:~# ifconfig wlan0 uproot@orangepiplus:~# iwconfigwlan0 unassociated Nickname:"<WIFI@REALTEK>" Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated Link to comment Share on other sites More sharing options...
jernej Posted May 26, 2016 Share Posted May 26, 2016 I checked source code and monitor mode seems to be supported. Maybe you can try this: sudo iw phy phy0 interface add wlan1 type monitor where wlan1 is some unused interface. If that doesn't work, try to play with ifconfig up/down before. At the end, you will have two interfaces, linked to same physical device. You can remove unneeded one with: sudo iw <interface> del where <interface> is the name of the interface you want to delete. Link to comment Share on other sites More sharing options...
y52 Posted May 28, 2016 Author Share Posted May 28, 2016 It seems this method fails as well on the rtl8189 driver build. " iw phy phy0 interface add mon0 type monitor " creates a somewhat nonfunctional interface, which does nothing, and is not capable monitoring network activities. I have another dongle WiFi. It switches to monitor mode natively: root@bananapipro:~# lsmodModule Size Used byrt2800usb 17661 0rt2800lib 71334 1 rt2800usb root@bananapipro:~# iwconfigwlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:offroot@bananapipro:~# iwconfig wlan0 mode monitor root@bananapipro:~# iwconfigwlan0 IEEE 802.11bgn Mode:Monitor Tx-Power=0 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off root@bananapipro:~# iwconfigwlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:off Another method works as well:root@bananapipro:~# iw phy phy0 interface add mon0 type monitorroot@bananapipro:~# iwconfigwlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm Retry short limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:off mon0 IEEE 802.11bgn Mode:Monitor Tx-Power=0 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off The mon0 works with rt2800usb but fails with rtl8189 Link to comment Share on other sites More sharing options...
jernej Posted May 28, 2016 Share Posted May 28, 2016 what if you first add monitor interface and then delete first one? Link to comment Share on other sites More sharing options...
y52 Posted May 29, 2016 Author Share Posted May 29, 2016 To reproduce your scenario : root@orangepiplus:~# dateSun May 29 23:20:01 CEST 2016 root@orangepiplus:~# lsmodModule Size Used by8189es 1082364 0 root@orangepiplus:~# iwconfigwlan0 unassociated Nickname:"<WIFI@REALTEK>" Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated Sensitivity:0/0 Retry:off RTS thr:off Fragment thr:off Encryption key:off Power Management:off 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:0root@orangepiplus:~# iw phy phy0 interface add mon0 type monitorroot@orangepiplus:~# iwconfigmon0 IEEE 802.11bg Mode:Monitor Tx-Power=12 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:on wlan0 unassociated Nickname:"<WIFI@REALTEK>" Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated Sensitivity:0/0 Retry:off RTS thr:off Fragment thr:off Encryption key:off Power Management:off 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:0root@orangepiplus:~# iw wlan0 del root@orangepiplus:~# iwconfigmon0 IEEE 802.11bg Mode:Monitor Tx-Power=12 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:on root@orangepiplus:~# airodump-ng mon0 CH 11 ][ Elapsed: 20 s ][ 2016-05-29 23:23 BSSID PWR Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID Doesn't find any wireless network. Link to comment Share on other sites More sharing options...
xwalter Posted May 30, 2016 Share Posted May 30, 2016 @y52 Are you able to run the wifi module built-in board as AP? Link to comment Share on other sites More sharing options...
jernej Posted June 2, 2016 Share Posted June 2, 2016 @y52, just for fun I tried to use monitor mode on OPi2 using my OpenELEC system. I installed wireless tools and tcpdump from repo and to my amazement, it worked. So I think some service on Armbian is preventing wifi to work correctly. Maybe you will have more luck now that Igor included latest driver in regular builds. Link to comment Share on other sites More sharing options...
Recommended Posts