[how to] usb otg + charging

Search This thread

FuzzyMeep Two

Senior Member
Feb 21, 2012
119
318
Southern NH
EDIT!! MADE APK USING TASKER TO WRITE TO FILE FOR YOU. CAN TURN OTG CHARGE ON AND OFF.
APK HERE root required

I was trying for a while to set up my Nexus 7 to charge while using an OTG device. This is what worked for me.

HARDWARE
I made the cable entirely.

I used two USB male ends, a female-to-female USB mating adapter and one micro USB male end.

I converted the micro usb into an OTG enabled micro usb using the instructions below.
http://tech.firstpost.com/news-analysis/how-to-make-your-own-usb-otg-cable-for-an-android-smartphone-29503.html

I used shrink-wrap to permanently affix a female-to-female adaptor to one of the usb male ends, making it female.

So I ended up with a regular male plug "POWER" plug a female outlet "OTG PLUG" and a "MICRO USB" end, which plugs in to the tablet
You could use a Y adapter and an OTG cable. You would need to cut a couple wires inside

I don’t feel like writing up a step by step, so in the simplest terms, You take an OTG cable, and splice in the POWER (BLACK, and RED) wires. You leave the data, and shield wires disconnected.

SPLICE WIRES AS FOLLOWS;
MICRO_USB_->___OTG_PLUG_END->POWER_END
RED________->RED______________->RED
BLACK______->BLACK____________->BLACK
WHITE______->WHITE____________->DISCONNECTED
GREEN______->GREEN___________->DISCONNECTED
UNSHIELDED_->UNSHIELDED______->DISCONNECTED




Software
I am using a custom 4.4 rom (I do not believe this is necessary)
I am using M-Kernel a69 (I do not know if this is necessary either)

Using ES File Explorer, with "root Explorer" set to "YES" navigate to "sys/module/tegra_otg/parameters"
Find the file "tegra_otg_on_charging"
Open it using your preferred text editor, or use the built in one provided by ES File Explorer
Change the "N" to a "Y"
Save the file, (It will not save correctly if you did not turn on "root explorer" option in ES File Explorer)
Now it works for me, the OTG device will be powered by the charger, not tablet.

I have to plug the OTG device, and power in first, then hook it up to the tablet.

Sorry for the sloppy write up, usually I am very detailed and thorough... I am just not in the mood today. Maybe I will come back later, after working with this for a but with updates, and a more thorough write up.
 

Attachments

  • OTG_Charge_For_TEGRA.5.apk
    1 MB · Views: 2,146
Last edited:

Old Guy

Member
Dec 22, 2012
43
8
I was trying for a while to set up my Nexus 7 to charge while using an OTG device. This is what worked for me.

HARDWARE
I made the cable entirely.

I used two USB male ends, a female-to-female USB mating adapter and one micro USB male end.

I converted the micro usb into an OTG enabled micro usb using the instructions below.
http://tech.firstpost.com/news-analysis/how-to-make-your-own-usb-otg-cable-for-an-android-smartphone-29503.html

I used shrink-wrap to permanently affix a female-to-female adaptor to one of the usb male ends, making it female.

So I ended up with a regular male plug "POWER" plug a female outlet "OTG PLUG" and a "MICRO USB" end, which plugs in to the tablet
You could use a Y adapter and an OTG cable. You would need to cut a couple wires inside

I don’t feel like writing up a step by step, so in the simplest terms, You take an OTG cable, and splice in the POWER (BLACK, and RED) wires. You leave the data, and shield wires disconnected.

SPLICE WIRES AS FOLLOWS;
MICRO_USB_->___OTG_PLUG_END->POWER_END
RED________->RED______________->RED
BLACK______->BLACK____________->BLACK
WHITE______->WHITE____________->DISCONNECTED
GREEN______->GREEN___________->DISCONNECTED
UNSHIELDED_->UNSHIELDED______->DISCONNECTED




