offensive-security / kali-nethunter

The Kali NetHunter Project
https://github.com/offensive-security/kali-nethunter/wiki
3.47k stars 890 forks source link

External Wifi card not detected Nexus 7 2013 #122

Closed byt3bl33d3r closed 9 years ago

byt3bl33d3r commented 9 years ago

Hi guys! I just compiled from source and flashed my Nexus 7 2013.. everything works except for the external wireless card... I'm using the TP-LINK TL-WN722N dmesg says USB in low power mode don't know if that has anything to do with it

binkybear commented 9 years ago

I haven't made any changes to Kitkat kernel (4.4.4). Did you compile from development branch or master. Just curious as I've been playing with lollipop builds for the 5.0 one.

edit * Oops didn't mean to close

byt3bl33d3r commented 9 years ago

I compiled from the master branch for kit kat. Do you want the full dmesg output?

binkybear commented 9 years ago

Sure or just the area where you plug it in/out. Do you also happen to have a y-cable? It might be interesting to see if it works with external power. If not I can relook at kernel.

Gh0u1L5 commented 9 years ago

I got the same issue in my Nexus 7 2013 with CyanogenMod but I cannot find Y-cable right now to test, so if you have any progress, please make me know.

Gh0u1L5 commented 9 years ago

Ok, according to my tests, this issue can be solved by checking out "Wi-Fi optimization" in Wi-Fi Advanced Settings.

binkybear commented 9 years ago

@Gh0u1L5 - Thats a very interesting fix.

byt3bl33d3r commented 9 years ago

@Gh0u1L5 @binkybear I'm running KitKat and the fix doesn't work for me... maybe that only works for CAF based kernels?

Gh0u1L5 commented 9 years ago

@byt3bl33d3r Do you still have same problem or a new one? Can you send us your dmesg?

binkybear commented 9 years ago

@byt3bl33d3r - Maybe you can try a reflash of the kernel: http://photonicgeek.me/NetHunter/Kernels/flo-deb/.

Otherwise, I will test on my end a kernel build tonight.

byt3bl33d3r commented 9 years ago

@binkybear just reflashed the kernel with the link you gave me but it still doesn't detect it.. Heres the dmesg output when I plug in the USB wifi adapter:

