5,606,530 Members 34,221 Now Online
XDA Developers Android and Mobile Development Forum

OTG + charge project. Charge phone while using FLASH DRIVE

Tip us?
 
DoesntPostAThing
Old
#241  
DoesntPostAThing's Avatar
Senior Member
Thanks Meter 1436
Posts: 1,977
Join Date: Nov 2012
Location: Vancouver
Quote:
Originally Posted by ghostofbunuel View Post
I can comfirm that it works with the dummy kernel just great but only flash drives and a usb sd card reader that I tried. I couldn't get the external hdd to mount - it just kept trying to mount over and over every few seconds but never worked. Maybe it needs more power though one is an enclosed ssd. It charges and reads files great though. I'll try.a powered USB hdd this weekend and see if that's the issue. Still you could always get a 128gb flash drive or sd card if needed.
Awesome, I just ordered this. Hopefully it arrives soon. I need it to listen to music on my upcoming flight from Canada to China this summer. Would've brought my skyrocket because I can charge and listen at the same time, but my GNex is unlocked so cheaper calling in China
Check out my apps:

All apps


Pedometer: (FREE | PRO | XDA)


Owner of a 32GB black Nexus 5 running ParanoidAndroid with ElementalX kernel
 
teq1lla
Old
#242  
teq1lla's Avatar
Junior Member
Thanks Meter 0
Posts: 2
Join Date: Jan 2013
Location: Moscow
Default Re: OTG + charge project. Charge phone while using FLASH DRIVE

Quote:
Originally Posted by highvista View Post
That's the right one for your phone, so no problem there. Is anyone else seeing a problem with this version of the phone and boot image?
Yeah, i have the same pro problem.
Com.android.phone error on boot.

Gnex Gsm cyanogenmod 10.1
 
pedrolane31
Old
(Last edited by pedrolane31; 18th February 2013 at 10:01 PM.)
#243  
Junior Member
Thanks Meter 2
Posts: 2
Join Date: Feb 2013
Thank you Rotary Heart for this project ! It worked perfectly on my stock nexus 4.2.1

I switched recently on 4.2.2 and tried to build a boot.img on my own, without any success (my phone is stuck at the boot, it displays the Google logo and nothing more).

Here are the steps I followed to make the boot.img :

Code:
#git clone https://android.googlesource.com/device/ti/tuna
#cd tuna
#git log -1 kernel
commit 3b26b79f592df5a739c1259c82b17f031526cfa9
Author: Todd Poynor <toddpoynor@google.com>
Date:   Fri Nov 2 11:20:49 2012 -0700

    tuna: prebuilt kernel (wifi wakelock revert, uname security fix)
    
    d5a18e0 Revert "net: wireless: bcmdhd: Fix WD wakelock behavior"
    0eaeacc use clamp_t in UNAME26 fix
    4c15176 kernel/sys.c: fix stack memory content leak via UNAME26
    
    Bug: 7459403, 7448654
    Change-Id: I166daa13cfef2fec17385bac71d768a2726c7e59
#cd ..
#git clone https://android.googlesource.com/kernel/omap.git
#cd omap
#git checkout d5a18e0
#cp ../board-tuna-connector.c arch/arm/mach-omap2/board-tuna-connector.c
#cp ../fsa9480.c drivers/misc/fsa9480.c
#export ARCH=arm
#export SUBARCH=arm
#export CROSS_COMPILE=arm-eabi-
#make clean
#make tuna_defconfig
#make
#fastboot flash zimage arch/arm/boot/zImage

The flashing process went good but... the phone remains stuck...
Am I wrong ?


I also tried to build a boot.img from the boot.img of the google factory image (4.2.2) with no success...

Code:
#./unpackbootimg -i boot.img     /////the boot.img is the one from the factory image
#BASE=$(cat boot.img-base)
#PAGESIZE=$(cat boot.img-pagesize)
#CMDLINE=$(cat boot.img-cmdline)

#./mkbootimg --kernel ../omap/arch/arm/boot/zImage --ramdisk boot.img-ramdisk.gz --cmdline "$CMDLINE" --base $BASE --pagesize $PAGESIZE -o boot_patched.img
#sudo fastboot flash boot boot_patched.img

Can you tell me the right procedure or build a boot.img base on the google stock image 4.2.2 ?

Thank you very much
The Following User Says Thank You to pedrolane31 For This Useful Post: [ Click to Expand ]
 
pedrolane31
Old
#244  
Junior Member
Thanks Meter 2
Posts: 2
Join Date: Feb 2013
Default levedish was

Quote:
Originally Posted by pedrolane31 View Post
Thank you Rotary Heart for this project ! It worked perfectly on my stock nexus 4.2.1

I switched recently on 4.2.2 and tried to build a boot.img on my own, without any success (my phone is stuck at the boot, it displays the Google logo and nothing more).

Here are the steps I followed to make the boot.img :

Code:
#git clone https://android.googlesource.com/device/ti/tuna
#cd tuna
#git log -1 kernel
commit 3b26b79f592df5a739c1259c82b17f031526cfa9
Author: Todd Poynor <toddpoynor@google.com>
Date:   Fri Nov 2 11:20:49 2012 -0700

    tuna: prebuilt kernel (wifi wakelock revert, uname security fix)
    
    d5a18e0 Revert "net: wireless: bcmdhd: Fix WD wakelock behavior"
    0eaeacc use clamp_t in UNAME26 fix
    4c15176 kernel/sys.c: fix stack memory content leak via UNAME26
    
    Bug: 7459403, 7448654
    Change-Id: I166daa13cfef2fec17385bac71d768a2726c7e59
#cd ..
#git clone https://android.googlesource.com/kernel/omap.git
#cd omap
#git checkout d5a18e0
#cp ../board-tuna-connector.c arch/arm/mach-omap2/board-tuna-connector.c
#cp ../fsa9480.c drivers/misc/fsa9480.c
#export ARCH=arm
#export SUBARCH=arm
#export CROSS_COMPILE=arm-eabi-
#make clean
#make tuna_defconfig
#make
#fastboot flash zimage arch/arm/boot/zImage

The flashing process went good but... the phone remains stuck...
Am I wrong ?


I also tried to build a boot.img from the boot.img of the google factory image (4.2.2) with no success...

Code:
#./unpackbootimg -i boot.img     /////the boot.img is the one from the factory image
#BASE=$(cat boot.img-base)
#PAGESIZE=$(cat boot.img-pagesize)
#CMDLINE=$(cat boot.img-cmdline)

#./mkbootimg --kernel ../omap/arch/arm/boot/zImage --ramdisk boot.img-ramdisk.gz --cmdline "$CMDLINE" --base $BASE --pagesize $PAGESIZE -o boot_patched.img
#sudo fastboot flash boot boot_patched.img

Can you tell me the right procedure or build a boot.img base on the google stock image 4.2.2 ?

Thank you very much
Ok, I found how to make it work !!!

I replaced
Code:
git checkout d5a18e0
by
Code:
git checkout 9f818de
9f818de is the most recent commit found here : android.googlesource.com kernel omap +log android-omap-tuna-3.0-jb-mr1.1

Then I flashed my zImage and my phone boots !

In attacment, I give you the zImage compiled for android 4.2.2 stock
Attached Files
File Type: zip zImage.zip - [Click for QR Code] (3.97 MB, 11 views)
The Following User Says Thank You to pedrolane31 For This Useful Post: [ Click to Expand ]
 
tigrone
Old
#245  
Junior Member
Thanks Meter 1
Posts: 16
Join Date: Jun 2011
Quote:
Originally Posted by highvista View Post
I've figured out how to get the phone to recognize when power is detached from the USB OTG y-cable. As an added bonus, after power is removed, the phone will switch modes and take over for powering the attached USB device. If external power is re-attached, on the other hand, the phone will continue to power the device and not switch back to taking power from the charger. This makes sense from the details of how the USB VBUS is monitored. The USB controller sees power going away from the VBUS when external power is removed and can change modes. But once the phone is doing the powering, there is no change on the VBUS when external power is re-attached, so the phone doesn't know that it can start accepting power from the external charger.

I'd like to have some others test the new kernel before updating the OP ZIP archives. I'm attaching boot images with the new kernel for both US GSM (takju) and Verizon CDMA (mysid) Galaxy Nexus phones. Please give these a try and let me know how it goes. In particular, if you use a USB hub, I'd like to confirm this works as expected, since I've only tested using the USB OTG y-cable. Thanks!

12/27/12:

The boot image for Verizon phones that I uploaded here previously was giving people problems. I've replaced that file with another that should resolve any problems. Also note that these images were built against 4.1.2 kernel source and are for testing purposes only. As soon as some folks have tested these, I'll post ZIP archives with the boot images, source code, and notes on the kernel mod.

