FORUMS
Remove All Ads from XDA

USB Host mode on Defy

16 posts
Thanks Meter: 17
 
By MAPGPS, Junior Member on 19th February 2011, 01:51 PM
Post Reply Email Thread
5th September 2013, 10:03 AM |#121  
level_666's Avatar
Member
Flag Medellín
Thanks Meter: 67
 
More
Quote:
Originally Posted by SlugZero

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.

Amazing!! Did you need a self-powered cable or just plain OTG?
5th September 2013, 11:01 PM |#122  
Member
Thanks Meter: 647
 
More
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


Quote:
Originally Posted by level_666

Amazing!! Did you need a self-powered cable or just plain OTG?

The USB device needs an external power source, but a simple externally powered USB hub with an OTG cable will do.
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2013-09-05-21-53-21.jpg
Views:	646
Size:	26.1 KB
ID:	2237770   Click image for larger version

Name:	Screenshot_2013-09-05-22-38-44.jpg
Views:	620
Size:	43.3 KB
ID:	2237777  
Attached Files
File Type: zip usb_host.zip - [Click for QR Code] (3.02 MB, 172 views)
The Following 27 Users Say Thank You to SlugZero For This Useful Post: [ View ] Gift SlugZero Ad-Free
5th September 2013, 11:12 PM |#123  
walter79's Avatar
Recognized Developer
Thanks Meter: 4,634
 
Donate to Me
More
Can you post link to your kernel source ? (GPL)
The Following 2 Users Say Thank You to walter79 For This Useful Post: [ View ]
5th September 2013, 11:37 PM |#124  
Member
Thanks Meter: 647
 
More
Quote:
Originally Posted by walter79

Can you post link to your kernel source ? (GPL)

Source code: https://github.com/slugzero/jordan-kernel
The Following 6 Users Say Thank You to SlugZero For This Useful Post: [ View ] Gift SlugZero Ad-Free
6th September 2013, 01:25 PM |#125  
level_666's Avatar
Member
Flag Medellín
Thanks Meter: 67
 
More
Quote:
Originally Posted by SlugZero

- 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

(...)

The USB device needs an external power source, but a simple externally powered USB hub with an OTG cable will do.

But according to an old picture on @Quarx 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://forum.xda-developers.com/show...ostcount=11550
The Following User Says Thank You to level_666 For This Useful Post: [ View ] Gift level_666 Ad-Free
6th September 2013, 05:36 PM |#126  
Member
Thanks Meter: 647
 
More
Quote:
Originally Posted by level_666

But according to an old picture on @Quarx site, and his explanation of that pic, defy does support output power via micro USB

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).
The Following 4 Users Say Thank You to SlugZero For This Useful Post: [ View ] Gift SlugZero Ad-Free
8th September 2013, 12:58 PM |#127  
Junior Member
Thanks Meter: 10
 
More
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!
The Following 2 Users Say Thank You to StillesWasser For This Useful Post: [ View ] Gift StillesWasser Ad-Free
8th September 2013, 10:35 PM |#128  
level_666's Avatar
Member
Flag Medellín
Thanks Meter: 67
 
More
Maybe @MAPGPS could lead us on how did you draw power to device via OTG?

Enviado desde mi MB526 usando Tapatalk 4
12th September 2013, 01:53 PM |#129  
Senior Member
Flag HEART
Thanks Meter: 299
 
More
Quote:
Originally Posted by SlugZero

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.



iam waiting for the couple of years for our motorola defy usb otg .Thank You
The Following User Says Thank You to ela1103 For This Useful Post: [ View ] Gift ela1103 Ad-Free
12th September 2013, 09:56 PM |#130  
Member
Thanks Meter: 647
 
More
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-k...61d13a51ececf1

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.
Attached Thumbnails
Click image for larger version

Name:	IMG_6353.jpg
Views:	318
Size:	260.5 KB
ID:	2253373  
The Following 9 Users Say Thank You to SlugZero For This Useful Post: [ View ] Gift SlugZero Ad-Free
14th September 2013, 11:04 AM |#131  
ljsh093's Avatar
Member
Flag Guiping
Thanks Meter: 12
 
More
Quote:
Originally Posted by SlugZero

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-k...61d13a51ececf1

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.

Hello, mester. Thx for ur kernel. Is this mouse powered by dry cell? And can support wireless mouse?

Sorry for my bad English.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes