use usb wifi adapter on mk808

yobikap
Posts: 119
Joined: Tue Oct 09, 2012 1:08 pm

Re: use usb wifi adapter on mk808

Postby yobikap » Tue Dec 18, 2012 3:36 pm

julandroid wrote:Can anyone explain me how Wifi turn on/off in the GUI basically works? What sequence of commands and services are executed?

I'm trying to make Edimax EW-7811Un usb adapter to run (see my post above), but it turns out that I can't even make build-in wifi to run by only using command line calls.

Does any one reverse engineered?


In Java there is a WifiManager that uses the System service to call the WiFi to turn on/off. The WiFi in this case is the wpa_supplicant service that is running.

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Wed Dec 19, 2012 12:26 pm

bay wrote:Find attached rt3070sta.ko
Does insert well "insmod rt3070sta.ko" can scan and see all wifi in the area:
unfortunatly could not get yet connection with dhcpd.
If you succeed give back procedure ;-)

Following what I followed thanks to "rainlake » instructions:

put "RT2870STA" at the right place.
/etc/Wireless/RT2870STA/RT2870STA.dat

put "rt3070.bin" in right "fw" location
/system/etc/firmware/rt3070.bin

iwconfig
ifconfig wlan0 down
rmmod wlan
insmod /sdcard/drivers/rt3070sta.ko
ifconfig wlan0 up
netcfg
iwlist wlan0 scan
iwconfig wlan0 essid NETWORK_ID key s:WIRELESS_KEY
dhcpcd -d wlan0


Hey there...

i need all your help too. I got my USB Wlan stick (D-Link dwa-140 rev B) running fine with the description above. Via Terminal i can startup the Stick and if the Stick is running once i can leave terminal and wlan is still up for every other app.

But when i reboot / turn off my stick and start it again all "settings" are gone and stick is using the internal Wifi again. What i have to do that i don't need to do everytime these steps trough the Terminal app?

Is there a config file where i could state "Hey Stick, just use the USB Wlan stick" ?

bay
Posts: 17
Joined: Wed Nov 21, 2012 5:34 pm

Re: use usb wifi adapter on mk808

Postby bay » Wed Dec 19, 2012 4:01 pm

As alternative some people can just get benefit of existing wifi by changing the configuration file:
- It worked 80% for me, great improvement.

viewtopic.php?f=66&t=212&start=360#p5456
viewtopic.php?f=13&t=718&start=110#p5455

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Wed Dec 19, 2012 5:06 pm

bay wrote:As alternative some people can just get benefit of existing wifi by changing the configuration file:
- It worked 80% for me, great improvement.

viewtopic.php?f=66&t=212&start=360#p5456
viewtopic.php?f=13&t=718&start=110#p5455


Where to find these needed MAC Adress?

bay
Posts: 17
Joined: Wed Nov 21, 2012 5:34 pm

Re: use usb wifi adapter on mk808

Postby bay » Wed Dec 19, 2012 6:38 pm

You can see your devices MAC adress
typing "netcfg" under terminal.
take the one associated to wlan0 .... xx:xx:xx:xx:xx:xx
and copy in file nvram_RK901.txt within:
macaddr=xx:xx:xx:xx:xx:xx

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Fri Dec 21, 2012 11:05 am

mirko2002 wrote:
bay wrote:Find attached rt3070sta.ko
Does insert well "insmod rt3070sta.ko" can scan and see all wifi in the area:
unfortunatly could not get yet connection with dhcpd.
If you succeed give back procedure ;-)

Following what I followed thanks to "rainlake » instructions:

put "RT2870STA" at the right place.
/etc/Wireless/RT2870STA/RT2870STA.dat

put "rt3070.bin" in right "fw" location
/system/etc/firmware/rt3070.bin

iwconfig
ifconfig wlan0 down
rmmod wlan
insmod /sdcard/drivers/rt3070sta.ko
ifconfig wlan0 up
netcfg
iwlist wlan0 scan
iwconfig wlan0 essid NETWORK_ID key s:WIRELESS_KEY
dhcpcd -d wlan0


Hey there...

i need all your help too. I got my USB Wlan stick (D-Link dwa-140 rev B) running fine with the description above. Via Terminal i can startup the Stick and if the Stick is running once i can leave terminal and wlan is still up for every other app.