[   14.073394] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   14.073486] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   14.073577] usb usb1: Product: Qualcomm EHCI Host Controller using HSIC
[   14.073638] usb usb1: Manufacturer: Linux 3.4.0-Kali-gb80c147 ehci_hcd
[   14.073760] usb usb1: SerialNumber: msm_hsic_host
[   14.074462] hub 1-0:1.0: USB hub found
[   14.413116] usb 1-1: new high-speed USB device number 2 using msm_hsic_host
[   14.476654] usb 1-1: New USB device found, idVendor=05c6, idProduct=9048
[   14.476745] usb 1-1: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[   14.476837] usb 1-1: Product: Qualcomm CDMA Technologies MSM
[   14.476928] usb 1-1: Manufacturer: Qualcomm, Incorporated
[   14.490173] rmnet_usb 1-1:1.5: rmnet_usb0: register 'rmnet_usb' at usb-msm_hsic_host-1, RmNET net device, ce:55:59:23:7c:b4
[   14.494537] rmnet_usb 1-1:1.6: rmnet_usb1: register 'rmnet_usb' at usb-msm_hsic_host-1, RmNET net device, ce:55:59:23:7c:b4
[   14.574676] rmnet_usb 1-1:1.7: rmnet_usb2: register 'rmnet_usb' at usb-msm_hsic_host-1, RmNET net device, ce:55:59:23:7c:b4
[   14.664978] rmnet_usb 1-1:1.8: rmnet_usb3: register 'rmnet_usb' at usb-msm_hsic_host-1, RmNET net device, ce:55:59:23:7c:b4
[   52.328186] msm_hsusb_config_vddcx: min_vol:1045000 max_vol:1320000
[   52.328216] msm_otg msm_otg: USB exited from low power mode
[   52.342468] [usbhost_charge_mode]: Do not supply power in host mode
[   52.555694] msm_hsusb_host msm_hsusb_host: Qualcomm On-Chip EHCI Host Controller
[   52.556304] msm_hsusb_host msm_hsusb_host: new USB bus registered, assigned bus number 2
[   52.584991] msm_hsusb_host msm_hsusb_host: irq 132, io mem 0x12500000
[   52.604827] msm_hsusb_host msm_hsusb_host: USB 2.0 started, EHCI 1.00
[   52.605438] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[   52.605682] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   52.606048] usb usb2: Product: Qualcomm On-Chip EHCI Host Controller
[   52.606384] usb usb2: Manufacturer: Linux 3.4.0-Kali-gb80c147 ehci_hcd
[   52.606597] usb usb2: SerialNumber: msm_hsusb_host
[   52.614959] hub 2-0:1.0: USB hub found
[   55.044952] msm_otg msm_otg: USB in low power mode
[   95.328216] rmnet_usb 1-1:1.7: [rmnet_usb2] error: rmnet_ioct called for unsupported cmd[35597]
[   95.329681] rmnet_usb 1-1:1.6: [rmnet_usb1] error: rmnet_ioct called for unsupported cmd[35597]
[   95.331115] rmnet_usb 1-1:1.5: [rmnet_usb0] error: rmnet_ioct called for unsupported cmd[35597]
[   95.332824] rmnet_usb 1-1:1.8: [rmnet_usb3] error: rmnet_ioct called for unsupported cmd[35597]
[   95.378082] rmnet_usb 1-1:1.5: [rmnet_usb0] error: rmnet_ioct called for unsupported cmd[35597]
[   95.397888] rmnet_usb 1-1:1.6: [rmnet_usb1] error: rmnet_ioct called for unsupported cmd[35597]
[   95.404571] rmnet_usb 1-1:1.7: [rmnet_usb2] error: rmnet_ioct called for unsupported cmd[35597]
[   95.410461] rmnet_usb 1-1:1.8: [rmnet_usb3] error: rmnet_ioct called for unsupported cmd[35597]
[   95.421875] rmnet_usb 1-1:1.7: [rmnet_usb2] error: rmnet_ioct called for unsupported cmd[35585]
[   95.422821] rmnet_usb 1-1:1.6: [rmnet_usb1] error: rmnet_ioct called for unsupported cmd[35585]
[   95.425659] rmnet_usb 1-1:1.5: [rmnet_usb0] error: rmnet_ioct called for unsupported cmd[35585]
[   95.426910] rmnet_usb 1-1:1.8: [rmnet_usb3] error: rmnet_ioct called for unsupported cmd[35585]
[  237.470184] rmnet_usb 1-1:1.7: [rmnet_usb2] error: rmnet_ioct called for unsupported cmd[35597]
[  237.471099] rmnet_usb 1-1:1.6: [rmnet_usb1] error: rmnet_ioct called for unsupported cmd[35597]
[  237.472076] rmnet_usb 1-1:1.5: [rmnet_usb0] error: rmnet_ioct called for unsupported cmd[35597]
[  237.473327] rmnet_usb 1-1:1.8: [rmnet_usb3] error: rmnet_ioct called for unsupported cmd[35597]
[  237.495086] rmnet_usb 1-1:1.5: [rmnet_usb0] error: rmnet_ioct called for unsupported cmd[35597]
[  237.502410] rmnet_usb 1-1:1.6: [rmnet_usb1] error: rmnet_ioct called for unsupported cmd[35597]
[  237.506530] rmnet_usb 1-1:1.7: [rmnet_usb2] error: rmnet_ioct called for unsupported cmd[35597]
[  237.510559] rmnet_usb 1-1:1.8: [rmnet_usb3] error: rmnet_ioct called for unsupported cmd[35597]
[  237.523101] rmnet_usb 1-1:1.7: [rmnet_usb2] error: rmnet_ioct called for unsupported cmd[35585]
[  237.524108] rmnet_usb 1-1:1.6: [rmnet_usb1] error: rmnet_ioct called for unsupported cmd[35585]
[  237.525146] rmnet_usb 1-1:1.5: [rmnet_usb0] error: rmnet_ioct called for unsupported cmd[35585]
[  237.526367] rmnet_usb 1-1:1.8: [rmnet_usb3] error: rmnet_ioct called for unsupported cmd[35585]
[  275.833709] msm_otg msm_otg: USB exited from low power mode
[  275.833892] msm_hsusb_host msm_hsusb_host: remove, state 4
[  275.834075] usb usb2: USB disconnect, device number 1
[  275.836151] msm_hsusb_host msm_hsusb_host: USB bus 2 deregistered
[  275.836456] [usbhost_charge_mode]: Do not supply power in host mode
[  276.336853] The USB charging type is same : return
[  276.445190] msm_hsusb_config_vddcx: min_vol:0 max_vol:1320000
[  276.445190] msm_otg msm_otg: USB in low power mode
[  311.596313] msm_otg msm_otg: msm_otg_pm_resume: usb vbus change in suspend
[  312.608673] msm_hsusb_config_vddcx: min_vol:1045000 max_vol:1320000
[  312.608734] msm_otg msm_otg: USB exited from low power mode
[  312.734039] msm_otg msm_otg: chg_type = USB_SDP_CHARGER
[  312.734039] smb345_charger: [usb_cable_type_detect] INOK=L
[  312.734039] smb345_charger: [usb_cable_type_detect] Cable: SDP
[  312.734802] bq27541_battery_callback  usb_cable_state = 1
[  312.735076] The USB cable status = CHARGER_SDP
[  312.747192] msm_hsusb msm_hsusb: CI13XXX_CONTROLLER_RESET_EVENT received
[  312.956756] android_work: android_work: sent uevent USB_STATE=CONNECTED
[  312.959259] android_work: android_work: sent uevent USB_STATE=DISCONNECTED
[  313.047332] android_work: android_work: sent uevent USB_STATE=CONNECTED
[  313.049072] android_usb gadget: high-speed config #1: android_usb
[  313.049133] USB fast charging is OFF.
[  313.049133] msm_otg msm_otg: Avail curr from USB = 500
[  313.049133] msm_otg msm_otg: Power Supply doesn't support USB charger
[  313.104705] android_work: android_work: sent uevent USB_STATE=CONFIGURED
[  313.194274] android_work: android_work: sent uevent USB_STATE=CONFIGURED
[  317.754211] msm_ta_detect_work: USB exit ta detection - frindex
[  319.734466] USB fast charging is OFF.
[  319.734619] msm_otg msm_otg: Avail curr from USB = 0
[  319.734710] msm_otg msm_otg: Power Supply doesn't support USB charger
[  319.734863] msm_hsusb msm_hsusb: CI13XXX_CONTROLLER_DISCONNECT_EVENT received
[  319.736694] android_work: android_work: sent uevent USB_STATE=DISCONNECTED
[  319.740112] smb345_charger: [usb_cable_type_detect] INOK=H
[  319.740356] bq27541_battery_callback  usb_cable_state = 0
[  319.741485] The USB cable status = CHARGER_NONE
[  319.846252] msm_hsusb_config_vddcx: min_vol:0 max_vol:1320000
[  319.846282] msm_otg msm_otg: USB in low power mode
[  321.266784] msm_hsusb_config_vddcx: min_vol:1045000 max_vol:1320000
[  321.266815] msm_otg msm_otg: USB exited from low power mode
[  321.396087] msm_otg msm_otg: chg_type = USB_SDP_CHARGER
[  321.396331] smb345_charger: [usb_cable_type_detect] INOK=L
[  321.396667] smb345_charger: [usb_cable_type_detect] Cable: SDP
[  321.404998] bq27541_battery_callback  usb_cable_state = 1
[  321.407989] The USB cable status = CHARGER_SDP
[  321.415008] msm_hsusb msm_hsusb: CI13XXX_CONTROLLER_RESET_EVENT received
[  321.620056] android_work: android_work: sent uevent USB_STATE=CONNECTED
[  321.623779] android_work: android_work: sent uevent USB_STATE=DISCONNECTED
[  321.711914] android_work: android_work: sent uevent USB_STATE=CONNECTED
[  321.713775] android_usb gadget: high-speed config #1: android_usb
[  321.713989] USB fast charging is OFF.
[  321.714080] msm_otg msm_otg: Avail curr from USB = 500
[  321.714141] msm_otg msm_otg: Power Supply doesn't support USB charger
[  321.774414] android_work: android_work: sent uevent USB_STATE=CONFIGURED
[  321.864654] android_work: android_work: sent uevent USB_STATE=CONFIGURED
[  326.424133] msm_ta_detect_work: USB exit ta detection - frindex
binkybear commented 9 years ago