Software
I am using a custom 4.4 rom (I do not believe this is necessary)
I am using M-Kernel a69 (I do not know if this is necessary either)

Using ES File Explorer, with "root Explorer" set to "YES" navigate to "sys/module/tegra_otg/parameters"
Find the file "tegra_otg_on_charging"
Open it using your preferred text editor, or use the built in one provided by ES File Explorer
Change the "N" to a "Y"
Save the file, (It will not save correctly if you did not turn on "root explorer" option in ES File Explorer)
Now it works for me, the OTG device will be powered by the charger, not tablet.

I have to plug the OTG device, and power in first, then hook it up to the tablet.

Sorry for the sloppy write up, usually I am very detailed and thorough... I am just not in the mood today. Maybe I will come back later, after working with this for a but with updates, and a more thorough write up.





I would like to try this, but I have no file tegra_otg/parameters in the sys/module folder. I used ES file explorer and have root explorer turned on.
I am on kitkat 4.4 rooted. Any idea?
 

FuzzyMeep Two

Senior Member
Feb 21, 2012
119
318
Southern NH
I would like to try this, but I have no file tegra_otg/parameters in the sys/module folder. I used ES file explorer and have root explorer turned on.
I am on kitkat 4.4 rooted. Any idea?

Try installing m kernel.

The file may have been created by an app I tried beforehand. You could try making the folders and file, and see if that does anything.

This is still preliminary right now, and has a few bugs. One big one is, the file resets on reboot. Another is that if I unplug my USB mouse, while leaving the otg plugged in to the wall and tablet, then replug it in quickly, the tablet will freeze and reboot.

I am working on a tasked script to prompt you for otg or otg charge when you plug the cable in right now.
 

FuzzyMeep Two

Senior Member
Feb 21, 2012
119
318
Southern NH
update

Update.

So I have learned a few things