But when i reboot / turn off my stick and start it again all "settings" are gone and stick is using the internal Wifi again. What i have to do that i don't need to do everytime these steps trough the Terminal app?

Is there a config file where i could state "Hey Stick, just use the USB Wlan stick" ?


Ok i tested with replacing the file nvram_RK901.txt with correct MAC adress but WLAN connection is as bad as before - often disconnects/unstable and really slow. Just with the external stick i get internet fluently .

Does anyone know how i can enable this stick permanently? Currently it works till i reboot or turn off the stick. After reboot stick is using the internal wifi antenna again :(

yobikap
Posts: 119
Joined: Tue Oct 09, 2012 1:08 pm

Re: use usb wifi adapter on mk808

Postby yobikap » Sat Dec 22, 2012 7:52 am

replace the rkwifi.ko with your module.

so:

adb remount
adb push rt3070sta.ko /system/lib/modules/rkwifi.ko
adb reboot

after that everything should be working through the external stick, at least if the rt3070sta.ko supports the -Dnl80211 driver.

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Sat Dec 22, 2012 9:11 am

Ok i will try with your commands. But before i want to know if its not the same if i rename the rkwifi.ko to rkwifi.ko.old and just rename the rt3070sta.ko to rkwifi.ko and copy to /system/lib/modules? He should use now the "new" rkwifi.ko or am i wrong?

yobikap
Posts: 119
Joined: Tue Oct 09, 2012 1:08 pm

Re: use usb wifi adapter on mk808

Postby yobikap » Mon Dec 24, 2012 5:52 am

That is exactly the same.

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Mon Dec 24, 2012 6:44 am

thanks yobikap for your reply.

First i tried the method to rename the old rkwifi.ko to rkwifi.ko.old and copied rk3070sta.ko to same folder (/system/lib/modules/) and renamed to rkwifi.ko.
Then i have rebooted the Stick. After reboot Stick was online but still with the internal wlan module. My USB Wlan stick is not "flashing" with the orange LED so i exactly know with which device the stick was online.

Ok so i removed the "new" rkwifi.ko and renamed the rkwifi.ko.old to the origial name rkwifi.ko to get back the default setup.

Then i tried your instructions with the terminal app.

I logged in as SU.
Entered "adb remount" - first i got a message that some services is not running but the stick is starting this service now. After a few seconds there is only the message "error: device not found".
I can enter "adb remount" as often i want - i still get always the same message "error: device not found".

So atm i don't get it working properly.

Do you have any other ideas how to get this Stick working permanent?

I don't know how the Stick can use the internal wifi when i replaced the original rkwifi.ko with the new one (original rk3070sta.ko renamed to rkwifi.ko).

Btw - Merry Christmas everyone

yobikap
Posts: 119
Joined: Tue Oct 09, 2012 1:08 pm

Re: use usb wifi adapter on mk808

Postby yobikap » Mon Dec 24, 2012 6:47 am

mirko2002,

Which image are you using?

If Finless rom; Just upload your init.rc and init30board.rc file, we have to make some modifications to these two or one of these.

Merry Christmas

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Mon Dec 24, 2012 7:07 am

No currently i don't use a custom rom but the original one from 29th Nov (http://blog.geekbuying.com/index.php/20 ... -29th-nov/)

I use an iMito MX1 but i don't think it has todo with with stick. As i know they are all the same...

yobikap
Posts: 119
Joined: Tue Oct 09, 2012 1:08 pm

Re: use usb wifi adapter on mk808

Postby yobikap » Mon Dec 24, 2012 7:36 am

We can change the module that get's loaded upon boot, and instead of rkwifi.ko we can load the rt3070sta.ko module at boot.

But we have to make modifications to the init.rc file.

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Mon Dec 24, 2012 7:59 am

Ok can you tell me in which folder i can find this file?

I would provide this file asap to get my Wifi online :)

yobikap
Posts: 119
Joined: Tue Oct 09, 2012 1:08 pm

Re: use usb wifi adapter on mk808

Postby yobikap » Mon Dec 24, 2012 9:13 am

It's in your root folder:

Code: Select all

/init.rc

and

Code: Select all

