yashsingh1/xdaforums huggingface dataset:
[Defy Q&A, Help & Troubleshooting] hackergnome:
walter have u tried this??

i cant get otg cable! f***

asking all mah friends!

guess have to buy one!

---------- Post added at 04:52 PM ---------- Previous post was at 03:53 PM ----------

Hmm doing something wrong!!

# sh ./USBOTG.sh

insmod: init_module '/data/data/com.teslacoilsw.quicksshd/home/ko/scsi_mod.ko' failed (Exec format error)

insmod: init_module '/data/data/com.teslacoilsw.quicksshd/home/ko/sd_mod.ko' failed (Exec format error)

insmod: init_module '/data/data/com.teslacoilsw.quicksshd/home/ko/usb-storage.ko' failed (Exec format error)

insmod: init_module '/data/data/com.teslacoilsw.quicksshd/home/ko/ntfs.ko' failed (Exec format error)

wait 20s...............Segmentation fault (core dumped)

mount done, enter exit to umount

./USBOTG.sh: line 45: /data/data/de.schaeuffelhut.android.openvpn/confs/busybox: not found

umount: can't forcibly umount /sdcard/mnt/*: No such file or directory

#

Is busybox so important anyway will edit the script and try with correct busybox path...

i kept the .ko files at correct place though...

EDiT it works after changing busy box path!!

On cm9 I see sdcard/mnt but I don't have otg cable so can't say it works completely!!
[Defy Q&A, Help & Troubleshooting] sykoism:
It is a big news!

I would like to try it but I cannot get an otg cable as well:'(

Maybe you can post it on another thread so that more people can get notified and help you test for it;-)
[Defy Q&A, Help & Troubleshooting] walter79:
I am waiting for the OTA cable.
[Defy Q&A, Help & Troubleshooting] hackergnome:
Will do...
[Defy Q&A, Help & Troubleshooting] GuustFlater89:
Anyone tried this with WajkIUI of CM7? I'm still waiting on my OTG cable.....:mad:
[Defy Q&A, Help & Troubleshooting] hackergnome:
Still unknown if it works...

Ill try on wiui n update...
[Defy Q&A, Help & Troubleshooting] vishal24387:
use nokia n8 otg cable. U have to shape its port to fit in ur defy port. Its simple :)
[Defy Q&A, Help & Troubleshooting] hackergnome:
I don't have one!

N it seems that its not working with froyo kernel(exec error)...

Works with gb kernel!
[Defy Q&A, Help & Troubleshooting] sam_24:
I was abel to build a OTG-Cable but i can't get the software to run

otg cable pinout

micro usb usb-stick

1----------Vss--------------1

2----------D- --------------2

3----------D+ --------------3

4----------ID ---|

5----------Gnd--|-----------4

ID und GND connectet with switch

CM9 2.3.4 kernel 2.01.2012

shows that the device is in Host-Mode

error output

root@android:/dev/usb # insmod scsi_mod.ko insmod: init_module 'scsi_mod.ko' failed (Exec format error)
[Defy Q&A, Help & Troubleshooting] hackergnome:
Read my post above I got the same error... in my case it was coz I din specify busy box path did u?

2 1 2012?

I think that's froyo kernel by quarx!

Can u try eppy's build?
[Defy Q&A, Help & Troubleshooting] sam_24:
i will try it tomorrow

is busybox already installed on eppy build?

is path /system/xbin/busybox ?
[Defy Q&A, Help & Troubleshooting] hackergnome:
Yup ur right...

But I can't get it to work now even on gb kernel!...

Exec error...

Will try a fresh copy again...
[Defy Q&A, Help & Troubleshooting] elnacho12:
Guys, I've trying this too and found that after you try to run the script and get those errors, if you run "dmesg" it shows:

"ext2: version magic '2.6.29 preempt mod_unload ARMv7 ' should be '2.6.32.9 preempt mod_unload ARMv7 '"

After googling this, I confirmed that it's because these modules were compiled with an old kernel (2.6.29) and I have 2.6.32