@byt3bl33d3r - Give me a day to rebuild kernel without y-cable support. That may be the issue.

byt3bl33d3r commented 9 years ago

@binkybear awesome! thanks!

binkybear commented 9 years ago

https://transfer.sh/%28/DuX0Y/kernel-kali-12112014.zip%29.zip < -- I removed y-cable charging. This might increase the power but I haven't tested as I upgraded to lollipop.

byt3bl33d3r commented 9 years ago

@binkybear ok so now it detects it but everytime i disconnect the wifi card the tablet reboots... I'm also getting some weird terminal output formatting problems

binkybear commented 9 years ago

The disconnect wifi is a known N7 2013 problem. That problem started happening after Kitkat 4.4.2 and I believe it may be related to a wifi firmware upgrade in 4.4.3. So that's normal, but it's not ideal.

What kind of output formatting problems are you seeing?

byt3bl33d3r commented 9 years ago

@binkybear can't see the commands I type in, and when I press enter the prompt slides horizontal

haider98 commented 9 years ago

I am new to nethunter and and my nexus 7 2012 wifi only does not detect any external wifi adapter and show up an error stating wlan1 not up/detected.What should i do????.

binkybear commented 9 years ago

@haider98 - Double check the kernel version string in settings > about. It should not be a google kernel. Also, check if you can ifconfig wlan1 up in chroot. Slightly off topic to current thread but let me know if that works for you.

@byt3bl33d3r - I've never heard or seen that issue. Does it only occur on terminal on android device? Any difference if you ssh into it or use adb?

haider98 commented 9 years ago

I was not able to check ifconfig wlan1 in chroot and it gvae an error>wlan1:error fetching interface information: device not found.My kernel version is> 3.1.10-kangaroo root@fringe#1

byt3bl33d3r commented 9 years ago

@binkybear it only occurs when the bootkali script is launched, and it happens also through adb and ssh. I'll try reflashing to see if that fixes it

haider98 commented 9 years ago

what is the fix??

binkybear commented 9 years ago

@haider98 - You are running the correct the kernel version. What external wifi are you using.

haider98 commented 9 years ago

Tp link WN727N

Skycrazy commented 9 years ago

Could it be a bad otg cable @haider98, can you confirm the tp link works in pc/laptop? if it does work prehaps as simple as changing the otg cable!?

regards

haider98 commented 9 years ago

Yes it work perfectly fine in PC/laptop.The otg cable is also fine is used to move things form my USB to the tablet

haider98 commented 9 years ago

I'll buy a new otg cable and test if it works

haider98 commented 9 years ago

Thanks @Skycrazy

haider98 commented 9 years ago

Okay so I bought a new otg cable and it still not detects any external WiFi adapter.however it did detect a USB storage device.I used stickmount app.

haider98 commented 9 years ago

wifi connection on external adapter (nexus 7, android) this is for anyone who would like to initiate a network connection in android from a usb wifi adapter instead of the internal bcom of the nexus 7, other android devices should be similar.

your going to need to make a copy of your wpa_supplicant.conf. this, as we know, holds general configuration data for wpa_supplicant as well as informations about your access points and authentication. the path on nexus 7 is /data/misc/wifi/wpa_supplicant.conf. so copy it in root browser and rename it to wlan1_supplicant.conf. or from a terminal as root...

$ cp /data/misc/wifi/wpa_supplicant.conf /data/misc/wifi/wlan1_supplicant.conf

next you have to edit the file for wlan1, so edit it as text file in root browser or from terminal using vi or nano. the first line of the file will look like

ctrl_interface=wlan0