/init30rkboard.rc

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Mon Dec 24, 2012 10:02 am

Ok its attached... needs to ZIP it because .rc file extension wasn't allowed to upload.

In both files i couldn't find anything about the rkwifi.ko file...
You do not have the required permissions to view the files attached to this post.

yobikap
Posts: 119
Joined: Tue Oct 09, 2012 1:08 pm

Re: use usb wifi adapter on mk808

Postby yobikap » Mon Dec 24, 2012 10:36 am

Open the init.rk30board.rc file and add the following to "on boot" section

Code: Select all

rmmod /system/lib/modules/rkwifi.ko
insmod /system/lib/modules/rt3070sta.ko


so you will have now:

Code: Select all

on boot
    mount debugfs /sys/kernel/debug /sys/kernel/debug
    chown system system /sys/devices/system/cpu/cpu1/online
    chmod 0660 /sys/devices/system/cpu/cpu1/online
    insmod /system/lib/modules/vpu_service.ko

#backlight
    chown system system /sys/class/backlight/rk28_bl/brightness

# for wifi
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/wifi/sockets/tmp 0440 wifi wifi
    mkdir /data/misc/dhcp 0770 dhcp dhcp
    chown dhcp dhcp /data/misc/dhcp

# bluetooth power up/down interface
    chmod 0660 /dev/ttyS0
    chmod 0660 /dev/ttyS2
    chmod 0660 /dev/vflash
    chown bluetooth bluetooth /dev/vflash
    chown bluetooth bluetooth /dev/ttyS2
    chown bluetooth bluetooth /dev/ttyS0
    chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
    chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
    chmod 0664 /sys/class/rfkill/rfkill0/state

    chown system system /sys/mali400_utility/utility
    chmod 0664 /sys/mali400_utility/utility
# for usb audio
    chmod 0664 /sys/class/switch/usb_audio_playback/state
    chmod 0664 /sys/class/switch/usb_audio_capture/state
    chown system system /sys/class/switch/usb_audio_playback/state
    chown system system /sys/class/switch/usb_audio_capture/state
   
    # for mt6622
    #mknod /dev/bthwctl
    chmod 0666 /dev/bthwctl

    # for rt3070sta.ko
    rmmod /system/lib/modules/rkwifi.ko
    insmod /system/lib/modules/rt3070sta.ko


Save the file and try it. After reboot, check if your init.rk30board.rc contains your modifications. If not we have to modify your boot.img.

mirko2002
Posts: 14
Joined: Sun Dec 16, 2012 12:56 pm

Re: use usb wifi adapter on mk808

Postby mirko2002 » Tue Dec 25, 2012 8:18 am

Ok i think we have to edit my boot.img because after reboot all changes are gone.

Where do i find this file or what i have to do?

yobikap
Posts: 119
Joined: Tue Oct 09, 2012 1:08 pm

Re: use usb wifi adapter on mk808

Postby yobikap » Wed Dec 26, 2012 6:50 pm

Hi mirko2002,

You can maybe try the solution what julandroid suggested here:

viewtopic.php?f=66&t=726&p=5660#p5660

But instead of his suggested content you can put the following:

Code: Select all

#!/system/bin/sh

rmmod /system/lib/modules/rkwifi.ko
rmmod /system/lib/modules/wlan.ko
insmod /system/lib/modules/rt3070sta.ko


I have not tested this solution, but you can try. Let me know if this works, if it is, then we don't need to modify the boot.img.

CK808
Posts: 4
Joined: Wed Dec 26, 2012 10:36 pm

Re: use usb wifi adapter on mk808

Postby CK808 » Wed Dec 26, 2012 11:40 pm

Hi guys, is there any possible way for someone to compile the TP-LINK TL-WN722N? It has an Atheros AR9002U chipset, and chip 1 is an AR9271. I'm using Finless 1.5a, the wifi starts at 65mbps, and after 10 minutes or less, the wifi drops to 16mbps, then all the way down to 5mbps.

I know I am probably asking alot. It just kills me that this is happening and I myself, really can't do anything about it. Thank you SO MUCH, in advance.


Here is more info on the device.
http://wikidevi.com/wiki/TP-LINK_TL-WN722N


Return to “Development”

Who is online

Users browsing this forum: No registered users and 1 guest