Hi there, I was wondering I have been implementing your patch #3 (as can be found at your github https://github.com/caioketo/journeymanmod) in my own kernel, and what I did notice on my GNex was the following :
- now the device actually charges when connected via a OTG y-cable ! Which is great, because it wasn't charging before the patch ! I was wondering though the attached devices where do they get their power supply from ? From the device or directly from the via OTG attached power supply ?
- unfortunately a device which was working just fine before the patch ( a usb hub with integrated network controller) simply does not "power on" anymore ! The usb ports actually work (tried those with a 4GB usb key) but the networking part of the hub does not. Any idea what this could be ? Isn't there enough power ?

Thanks in advance for any help you can provide !
 
highvista
Old
#246  
highvista's Avatar
Senior Member
Thanks Meter 51
Posts: 208
Join Date: Jul 2009
Location: Eugene, OR
I'm still running Android 4.1.2 on my Galaxy Nexus, but I will build kernels for 4.2.2 that Rotary Heart can post in the OP in the near future...hopefully either this or next weekend.
Phone: Samsung Galaxy S4 Google Play Edition (GT-I9505G)
Cell Network: T-Mobile
ROM: Android 4.4.2 KOT49H.S001.131204 (Stock)
Kernel: 3.4.0-2270815 (Stock)
Root: Yes, via Unlocked Bootloader and SuperSU-v1.80
Radio: I9505GUEUCML4 (Stock)
Recovery: TWRP 2.6.3.0
 
Rotary Heart
Old
#247  
Rotary Heart's Avatar
Senior Member - OP
Thanks Meter 606
Posts: 1,109
Join Date: Aug 2012

 
DONATE TO ME
Quote:
Originally Posted by highvista View Post
I'm still running Android 4.1.2 on my Galaxy Nexus, but I will build kernels for 4.2.2 that Rotary Heart can post in the OP in the near future...hopefully either this or next weekend.
Just let me know and I will upload them
Checkout my apps >>> Play Store <<< >>> Slide Me Market <<<
Ubuntu Lockscreen | PC System Monitor | SU Root Tools | CM10 DCB Theme | Every BIOS | Hangup Preventer | Text Modifier | G-Force Meter | RH File Manager


 
tigrone
Old
#248  
Junior Member
Thanks Meter 1
Posts: 16
Join Date: Jun 2011
any change you guys know if beacuse the device is loading itself after applying patch #3 it cannot supply enough to external devices (like an external 2.5 inch USB harddisk) ? And because of the fact it's connected through a OTG Y-cable shouldn the HD be powered from the charger itself ?
 
aadiflesher
Old
#249  
aadiflesher's Avatar
Senior Member
Thanks Meter 291
Posts: 924
Join Date: Sep 2012

 
DONATE TO ME
Hello!
I want the same thing, use a mouse, keyboard, HDD or USB stick and still be able to charge my phone. So I made an OTG cable. (see attached images)
And it works, I am able to connect a USB stick and charge my phone at the same time.
I am also using this ROM

If you want to try it, tell me if it works for you too.

Thanks!


If you want to make the cable yourself you must see image no2. Remember to make the connection between pin no5 GND and no4.
Attached Thumbnails
Click image for larger version

Name:	OTGcable.jpg
Views:	87
Size:	9.1 KB
ID:	1762909   Click image for larger version

Name:	difference.jpg
Views:	86
Size:	21.9 KB
ID:	1762950  
 
Rotary Heart
Old
#250  
Rotary Heart's Avatar
Senior Member - OP
Thanks Meter 606
Posts: 1,109
Join Date: Aug 2012

 
DONATE TO ME
Quote:
Originally Posted by aadiflesher View Post
Hello!
I want the same thing, use a mouse, keyboard, HDD or USB stick and still be able to charge my phone. So I made an OTG cable. (see attached images)
And it works, I am able to connect a USB stick and charge my phone at the same time.
I am also using this ROM

If you want to try it, tell me if it works for you too.

Thanks!


If you want to make the cable yourself you must see image no2. Remember to make the connection between pin no5 GND and no4.
And it worked eithout the mod? Also what device you have? Kernel? That may help a little.
Checkout my apps >>> Play Store <<< >>> Slide Me Market <<<
Ubuntu Lockscreen | PC System Monitor | SU Root Tools | CM10 DCB Theme | Every BIOS | Hangup Preventer | Text Modifier | G-Force Meter | RH File Manager



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes