Hi I've been working on adding support for usb host support in backtrack 5 running on a chroot session.
The ultimate goal is to be able to use a usb wifi adapter for pentesting, as the interal wifi doesnt support layer-2 or packet injection.
i created the usb host cable,by jumping pin 4 to 5, and was able to power my device by splicing in DC power to the cable.
i'm having issues with busybox in the chroot session. i have ver 1.9 running on the android OS but it seems like there are missing modules in backtrack. NO LSUSB!! grr
i just cant get it to give me any output what so ever
#lsusb
#
. But i know the chroot session reads the host device (OTG). running dmesg (full output attached):
[ 3881.112070] max8997_muic_usb_cb: usb mode=3
[ 3881.112087] otg_power_cb: otg power = 1
--
[ 3881.114323] usb usb cable = 3
[ 3881.114348] usb Enable usb LDO.
[ 3881.114396] max8997-charger max8997-charger: max8997_disable_charging: disable charging
[ 3881.114536] usb check ldo vcc_d(192)
[ 3881.114704] usb check ldo vcc_a(192)
[ 3881.114889] otg_dbg: in s5pc110_otg_drv_probe()::00075
[ 3881.114900] => s3c_otg_drv_probe
[ 3881.115115] otg_host_phy_int : USBPHYCTL=0x1,PHYPWR=0xa40,PHYCLK=0x7,PHYTUNE=0x819b3,USBCFG=0x0
[ 3881.266334] s3c_otghcd s3c_otghcd: S3C OTGHCD
[ 3881.266406] s3c_otghcd s3c_otghcd: new USB bus registered, assigned bus number 2
[ 3881.266463] s3c_otghcd s3c_otghcd: irq 135, io mem 0x12480000
[ 3881.268360] max8922-charger max8922-charger: max8922_enable_charging: disable charging,TA
[ 3881.496575] hub 2-0:1.0: USB hub found
[ 3881.496598] hub 2-0:1.0: 1 port detected
[ 3881.496618] otg_dbg: in root_hub_feature()::00477
[ 3881.496625] => case SetPortFeature -USB_PORT_FEAT_POWER
[ 3881.497347] otg_dbg: in s5pc110_otg_drv_probe()::00175
[ 3881.497358] => OTG HCD Initialized HCD, bus=C110 OTG Controller, usbbus=2
[ 3881.498518] usb otg host : registered
[ 3881.498530] host_notify: ndev name=usb_otg: from state=0 -> to state=1
[ 3881.499742] usb change mode ret=0
--
[ 3883.372113] otg_dbg: in root_hub_feature()::00483
[ 3883.372126] => case SetPortFeature -USB_PORT_FEAT_RESET
[ 3883.432171] otg_dbg: in otg_handle_interrupt()::00087
[ 3883.432182] => Port Interrupt
[ 3883.432192] otg_dbg: in process_port_intr()::00271
[ 3883.432203] => port enable/disable changed
[ 3883.502695] usb 2-1: new high speed USB device using s3c_otghcd and address 2
[ 3883.522370] svn usbdev_open, skip usb_autoresume_device
[ 3883.522488] svn usbdev_open, skip usb_autosuspend_device
[ 3883.524055] hub 2-1:1.0: USB hub found
[ 3883.524407] hub 2-1:1.0: 4 ports detected
[ 3883.534375] max8922-charger max8922-charger: max8922_is_charging: charging state = 0x1
[ 3883.762482] usb 2-1.1: new high speed USB device using s3c_otghcd and address 3
[ 3883.784996] usb 2-1.1: device v0bda p8187 is not supported
[ 3883.785068] host_notify: ndev name=s3c_otghcd: from state=0 -> to state=5
[ 3883.805674] hub 2-1:1.0: unable to enumerate USB device on port 1
--
[ 3932.353319] usb_port_resume = 1283, 4
--
[ 5492.343091] usbsvn_request_resume:run time resume
[ 5492.343107] Host USB : Resume
[ 5492.422261] usb_port_resume = 1283, 4
[ 5492.422906] usb 1-2: svn L0 p.s=1
i have the driver for the device (alfa network ,AWUS036h) and it is supported in linux.
i was able to build the driver in the chroot session, but since it is an ARM distro, will the driver even work.
any help would be awesome.
Some success!
I finally got lsusb to recognize the devices. after many many recompilation of busybox,turns out it was a binding problem between the android and the chroot session.
i ran in terminal emulator: ($mnt = the chroot mount point)
#mkdir -p $mnt/dev/bus/usb
#mount -o bind /dev/bus/usb /$mnt/dev/bus/usb
and now in the chroot session:
[email protected]:/#lsusb
Bus 002 Device 002: ID 05e3:0608 Genesys Logic, inc USB-2.0 4-port HUB
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 1519:0020
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
as you can see i plugged in a usb hub to power the device, just to test.
i'm going to be working on compiling the driver.
hopefully beaple to use the aircrack suite soon on my phone.
Two cheers for you mate. Hope you bring in something soon.
Sent from my GT-I9100 using XDA Premium App
Driver
I'm trying to compile the RTL8187 driver for the ARM architecture . I've never done this sort of thing, so any advice on kernel modules would be greatly appreciated.
i'm using the ARM toolchain from :
http://www.codesourcery.com/sgpp/lite/arm/portal/[email protected]=lite
compiling with the i19100 kernel source compiled by XDA members (not the tar files from samsung).
If anyone has any experience with Cross compiling, any help would be awesome.
Holy crap i hope u get this running.
I would love to have bt4 on my phone
I hope u make a full how to guide once u r done
Great work
Boom! Awesome stuff
Zionator said:
Holy crap i hope u get this running.
I would love to have bt4 on my phone
I hope u make a full how to guide once u r done
Great work
Click to expand...
Click to collapse
bt5 is already avalible for i9100
http://forum.xda-developers.com/showthread.php?t=1162662
more good stuff
i've finally got the driver compiled for ARM without it spewing Piles of errors.
now i've actually got to test them.
2 modules:
ieee80211.ko
rtl8187.ko
these would either be loaded in android OS with "insmod" in the init.rc file, so it's loaded on boot. Or in the backtrack 5 chroot session.
now i've got LSUSB working and displaying Some connected devices, however devices such as usb keyboards and My Wifi card are not displayed (the Usb host port is displayyed though)
From the reading i've done i'm pretty sure this is due to a vendor permissions issue.
in a file simmilar to this:
/etc/udev/rules.d/50-android.rules
now i havnt been able to find this file on my phone. or simmilar.
this file allows the types of vendors allowed to connect.
an example command to be added:
Code:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bb4", MODE="0666", NAME=="android"
When i run lsusb on my ubuntu virtual machine, with the card plugged in i get:
Bus 002 Device 002: ID 0bda:8187 Realtek Semiconductor Corp. RTL8187 Wireless Adapter
so i'd have to add a line like this :
Code:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0bda", MODE="0666", NAME=="Realtek"
so in short, If ANYBODY knows where a vendors permission file resides, please post something.
sweet thanks
HUGE!
O MAN i had no IDEA i'd get this far, i've never even used linux that much untill i got this phone!
so as it turns out the permission issue with pretty well ALL devices is very prevalent
you have to allow android OS to connect to specific vendors, i've tested it woth sevral keyboards.
the vendor codes can be found here
HTML:
http://developer.android.com/guide/developing/device.html
but here they are
Code:
Company USB Vendor ID
Acer 0502
ASUS 0b05
Dell 413c
Foxconn 0489
Garmin-Asus 091E
Google 18d1
HTC 0bb4
Huawei 12d1
K-Touch 24e3
KT Tech 2116
Kyocera 0482
Lenevo 17EF
LG 1004
Motorola 22b8
NEC 0409
Nook 2080
Nvidia 0955
OTGV 2257
Pantech 10A9
Philips 0471
PMC-Sierra 04da
Qualcomm 05c6
SK Telesys 1f53
Samsung 04e8
Sharp 04dd
Sony Ericsson 0fce
Toshiba 0930
ZTE 19D2
so an example of this.
i have a lenovo usb keyboard that i want to use.
so log in as root, create file /etc/udev/rules.d/51-android.rules, and add these line:
SUBSYSTEM=="usb_device", SYSFS{idVendor}=="17EF", MODE "0666", NAME=="lenovo"
so in bash:
Code:
su
mount -o remount,rw system /system
mkdir -p /etc/udev/rules.d/
cd /etc/udev/rules.d/
echo SUBSYSTEM=="usb_device", SYSFS{idVendor}=="17EF", MODE "0666", NAME=="lenovo" > 51-android.rules
THIS can be applied to any usb device, so far as i;ve tested. if you cant find the vendor codes in the table, you can get them by plugging the device into a linux box and running lsusb and it's the first set of digits so
bus ### dev ###: ID <this one>:blah "some company"
i'll put together a full tutorial up since NO ONE HAS PUT ONE UP AS FAR AS I"VE SEEN. this would add support for pretty well android devices with OTG host mode!!
Any news on this ?
So ****tiest week ever
my galaxy s2 stopped working, put it in to charge and it wont turn on. no lights no nothing.
i've tried a usb jig.
no dice.
i phoned samsung to get it repaired to replaced.
i sent it in a week ago and i just got it Rushed back from them saying that since it's not a canadian phone; they cant service it.
turns out it was bought in chile.
i have a 700$ paperweight. isnt that awesome
JDouce said he managed to compile a driver successfully
Damn, that's worst news I heard all day. Any ideas how it happened?
Sorry to hear that ... there must be a way to fix your phone without sending it to Chile
Td8f4, huge thanks for posting your findings.
I compiled kernel modules for my ralink3070, which is the . I even had them loaded with insmod. But it didn't work. dmesg says "this device is not supported".
Any news on this, is this manual written some place?
I tried writing this udev rule, but with no effect so far. I am also running on Galaxy S2, with Lite'ning ROM 6.1 (Android 2.3.4, Kernel 2.6.35-11 ninphetamine 2.0.5+).
Edit: I did not see page 2 of this thread... sorry for your phone Td8f4... but then trying to get the warranty when you re-flashed it... and overclocked it, you have little chances. Good luck anyway.
If anyone get the USB device to actually appear in lsusb, give me a sign, I only get flashdrives and hubs to appear, a serial2usb won't.
I now figured out that the problem was due to CONFIG_SEC_WHITELIST and driver/usb/core/sec_whitelist.h One or the other has to be modified, both have been tested to be working. With the default falues, devices other than a few defined one (HID, cameras, mass storage, hub) won't be connected at all and will not appear in lsusb or dmesg.
The next step once they appear in lsusb and dmesg with a line "usb 2-1: device v0403 p6001 is not supported" is to find which driver is needed and either compile it within the kernel, or compile it as a module and insmod it manually. You have succeeded that step when you get a new line in dmesg from your device driver.
The next step again is to find an application using the driven device (I am at that step now, for a usbserial device)
Hi,
I am currently trying to get the usbserial-module working on Siyah-kernel.
In fact, usbserial and ftdi_sio both load (the same device works fine with those modules on a desktop. Yes, I have compiled them for ARM agains Siyah-Kernel and not just copied them from desktop ;-) ), but s3c_otghcd 'snatches' away the device before I can get a hold of it.
Have a look at my post here:
http://forum.xda-developers.com/showpost.php?p=18299539&postcount=3712
If you can give me any further leads (should "CONFIG_SEC_WHITELIST=n" be enough, and does it break other things, like mouse / hub support?), that would be very much appreciated .
EDIT: Got it working with an external DIGITIZER, I can now watch analog signals with 5 GS/s on my phone... oscilloscope to go!
So "CONFIG_SEC_WHITELIST=n" breaks nothing (thumbdrives still work), but enables a whole world of possibilities.
EDIT2: A nice picture can be seen here:
http://forum.xda-developers.com/showpost.php?p=18328481&postcount=4032
watching this thread with great interest, if the OP has a donate link to go towards a new phone i'm sure plenty of people might contribute
Td8f4 said:
So ****tiest week ever
my galaxy s2 stopped working, put it in to charge and it wont turn on. no lights no nothing.
i've tried a usb jig.
no dice.
i phoned samsung to get it repaired to replaced.
i sent it in a week ago and i just got it Rushed back from them saying that since it's not a canadian phone; they cant service it.
turns out it was bought in chile.
i have a 700$ paperweight. isnt that awesome
JDouce said he managed to compile a driver successfully
Click to expand...
Click to collapse
Depending on how far you want to go to repair it, you can always unbrick your phone. Search for Jtag repair. You can reflash through the built in testing ports.
some new?? galaxy S2 LIVE???
Hi,
From the bootloader I am unable to connect via USB or to flash from MicroSD.
I am running SPL-2.08.000 8G XE
I have magldr version 1.11 installed with a cyaogen mod 7 running on top of that.
On the PC, I am running Windows 7 x64.
When I run the bootloader (pwr on + hold vol dn) it says serial at the bottom and when I connect it to the Win7 machine one of three things happens.
1) Nothing.
2) On the Windows Desktop I get a message that "USB Device not Recognized"
3) On the phone, I get a white only bottom (no Serial or USB message)
This happens with both the routine to "disable drivers signature" by pressing F8, and without doing that.
I have also removed Windows Mobile Device Center 6.1 and the drv update. It still will not load. I have tried the AS drivers for Win7x64 and it says "no driver for this device found in this folder".
One possible solution was to flash the rom, via the MicroSD card, by renaming a .nbh to LEOIMG.nbh. However, I have tried several roms (1.66 roms, windows 6.5 roms, magldr 1.12 and magldr 1.13 nbhs) yet, the phone goes grey and says "Loading..." but nothing happens.
I am genuinely stuck.
I've been through a million forums and I can't seem to find a solution to my problem. As you can see I have tried several different solutions that I have found but none have worked.
My aim is to update magldr to ver 1.13 and load a newer rom.
Thank you,
P
"USB Device not Recognized"
This usually happens when cable is faulty or the jack.
It also happens when the phone is unresponsive.
crush said:
"USB Device not Recognized"
This usually happens when cable is faulty or the jack.
It also happens when the phone is unresponsive.
Click to expand...
Click to collapse
It charges... how else can I test the cable? Or the jack on the phone?
//edit: I have a spare cable and have tested it. It is not the cable. I have also cleaned the jack. A wiggle of the jack does not yeild any difference.
I went into Linux on my machine and ran
[email protected]:~$ dmesg | tail
[ 253.644057] usb 3-1: device descriptor read/64, error -62
[ 253.888054] usb 3-1: device descriptor read/64, error -62
[ 254.128061] usb 3-1: new low speed USB device using ohci_hcd and address 11
[ 254.269065] usb 3-1: device descriptor read/64, error -62
[ 254.512059] usb 3-1: device descriptor read/64, error -62
[ 254.752054] usb 3-1: new low speed USB device using ohci_hcd and address 12
[ 255.160725] usb 3-1: device not accepting address 12, error -62
[ 255.296064] usb 3-1: new low speed USB device using ohci_hcd and address 13
[ 255.705054] usb 3-1: device not accepting address 13, error -62
[ 255.705095] hub 3-0:1.0: unable to enumerate USB device on port 1
What I suppose is really unusual is that this has happened AND I'm unable to flash via MicroSD.
P
ok,
Are you using front USB port? if yes then try different port at back.
Because its strange on some motherboards that it stop reading properly from front usb's :-S this happened to me with my panasonic camera which wasn't readable at front but did work on back.
for more info you can goto these link
http://www.linux-usb.org/FAQ.html#ts6
Hi all,
I'm really hoping someone can help.
This morning I applied the stock Google 4.2 (JOP40C) update from Google's factory images page using the supplied flash-all.sh script. The tablet applied the update, rebooted - and then I saw an error message saying an app had crashed, I believe it was the launcher but basically ignored it, and after pressing "okay" a few times I just held the power button until the power off dialog came up and I turned the tablet off.
Now it won't turn back on. I've tried the long-press method (I've tried 30 seconds, 1 minute, whilst plugged in to the mains, whilst plugged in to USB, volume up/down buttons held and not held) but so far it's as dead as a can of spam. I gave it a two hour charge on a wall charger, still no difference.
When attempting a stock flash / debrick via fastboot, fastboot just says "waiting for device" and waits forever. That's the same on Windows and on Linux, both systems usually work fine with ADB and fastboot.
When connected via USB to my Ubuntu PC, dmesg says:
Code:
[15660.333585] usb 3-1: new high-speed USB device number 4 using xhci_hcd
[15665.328725] xhci_hcd 0000:03:00.0: Timeout while waiting for address device command
[15670.527680] xhci_hcd 0000:03:00.0: Timeout while waiting for address device command
[15670.731479] usb 3-1: device not accepting address 4, error -62
[15670.731578] xhci_hcd 0000:03:00.0: Bad Slot ID 3
[15670.731579] xhci_hcd 0000:03:00.0: Could not allocate xHCI USB device data structures
[15670.731582] hub 3-0:1.0: couldn't allocate port 1 usb_device
[15746.062340] usb 3-1: new high-speed USB device number 5 using xhci_hcd
[15746.080922] usb 3-1: New USB device found, idVendor=0955, idProduct=7330
[15746.080925] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[15746.080926] usb 3-1: Product: APX
[15746.080928] usb 3-1: Manufacturer: NVIDIA Corp.
[15746.080983] usb 3-1: ep 0x81 - rounding interval to 32768 microframes, ep desc says 0 microframes
[15746.080986] usb 3-1: ep 0x1 - rounding interval to 32768 microframes, ep desc says 0 microframes
When attached via USB to my Windows PC, which usually works with Android / fastboot / APX devices just fine, I see an "unknown device" appear, with the status of:
Code:
Windows has stopped this device because it has reported problems. (Code 43)
Now I'm guessing it's dead and time to call Asus, but I wanted to check first. I went to back to the PC World store I bought it from and they say because it's a month old it's not their problem (over 21 days since purchase) so it has to go back to Asus.
Can anyone give any advice? Is there a way of re-flashing the bootloader some how without the need for fastboot? Is there something like nvflash for the N7 (I've seen this mentioned before here but it didn't seem to lead anywhere). Given that I can't get it to respond to fastboot nor ADB and as the screen never comes on I guess it's dead, but I'd welcome any hints before I call Asus - thanks in advance! :good:
Have any of you got the Ubuntu 13.04 (raring ringtail) daily builds for the N7 grouper to successfully boot?
I tried the recent 20130421 and 20130420.2 builds - the kernel boots successfully but only stays alive for about 7 seconds. (I was able to observe a little bit of /proc/last_kmsg by quickly booting to a custom recovery after the failed boot).
Don't know if it makes any difference or not, but I installed by flashing the system .zip file
raring-preinstalled-armel+grouper.zip
and manually installing the boot image (raring-preinstalled-boot-armel+grouper.img) using "dd" to the LNX partition (via TWRP's command-line UI).
Yes, I did both a factory reset and a wipe of /system in TWRP prior to flashing. (Even checked the health of /data, /system, and /cache using "e2fsck" after flashing - no problems there, either).
I suppose I could try the quantal quetzal (12.04) daily builds next. Just thought I would ask though.
I did successfully flash an Ubuntu Touch Preview build through ClockworkMod Recovery. To be honest, it wasn't worth it. It's a nice little demo of the basics of the UI, but almost every app was just a placeholder image. There's nothing about it you can't pick up from watching a video of it. Restored backup to Android in ~20 minutes.
Sent from my Nexus 7 using xda app-developers app
Thanks. Yeah, I looked at a video review that gave me the same impression. That's why I tried the 13.04 nightly - iirc, the demo released mid-February was based on quantal (12.04) - I was sort of curious as to whether there was new progress in the last month. Never thought it would become a daily driver, though.
Also, it looks like the builds I referenced are something different - substantially smaller than the "desktop" release of the original ubuntu touch demo for the Nexus 7.
Probably if I spend a little more time with it, I can figure things out. (I thought maybe that these builds needed a multi-boot (kexec) loader or something.)
Kind of strange - one of the boots that I was able to recover a legible /proc/last_kmsg from seemed to be complaining that it wanted to reboot because of the USB cable state. That seems rather odd, but the boot crash was also happening from a disconnected state as well. The thing is, 7-8 seconds is pretty late in the boot process (most of the kernel drivers have initialized) - in fact, there were files with new timestamps in the /data partition suggesting some userland activity had already started up before the kernel decided it wanted to restart.
tail end of /proc/last_kmsg:
Code:
[ 7.628940] kernel_power_off: go to charger mode!
[ 7.629505] max77663-rtc max77663-rtc.0: rtc_shutdown: clean alarm
[ 7.656123] cable_detection_work_handler(): vbus_active = 0 and is_active = 1
[ 7.656235] The USB cable is connected
[ 7.656299] elan-ktf3k 1-0010: Update power source to 1
[ 7.658498] bq27541_shutdown +
[ 7.658560] bq27541_shutdown -
[ 7.659787] smb347_shutdown+
[ 7.661882] smb347_shutdown-
[ 7.662052] Restarting system with command 'chrager-mode'.
[ 7.662114]
[ 7.662174] Restarting Linux version 3.1.10-g06b7e9c ([email protected]) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Sun Apr 21 08:23:03 UTC 2013
[ 7.662183]
32 Corrected bytes, 0 unrecoverable blocks
I have an old Canadian Bell based Galaxy s4, with a dead screen. I'd like to try to get files off it, but did not enable usb debugging mode prior to the screen breaking.
Is there any way to access the file system on the phone in this situation? I've done a bit of looking around and can see that I should be able to access it via adb if I have usb debugging turned on, but debugging isn't on in this case.
I have usb connected the phone to my fedora machine and can see via dmesg that it does get detected. I can hear the thing start up, but beyond that I can't see anything else.
Googling around it sounds like I should be able to load a recover kernel, with debugging turned on if I use the right process, but I can't find enough into to get me going.
dmesg output is below just in case it helps...
.....................................................................................
[ 4104.343749] usb 2-2: USB disconnect, device number 6
[ 4180.261104] usb 2-2: new high-speed USB device number 7 using ehci-pci
[ 4180.376385] usb 2-2: New USB device found, idVendor=04e8, idProduct=6860
[ 4180.376390] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4180.376394] usb 2-2: Product: SAMSUNG_Android
[ 4180.376396] usb 2-2: Manufacturer: SAMSUNG
[ 4180.376399] usb 2-2: SerialNumber: ........
Any help is much appreciated!
If you can get a custom recovery on you can use adb without use debugging on. I assume you have an i337m. Try this with twrp http://galaxys4root.com/clockworkmodtwrp-recoveries/
Sent from my Nexus 9 using XDA Free mobile app
If you have a custom recovery plug it up to hdmi thru HML and use the TV for the screen. Hopefully the touchscreen still works. This worked for mine. No lcd but the digitizer was still good.