1. If you plug in a device in regular otg mode it will stay in that mode until you reboot.
2. You need to switch to otg plus charge before plugging in your tablet
3. If you remove the device while the tablet is still plugged in and power is provided, then replug the device the tablet will some times freeze.
4. If you hold the . button on the soft keyboard the tablet it writes "…" (not relevant, but I didn't know that)
5. You can switch from charge plus otg to regular otg, but need to reboot to switch back.
6. It only charges at about 2/3 regular speed, so depending on what you're doing your battery may still drain, but slower than it would otherwise.
7. You can plug in the device to power first then plug in the tablet BUT!!!! if this is not working,plug the device in,then the tablet, then connect power.


So, I made a tasker script to prompt me for regular or otg plus charge when the device boots. You pick the option you want then plug in atccordingly.

This still needs work, but I will keep at it, and hopefully some of you will help as well.
 
Last edited:

Old Guy

Member
Dec 22, 2012
43
8
made an apk to write to the file for you.. needs superuser


Thanks for writing the apk. Think I will wait until you get the bugs worked out in your script.
Looking forward to progress on this .
One question, when you say it is rewriting the file on reboot. is it just changing the Y back to N?

Thanks again
Dennis
 
Last edited:

FuzzyMeep Two

Senior Member
Feb 21, 2012
119
318
Southern NH
Update.

just a quick update. Some USB devices will activate OTG charge, while others will not. Every mouse i have tried does, but some others, like thumb drives do not. I am pretty sure this has to do with the resistance between the data lines upon connecting the device, but am not positive.

Also, on occasion, when unpluggung, replugging, and playing with the OTG charge on/off, my device will reboot.
 

ramon.hugo

Member
Apr 15, 2015
9
1
40
Florianópolis
Nexus 7 2013 OTG and charging at the same time

I have a Nexus 7 2013 rooted, default kernel, and I wanted to charge and use the mouse and keyboard - and other stuff - all at the same time.

I've tried a lot of things, ****ed up my Nexus a few times, and then the great discovery: I use a multi-reader and lots of stuff plugged into a usb-hub and the Nexus just charges.

I use it as my computer. The thing is, it does not say its charging, but just charges.
Then you just plug a wireless Miracast and you have a full computer.

To be clear, it charges while been used, I keep using it, and stays at 100% of battery.
I used it with external HDs plugged in.

Soon I will post exactly the equipment I'm using.
 

Old Guy

Member
Dec 22, 2012
43
8
Is this for a 2012 or a 2013 model? If it will work on a 2012, great, if not you should be posting in the 2013 forum.
Also no need to double post.
 

Kalimazoo

Member
Dec 21, 2010
11
1
I have a 2012 Nexus 7 wifi I am trying to install in my car. The problem is if power gets disconnected to the OTG it will not charge again until I reconnect the OTG cable. I wanted to only have the charging powered when the keys are in the ignition. The other USB devices do work regardless of power if they are plugged into the powered USB hub.

I tried the .apk file from the first post and it does not work. Is there something else I am missing to get OTG to reconnect for charging without having to plug the cable in again?
 

Jooroth18

New member
Jun 13, 2016
2
0
Hi, I have a Galaxy Tab 4 8.0 that im trying to get this to work on. I followed your guide, and for me I found it to be in /sys/module/msm_otg/parameters/floated_charger_enable. I edited it to say Yes, and now am able to charge the tablet over an OTG cable. However, while I can charge, the USB DATA doesnt work, any peripheral i try fails to work. If there is no power and I hook up a device it works. If I hook up both it either will charge or recognize the device, its random. Is there anything else I can possibly edit in the root browser that can force it to accept a charge and allow for data communication over otg?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    EDIT!! MADE APK USING TASKER TO WRITE TO FILE FOR YOU. CAN TURN OTG CHARGE ON AND OFF.
    APK HERE root required

    I was trying for a while to set up my Nexus 7 to charge while using an OTG device. This is what worked for me.

    HARDWARE
    I made the cable entirely.

    I used two USB male ends, a female-to-female USB mating adapter and one micro USB male end.

    I converted the micro usb into an OTG enabled micro usb using the instructions below.
    http://tech.firstpost.com/news-analysis/how-to-make-your-own-usb-otg-cable-for-an-android-smartphone-29503.html

    I used shrink-wrap to permanently affix a female-to-female adaptor to one of the usb male ends, making it female.

    So I ended up with a regular male plug "POWER" plug a female outlet "OTG PLUG" and a "MICRO USB" end, which plugs in to the tablet
    You could use a Y adapter and an OTG cable. You would need to cut a couple wires inside

    I don’t feel like writing up a step by step, so in the simplest terms, You take an OTG cable, and splice in the POWER (BLACK, and RED) wires. You leave the data, and shield wires disconnected.

    SPLICE WIRES AS FOLLOWS;
    MICRO_USB_->___OTG_PLUG_END->POWER_END
    RED________->RED______________->RED
    BLACK______->BLACK____________->BLACK
    WHITE______->WHITE____________->DISCONNECTED
    GREEN______->GREEN___________->DISCONNECTED
    UNSHIELDED_->UNSHIELDED______->DISCONNECTED




    Software
    I am using a custom 4.4 rom (I do not believe this is necessary)
    I am using M-Kernel a69 (I do not know if this is necessary either)

    Using ES File Explorer, with "root Explorer" set to "YES" navigate to "sys/module/tegra_otg/parameters"
    Find the file "tegra_otg_on_charging"
    Open it using your preferred text editor, or use the built in one provided by ES File Explorer
    Change the "N" to a "Y"
    Save the file, (It will not save correctly if you did not turn on "root explorer" option in ES File Explorer)
    Now it works for me, the OTG device will be powered by the charger, not tablet.

    I have to plug the OTG device, and power in first, then hook it up to the tablet.

    Sorry for the sloppy write up, usually I am very detailed and thorough... I am just not in the mood today. Maybe I will come back later, after working with this for a but with updates, and a more thorough write up.