simultaneous USB-OTG and charging I'm trying to charge my Nexus 7 2013 while using USB-OTG.

I built the widely described Y-cable that does USB passthrough, grounds the sense pin (yellow lead) through a 100 k resistor, and connects red and black to a charger.  Charging worked, but the tablet wouldn't recognize OTG devices.

The tablet does recognize OTG devices through a Samsung OTG adapter (EPL-AU10WEGXAR).  So I thought, hey, downstream of the adapter let's just put a USB-A male-female 4-lead extension cable, and tap into its red and black to add a charger.

But even without a charger, the extension cable breaks OTG.  Even though it works when inserted between a thumbdrive and a PC.  It's just four conductors.  The tablet should have no way of detecting it!

Works: tablet - Samsung adapter - OTG-device.

Fails: tablet - Samsung adapter - extension-cable - OTG-device.

How might I debug this, or otherwise make progress towards simultaneous OTG and charging?
There are two different questions here


  Fails: tablet - Samsung adapter - extension-cable - OTG-device..... (But) it works when inserted between a thumbdrive and a PC



Android devices  support USB host mode ( connecting a USB keyboard or mouse ) as well as USB peripheral mode ( example you can plug it into a PC, so the PC can access the phone's storage)
USB OTG cable facilitates the connected device to work in host mode
PCs always run in host mode


Source: What is the difference between USB On-The-Go (OTG) and USB Host Mode?

So when you connect using an extension cable to a PC, there is no issue in detection by PC which is always in host mode.

Now, coming to the  bit of why extension cable breaks OTG

From an electrical perspective, which is well explained here


  To avoid potential conflicts regarding which device is host and which is peripheral, the assignment of which device is A or B is determined by the orientation of the OTG cable. This cable determines whether the signaling pin of the port it is plugged into is left floating or is pulled to ground. The device with the signaling pin pulled to ground is designated the A-Device, or default host, and the device with the floating signaling pin is designated the B-Device, or default peripheral. 


By adding a USB-A male-female 4-lead extension cable to the OTG cable, you are not extending this port detection mechanism to the other end. Hence it fails detect connected device

Ii is better to shop for a longer 3 metre OTG cable instead of attempting to increase the length as experimented


  Charging worked, but the tablet wouldn't recognize OTG devices


As explained in Powering a Nexus 7 tablet through the USB port while simultaneously connecting a USB device :


  .... While you can purchase various kind of “OTG” Y-cables, which purportedly will allow you to use an external device (or even connect to a USB hub so you can use multiple devices) while at the same time allowing a charger/power supply to be connected, this doesn’t work with a stock Nexus 7.


(Emphasis supplied)

This is a kernel limitation and you can override that by  rooting and flashing a custom kernel as explained in the linked article



Additional reading:


USB on the go standards
From SE Electronics: Can an Android tablet serve as USB Host and be charged simultaneously through a single port?