If there only was an option to force it... :(
[Defy Q&A, Help & Troubleshooting] hackergnome:
i saw that too!

but y did it work on the cm9 u can see...

i forgot to take screenshot of dmesg!
[Defy Q&A, Help & Troubleshooting] vishal24387:
try to creat those modules with referance to new kernel 2.6.32 & then try again.
[Defy Q&A, Help & Troubleshooting] chenshuo888:
if you want to flash a sbf ,the kernel must be signed.
[Defy Q&A, Help & Troubleshooting] walter79:
Scripts did not work on Gingerbread.

"invalid module format"

Did it only works with old kernel?

I use Galaxy S2 cable.

---------- Post added 16th January 2012 at 12:11 AM ---------- Previous post was 15th January 2012 at 11:41 PM ----------

Maybe this help.

2.6.32.9 kernel modules.

http://sven.killig.de/android/N1/2.2/usb_host/
[Defy Q&A, Help & Troubleshooting] GuustFlater89:
Any hope in getting USB host working on the Defy? Or will an unlocked bootloader the only possibility?

I thought some people were close in getting it working? I would really like this option!
[Defy Q&A, Help & Troubleshooting] walter79:
Strago will try to build new modules for 2.6.32 kernel.
[Defy Q&A, Help & Troubleshooting] GuustFlater89:
Thanks! That would be great. But.... who is Strago?:confused:
[Defy Q&A, Help & Troubleshooting] walter79:
sorry name is stargo a milestone2 owner.
[Defy Q&A, Help & Troubleshooting] Quarx:
Ok, i recompiled the modules for .32 kernel. Not tested, dont have the OTG cable.

insmod scsi_mod.ko

insmod sd_mod.ko

insmod usb-storage.ko

Plug in the OTG adapter, connect the USB Hub and power it with an external power source, because the defy does not deliver enough energy to power any device

after conenct Usb mass storage.. and post dmesg output

<5>[59032.651153] SCSI subsystem initialized
<6>[59664.476135] Initializing USB Mass Storage driver...
<6>[59664.482666] usbcore: registered new interface driver usb-storage
<6>[59664.483215] USB Mass Storage support registered.
[Defy Q&A, Help & Troubleshooting] walter79:
#
9.482788] [B]ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver[/B]
#
<4>[ 9.483032] IRQ 78/usbtll: IRQF_DISABLED is not guaranteed on shared IRQs
#
<6>[ 9.483306] ehci-omap ehci-omap.0: OMAP-EHCI Host Controller
#
<6>[ 9.483581] ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1
#
<6>[ 9.483978] ehci-omap ehci-omap.0: irq 77, io mem 0x48064800
#
<6>[ 9.493103] ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00
#
<6>[ 9.493835] usb usb1: configuration #1 chosen from 1 choice
#
<6>[ 9.494232] hub 1-0:1.0: USB hub found
#
<6>[ 9.494384] hub 1-0:1.0: 3 ports detected

Samsung S2 OTG cable. 4.5.2-109-DHT-25 rom with 4.5.3-109-dpp-11 kernel (gingerbread)

I connect first usb-hub to otg cable --> otg cable plugin defy --> reboot
[Defy Q&A, Help & Troubleshooting] hackergnome:
Quarx!! Y u so awesome????
[Defy Q&A, Help & Troubleshooting] elnacho12:
Can you please point me some links to build the other modules?

Thanks!
[Defy Q&A, Help & Troubleshooting] viper.:
http://foo.abmh.de/en/papers/android/defy/kernel-modules-defy-2.1/

OR

http://foo.abmh.de/en/papers/android/defy/

and scroll down
[Defy Q&A, Help & Troubleshooting] Hairo The Blue Mage:
B.U.M.P.!! :p
[Defy Q&A, Help & Troubleshooting] drakeM:
hi guys! I have an answer for you: i'm running cm7.1-11 by quarx on my defy and i would like to know if usb host modules are already included in my kernel. I tried the usb host diagnostic app found on xda to verify, but i haven't a usb otg cable. The test results says that i have rooted API and kernel support, but the test doesn't recognize any usb device. Now, my doubt is if that is due to the lack of the modules or to the lack of a connected usb device.
[Defy Q&A, Help & Troubleshooting] hackergnome:
Nope they are not in the kernel u need to insmod the 3 three modules...
[Defy Q&A, Help & Troubleshooting] drakeM:
Could you explain me how to do it?