you have to change it but specify the complete path of the socket, like this

ctrl_interface=/data/misc/wifi/sockets/wpa_wlan1 GROUP=system

now plug in your adapter, in this case im using a tl-wn722n, and with you internal wifi off open up a terminal and run this as root (android root, not chroot)

$ wpa_supplicant -iwlan1 -c/data/misc/wifi/wlan1_supplicant.conf

the lights on your adapter should be going crazy now, you wont see a wifi icon in the ui however. now you may need to configure dhcp, so open another terminal window and run as root.

$ dhcpcd wlan1

then to test you can

$ netcfg

this will output your ip address and status of your interfaces, you can also ping your router, something like

$ ping 192.168.1.1

and you will get responses back. the key here is using the explicit path to the socket and specifying the group as system, android secures itself through privilege seperation in which each application uses different user and goup id's. if you were to run wpa_supplicant from chroot you could achieve a connection and ip but it would be unusable (at least in my experience) as it does not have correct permissions. but now you can chroot into kali and go nuts!

so i used this method and when i ran the command ($ wpa_supplicant -iwlan1 -c/data/misc/wifi/wlan1_supplicant.conf) the tab says failed to read or parse configuration /data/misc/wifi/wlan1_supplicant .conf

byt3bl33d3r commented 9 years ago

@binkybear sorry for the late reply... the terminal issue i mentioned seems to be related to the kernel you compiled without y-cable charging, when I reflashed with the usual kernel the problem goes away but then it doesn't detect the wifi adapter.. kinda weird though lol

binkybear commented 9 years ago

Yeah, this is a bit weird. Let me recompile and reflash 4.4.4 and see if I can track down problem.

tarrinho commented 9 years ago

Hi @binkybear, I'm having the same issue that @byt3bl33d3r was having. Can you supply with the compiled kernel without the y-cable? Or this issue was already solved some other way?

Thanks

binkybear commented 9 years ago

The one that byt3bl33d3r has should be in the latest version of nethunter. Did you use the latest one? Is it having trouble recognizing device?

tarrinho commented 9 years ago

Yes, just downloaded 2 days ago from your site. And did a apt-get update + upgrade. And yes I'm having problems detecting the device. If I do a lsusb it detects but in wifite it doesn't.

Btw, the external wifi works in a 2012 nexus 7.

tarrinho commented 9 years ago

Using wrong distro. I'm going to install PA and give it a go.

tarrinho commented 9 years ago

Looks like it has the same issue with the Alpha AWUS036H. I got it to work, but it looks like it was luck. I mean, some times it works, sometimes (most of them) it doesn't. Any ideas?

binkybear commented 9 years ago

@tarrinho - I'm glad you got it to work, although I'm unsure why it would work sometimes and not others. It seems like if it works it should stay working.

You could always try playing with usb settings: disable/enable mtp, disable/enable usb debugging. I can't really say why it works sometimes and not though.

0E800 commented 9 years ago

Just want to comment some trouble-shooting techniques.

1: to verify y-cable is working, test with usb-mouse before testing with wifi adapter. 2: along with ifconfig and iwconfig, try using airmon-ng to detect your wifi adapter. 3:sometimes u need to unplug the device from y-cable, and re-plugin. (try using a mouse)

mrhand1113 commented 9 years ago

Hey everyone I am using a Alfa awus036h and I'm running on net hunter lolipop 1.2 nexus 7 2013. I'm having problems as well with my card being detected. I also am having another error in wifite, SIOCSIFFLAGS: No such device. I'm guessing this also has to do with my card not being detected in the first place. I am fairly new to linux in general so any help would be nice. I'm trying to understand this "language" considering I want to go to college for tcp/ip and so on. Anyway thanks for the help, if you need any information from my end just message me. Just made an account to post this :D

binkybear commented 9 years ago

@mrhand1113 - Are you on lollipop or kitkat with your n7 2013?

mrhand1113 commented 9 years ago

@binkybear Lolipop On May 5, 2015 6:38 PM, "binkybear" notifications@github.com wrote:

@mrhand1113 https://github.com/mrhand1113 - Are you on lollipop or kitkat with your n7 2013?