edit: ok, i copied the 3 modules into /system/lib/modules/ and then i called insmod on terminal emulator. It didn't give me any error, so the command was been successfull i suppose, wasn't it?
[Defy Q&A, Help & Troubleshooting] hackergnome:
to know if it woked or not give command lsmod

...
[Defy Q&A, Help & Troubleshooting] drakeM:
ok, in the first lines it shows the three modules i installed, so it worked. Great! :D But, with this modules, i'm now able to use external usb storage devices? Usb pen drive as well as external hdd etc?
[Defy Q&A, Help & Troubleshooting] hackergnome:
not tested yet!
[Defy Q&A, Help & Troubleshooting] Hairo The Blue Mage:
Will this modules work on official CM7?? or only on quarx cm7??
[Defy Q&A, Help & Troubleshooting] drakeM:
I think yes, because the modules should be related to che kernel and not to a specific rom. If u have .32 kernel i think they should work.
[Defy Q&A, Help & Troubleshooting] Matze5800:
So... did anyone successfully test these modules with an otg cable and usb-drive?
[Defy Q&A, Help & Troubleshooting] hackergnome:
i din my xams are on... so... will test after them...

next month...
[Defy Q&A, Help & Troubleshooting] amirali_b:
hi

Before my defy, I had an n900

nokia had announced n900 has no ability to usb host mode

But developers were able to activate it(without power supply like n8)

n900 chipset is twl4030 too(is it the usb host mode chipset?)

We can use n900 kernel module for defy(n900 is has a linux based OS)

but this module must recompile for 2.6.32.9 version of kernel.(i cant do that!)

and maybe we can use n900 scripts too.

i have that files on my pc

this links is so helpful:

talk.maemo.org/showthread.php?t=31921

talk.maemo.org/showthread.php?p=866309#post866309

wiki.maemo.org/N900_Hardware_USB

wiki.maemo.org/N900_Hardware_USB_Host

sorry for my bad english! its my firs real english use :D
[Defy Q&A, Help & Troubleshooting] m.ksy:
any news? have some connect the usb-flash via OTG on GB-based rom?
[Defy Q&A, Help & Troubleshooting] amirali_b:
is it usefull?

power_supply: Add driver for TWL4030/TPS65950 BCI charger :

link: my-dl.vcp.ir/?viewpost=oc242d0p167c
[Defy Q&A, Help & Troubleshooting] skyraintmp:
tested no working after insert 3 modules.

just test with a otg cable to connect a usb stick, the stick seems not power on; connect with a powered usb hub, the screen became freezing, had to ssh log in and dmesg only got:

[ 1793.018951] do_cmd_proc_msg: Acquisition cycle length overflow

[ 1796.380828] do_cmd_proc_msg: Acquisition cycle length overflow

[ 1800.689239] do_cmd_proc_msg: Acquisition cycle length overflow

with cm7 2.3.4 kernel 2.6.32.9
[Defy Q&A, Help & Troubleshooting] Eazz:
This function would be very important
[Defy Q&A, Help & Troubleshooting] anmol7ify:
Any updates?? Testers?

anyone able to got USB OTG support on DEFY or DEFY+... any progress?
[Defy Q&A, Help & Troubleshooting] hackergnome:
What do think?

Its dead!!don't ever bump it again!!

Feels really bad when the hardware is not used up to its potential!!! Damn u moto!!!

DISCLAIMER:NO BUMPING THIS THREAD UNLESS U'VE GOT IT TO WORK
[Defy Q&A, Help & Troubleshooting] vishal24387:
Guys first of all I am extremely sorry for bumping this old thread. But I am really interested in this development. Actually I am using galaxy SL which has same chipset omap 3630.

I think u guys should try this otg helper app. But for that u should have necessary usb otg modules loaded in specified folder through terminal emulator.

http://xdaforums.com/showthread.php?p=29479707

I am really interested in ur result. It will help me to implement it in our device also.
[Defy Q&A, Help & Troubleshooting] anmol7ify:
Usb otg is completely removed from froyo and gb kernels that we currently possess on our devices the usb otg feature was there in éclair deffy built,and as our boot loader is locked..we cant flash any custom kernel which is otg enabled..sadly thrs no option for us until we get our bootloaders unlocked..or some dev do some magic like HWA was enabled on locked bootloader.
[Defy Q&A, Help & Troubleshooting] vishal24387:
But I think u guys can load necessary modules externally as per my knowledge.
[Defy Q&A, Help & Troubleshooting] anmol7ify:
I don't have much knowledge about it,but i think some kind of drivers are needed in the kernels to get it working..which r not present in our kernel,i hope iam wrong..and we make it work on our devices
[Defy Q&A, Help & Troubleshooting] Boss442:
Bump... can have usb OTG with custom kernels? :fingers-crossed:
[Defy Q&A, Help & Troubleshooting] AnTerNoZ:
If Quarx integrate the modules for it yes, but that's not a Copy and past thing. Wait for the V3 QKernel, maybe he integrate the modules.

Jelly powered.Defy
[Defy Q&A, Help & Troubleshooting] tekknokrat:
Sounds like there's a chance to have usb host capabilities on defy. Is there still extra power supply neccessary? How could I get started with the qkernels?
[Defy Q&A, Help & Troubleshooting] AnTerNoZ:
AW: USB Host mode on Defy

the v3 kernel is only integrated in newest experimental nightly of CM10.1 and until now there no changes in OTG mode, u can try the jellyx kernel from Blechd0se but I don't know if the integrated drivers work correct. but yes we will ever need selfpowered devices, the defy USB port can't deliver enough voltage
[Defy Q&A, Help & Troubleshooting] cmcooper123:
I would like to know if anyone has got this going yet?
[Defy Q&A, Help & Troubleshooting] measel:
https://github.com/Quarx2k/jordan-kernel/compare/8cc622933b...b77b599d21
[Defy Q&A, Help & Troubleshooting] swapnilvernekar07:
Can't load modules :confused:
[Defy Q&A, Help & Troubleshooting] swapnilvernekar07:
Insmod command says can't load file :confused:
[Defy Q&A, Help & Troubleshooting] sevenrock:
https://github.com/Quarx2k/jordan-kernel/commit/d917f71c28717599289104bedabe742053336469#L3R1657
[Defy Q&A, Help & Troubleshooting] swapnilvernekar07:
insmod cmmand says cant open file help please :confused:
[Defy Q&A, Help & Troubleshooting] SlugZero:
It's working!

There were still some things to be fixed, but I finally managed to connect a mouse to my Defy :)

I need to clean up some things in the code and will post more on this soon.
[Defy Q&A, Help & Troubleshooting] level_666:
Amazing!! Did you need a self-powered cable or just plain OTG?
[Defy Q&A, Help & Troubleshooting] SlugZero:
USB Host Kernel for Defy

So for anyone who is keen enough to try this, here is my modified kernel with USB host support. I also compiled some of the USB storage modules into the kernel.

You have to copy the zImage to /system/bootmenu/2nd-boot/ and the android.hardware.usb.host.xml to /etc/permissions (It's not a flashable zip, sorry!) And don't forget to make a backup first:)

This is based on the AeroKernel from Quarx's latest nightlly, so it should work with the CM10.1/2 builds (tested it on CM10.2).

Please test and report any issues.

What you need:

- USB OTG cable

- Defy does not provide power via USB, you therefore need some sort of external power source for your USB device. The following should work:

- self-powered device (e.g. camera)

- hard disk with Y-cable, second end in external power source

- USB hub with external power source

What works:

- USB hub

- USB keyboard and mouse

- USB mass storage devices (with external app, I tested StickMount)

- disconnecting and reconnecting devices at the hub

- changing from client to host mode and vice versa on OTG cable connect/disconnect

Known issues/what does not work:

- first connect after boot works fine, but reconnecting the OTG cable needs a few (2-4) tries.

- sometimes after using host mode, charger or USB client connection is not detected any more

- when disconnecting a device, the driver sometimes gets stuck in a strange loop and phone must be rebooted

The USB device needs an external power source, but a simple externally powered USB hub with an OTG cable will do.
[Defy Q&A, Help & Troubleshooting] walter79:
Can you post link to your kernel source ? (GPL)
[Defy Q&A, Help & Troubleshooting] SlugZero:
Source code: https://github.com/slugzero/jordan-kernel
[Defy Q&A, Help & Troubleshooting] level_666:
But according to an old picture on [MENTION=513620]Quarx[/MENTION] site, and his explanation of that pic, defy does support output power via micro USB

Look here:

- http://quarx2k.ru/other/IMG_20120228_234016.jpg

- http://xdaforums.com/showpost.php?p=33250160&postcount=11550
[Defy Q&A, Help & Troubleshooting] SlugZero:
thx, I did not know this pic. That means that Quarx probably has an easy way to fix this as soon as he's back. :)

I tried the MUSB_FORCE_HOST thing that MAPGPS posted earlier in this thread, but it did not work for me (and it's probably not the way it is supposed to be done anyway).
[Defy Q&A, Help & Troubleshooting] StillesWasser:
I tried it and it's working as described.

Now I can finally transfer pictures of my camera to the phone on the go.

Thank you very much!
[Defy Q&A, Help & Troubleshooting] level_666:
Maybe [MENTION=232820]MAPGPS[/MENTION] could lead us on how did you draw power to device via OTG?

Enviado desde mi MB526 usando Tapatalk 4
[Defy Q&A, Help & Troubleshooting] ela1103:
iam waiting for the couple of years for our motorola defy usb otg .Thank You
[Defy Q&A, Help & Troubleshooting] SlugZero:
OTG without external power

I will not have time to work on this for the next month, so I want to share what I've got until now. I could power and mount an USB stick with the following change:

https://github.com/slugzero/jordan-kernel/commit/45e34e87e48edb47fc46a50ff761d13a51ececf1

This is very unstable, seems like power goes down again after a while. I could browse through the directories on the stick but I could not open any files any more. It also works immediately after boot only, disconnect and reconnect of devices does not work.

Since this may possibly damage your device, I recommend not testing this and also will not provide a compiled kernel until I got this working properly. Everyone who knows what he/she is doing, should be able to compile a kernel himself.

Input devices on the other hand work really nicely, see attached image:)

Btw. I am using the kernel I posted previously for more than one week now and had no issues so far, but I've got the feeling that power consumption is slightly higher. I think this is due to the changes in the musb part, I will have a look at this as soon as I am back.
[Defy Q&A, Help & Troubleshooting] ljsh093:
Hello, mester. Thx for ur kernel. Is this mouse powered by dry cell? And can support wireless mouse?

Sorry for my bad English.:(
[Defy Q&A, Help & Troubleshooting] Quarx:
[MENTION=4841764]SlugZero[/MENTION], thanks for OTG:)

I looked into it and made some fixes., reconnecting works after boot, but not always... And usb works.

If you not mind, after fully fix i can include it in cm builds.

[MENTION=5249548]ljsh093[/MENTION], wireless mouse works.
[Defy Q&A, Help & Troubleshooting] SlugZero:
[MENTION=513620]Quarx[/MENTION], it's me who has to thank you for your awesome work:)

Of course I do not mind if you merge it. And thanks for fixing it!

[MENTION=5249548]ljsh093[/MENTION], mouse is powered by phone. USB wireless mouse works, but I would recommend using a Bluetooth wireless mouse.
[Defy Q&A, Help & Troubleshooting] losh1337:
bump! How is it going? I tried latest 2nd boot CM but with USB Host Diagnostics it does not work
[Defy Q&A, Help & Troubleshooting] Milan Kerslager:
Have a look at wiki pages: http://xdaforums.com/wiki/Motorola_Defy
[Defy Q&A, Help & Troubleshooting] losh1337:
Thanks for the answer. I found nothing relevant to usb OTG or USB host, though :/
[Defy Q&A, Help & Troubleshooting] SlugZero:
New OTG Kernel

Here is a new version of the OTG kernel based on the latest AeroKernel for Android 4.2/4.3.

I integrated Quarx's fixes and made some more stability fixes which focus on not breaking existing kernel functionality. So as long as you do not connect an OTG cable, you should not notice any difference to the latest AeroKernel.

OTG Features:

Switch from regular mode to OTG mode any time by plugging/unplugging cable.

Connect devices with power consumption up to 100mA without an external power supply.

Connect devices with power consumption up to 200mA without external power supply at your own risk. They might work or might not, or they may break your device. I tried a few USB devices and my Defy is still ok, however some of the devices disconnected after some time, possibly due to voltage drop.

Connect any USB device which is supported by Android/Linux Kernel via USB hub with external power supply (might need additional Kernel modules)

Working devices: (i.e. devices I plugged in that worked)

Mouse, Keyboard

Cordless Mouse

USB Flash Drives

Camera

Joystick :)

Issues in OTG mode:

Disconnecting USB devices does not work properly. After unplugging a USB device, the next thing you connect to the USB port will not be detected (no matter if it is a charger, USB cable or USB device). You have to unplug and replug the cable at least once more (sometimes more often). Afterwards, everything works as usual.

After unplugging the USB device without removing the OTG cable, other USB devices will not be detected. Always unplug the OTG cable when changing devices

.

Please keep in mind that this feature is not officially supported by Motorola or by anyone, so if it does not work as you'd expect, chances are high that it will never work. I will not work any further on this because I ran out of ideas how to fix the remaining issues (maybe hardware related) and because it works good enough for my purposes already.

If some people here give me positive feedback that this kernel works good for them, I will ask Quarx to merge it.

Edit:

For anyone who is interested in this, I recompiled the OTG kernel with the latest (final?) changes for the 2.6.32 kernel. As development on the 2.6.32 kernel has stopped, there is no point in merging it into Quarx's repository any more. Quarx's 3.0 kernel will support OTG by default:)

Some people reported that connecting works for them only after a fresh boot. Reconnect works as described on my device (MB525 green lens), but it could be different on other devices.
[Defy Q&A, Help & Troubleshooting] hoderer:
Just what I was waiting for. THANKS ALOT, SlugZero!!!

EDIT: My USB Competition Pro does work after restarting! Played THE GREAT GIANA SISTERS with an amiga-emulator. GREAT! Plug and unplug serveral times didn't help before, had to restart.

EDIT 2: Somehow I'm not able to mount an USB-stick... the stick is recognized by "usb host controller", but not under "connected mass storange", its under "connected usb-devices" only. See the attached screenshots. Anyone successfully mounted an usb-stick? Any help is appreciated. Thanks alot!
[Defy Q&A, Help & Troubleshooting] SlugZero:
You're welcome:)

I guess your stick is drawing too much power. I did not find many devices that work with only 100mA (which is what the device appears to provide). Most report that they require at least 200mA, but some of them still worked for me.

As a general recommendation, I would try to connect a new device via externally powered USB hub first, to rule out any driver issues. When this works, try to connect it directly to the phone to see if that works, too.

If the device does not work when you connect it with a hub, enter the following in terminal before connecting, then connect your device and see if the output contains some information that is helpful for you. If not, post the last part of your kmsg.txt here:)

su
cat /proc/kmsg |tee /sdcard/kmsg.txt
[Defy Q&A, Help & Troubleshooting] supernilz:
I'm having trouble getting OTG.

Is the zip provided by slugzero a flashable zip or do I have to copy it anywhere? A short and simple step-by-step would help very much :)

Thanks alot!
[Defy Q&A, Help & Troubleshooting] hoderer:
No worries, it's flashable. Just copy the zip-file to your sd-card, boot into recovery and install the zip-file. I think the kernel-information in setttings "about the phone" won't be updated, so don't be confused about that.
[Defy Q&A, Help & Troubleshooting] hoderer:
I just got my emulation-HDD (1TB NTFS - nealy full) to work! I powered via usb on my laptop and the app "USB OTG helper" did the mounting job and opened root explorer! FANTASTIC!!! It doesn't work on the fly - I had to plug the hdd in, restart and there it was... :)
[Defy Q&A, Help & Troubleshooting] cmcooper123:
i have a problem with OTG when i plug my phone into the computer and then unplug it, it still thinks it's still plugged in (Mokee OS 4.3.1 latest build)
[Defy Q&A, Help & Troubleshooting] supernilz:
same problem here. CM 10.2 latest build

also OTG works only after reboot. Does anyone know how to fix this?