— Reply to this email directly or view it on GitHub https://github.com/offensive-security/kali-nethunter/issues/122#issuecomment-99251956 .

binkybear commented 9 years ago

@mrhand1113 - The error is possibly related to https://github.com/offensive-security/kali-nethunter/issues/198. If you are feeling adventurous I just built a kernel and uploaded it.

I've built a new kernel if you are comfortable flashing in recovery. Just hold down power + volume down when starting device and go into recovery. Copy this zip file over: https://transfer.sh/18pA4k/kernel-kali-n72013.zip to your device and install.

If you do install I suggest making a backup of your "boot" in the backup section of recovery (uncheck everything else). If kernel doesn't work then you can easily go to restore and click on the boot portion.

mrhand1113 commented 9 years ago

@binkybear Ok I will test now thanks in advance On May 5, 2015 9:17 PM, "binkybear" notifications@github.com wrote:

@mrhand1113 https://github.com/mrhand1113 - The error is possibly related to #198 https://github.com/offensive-security/kali-nethunter/issues/198. If you are feeling adventurous I just built a kernel and uploaded it.

I've built a new kernel if you are comfortable flashing in recovery. Just hold down power + volume down when starting device and go into recovery. Copy this zip file over: https://transfer.sh/18pA4k/kernel-kali-n72013.zip to your device and install.

If you do install I suggest making a backup of your "boot" in the backup section of recovery (uncheck everything else). If kernel doesn't work then you can easily go to restore and click on the boot portion.

— Reply to this email directly or view it on GitHub https://github.com/offensive-security/kali-nethunter/issues/122#issuecomment-99280517 .

mrhand1113 commented 9 years ago

@binkybear I just tried to flash the new kernel in TWRP v2.8.6 and after i swipe to confirm it progresses for about 2 seconds and randomly restarts back to the TWRP recovery's main menu.

binkybear commented 9 years ago

@mrhand1113 - I will look into this error today and get back to you.

0E800 commented 9 years ago

Might want to verify md5 to rule out corrupt download. On May 6, 2015 3:29 AM, "binkybear" notifications@github.com wrote:

@mrhand1113 https://github.com/mrhand1113 - I will look into this error today and get back to you.

— Reply to this email directly or view it on GitHub https://github.com/offensive-security/kali-nethunter/issues/122#issuecomment-99411805 .

mrhand1113 commented 9 years ago

@0E800 thanks for the advice, but ive already tried that. :/

On Wed, May 6, 2015 at 3:05 PM, 0E800 notifications@github.com wrote:

Might want to verify md5 to rule out corrupt download. On May 6, 2015 3:29 AM, "binkybear" notifications@github.com wrote:

@mrhand1113 https://github.com/mrhand1113 - I will look into this error today and get back to you.

— Reply to this email directly or view it on GitHub < https://github.com/offensive-security/kali-nethunter/issues/122#issuecomment-99411805

.

— Reply to this email directly or view it on GitHub https://github.com/offensive-security/kali-nethunter/issues/122#issuecomment-99505090 .

binkybear commented 9 years ago

@mrhand1113 - 0E800 was suggesting that I provide the md5 to make sure it was the correct kernel (I think). MD5 (kernel-kali-n72013.zip) = 70bba45795b5ef6c7f82a6e24d202ee2

mrhand1113 commented 9 years ago

@binkybear @OE800 oh OK sorry about that. I thought OE800 was telling me to check the option in TWRP that verifys the md5. :😁. On May 6, 2015 2:22 PM, "binkybear" notifications@github.com wrote:

@mrhand1113 https://github.com/mrhand1113 - 0E800 was suggesting that I provide the md5 to make sure it was the correct kernel (I think). MD5 (kernel-kali-n72013.zip) = 70bba45795b5ef6c7f82a6e24d202ee2

— Reply to this email directly or view it on GitHub https://github.com/offensive-security/kali-nethunter/issues/122#issuecomment-99559994 .

0E800 commented 9 years ago

I wasnt aware that TWRP did that. I was just trying to be helpful. I only have the 2012 version of N7 or else I would be a better help at troubleshooting. Good luck folks.