←back to thread

USB On-The-Go

(computer.rip)
208 points jnord | 3 comments | | HN request time: 0s | source
Show context
MarkusWandel ◴[] No.42623539[source]
USB-C has obfuscated things but I was hoping the following would work:

Buy a Y-cable from Ali Express that has USB-C male to plug into the phone, and both USB-C female and USB-A female sockets. Plug keyboard into the USB-A and the charger into USB-C.

But it doesn't work, and I suspect it's a software limitation at least on my phone (Moto G Play 2023). If the charger is plugged in first, the phone will charge but not use the keyboard. If the keyboard is plugged in first, the phone will use it, but not charge. I think the wires are there to make it all work, but the phone's OS just doesn't support this scenario. Pity.

Needless to say documentation is nonexistent so I don't actually know what's in the cable. For all I know, the two female sockets are just connected in parallel.

replies(4): >>42623759 #>>42623866 #>>42624960 #>>42629514 #
bluGill ◴[] No.42623866[source]
USB-C never defined a Y cable and so they never figured out how that would work. If such a cable works anywhere it is either luck, or there is some chip inside that checks for power messages from either end but otherwise looks like a straight through cable. Even then it will be tricky because if the two devices want different voltages from the charger only one can get their way.

I can't blame the USB-C people for not working on this case. It is a lot harder than it seems to make work, and of limited use. Just get a USB-C hub if you need this ability.

replies(2): >>42624065 #>>42624228 #
MarkusWandel ◴[] No.42624065[source]
Heh, if you want a really atrocious USB power violation... Costco sold some extremely bright flashlights (think car headlight bright, and also usable as a self-defense weapon in the spirit of the old D-cell Maglites) before Christmas, that have an USB charge socket. Needless to say they include a charge cable but no charger.

But this thing wants 1.5A at 5V. And doesn't do any power "negotiation" at all, as far as I can see. It happens to work because modern smartphone chargers can do 5V at 2A by default. But plug it into any older charger and the charger immediately shuts down due to overcurrent.

I have one of those USB passthrough voltage/current meter gadgets. Yes, it draws 1.5A. I guess what it should be doing is slow-charge unless it can negotiate for more power. It's a very decent flashlight otherwise.

Oh, it also has two USB-C sockets. A red one for charging, and a black one for using the flashlight's substantial battery as a power bank. I don't know what would happen if you plugged the charger into the wrong socket and don't have the courage to try.

replies(2): >>42624559 #>>42630306 #
nfriedly ◴[] No.42624559[source]
> Oh, it also has two USB-C sockets. A red one for charging, and a black one for using the flashlight's substantial battery as a power bank. I don't know what would happen if you plugged the charger into the wrong socket and don't have the courage to try.

USB-C does a bit of negation before putting our any significant amount of power. There's a "dumb mode" that just uses a pair of half-cent resistors and is fine for up to 3A at 5V, and then the "smart" PD (Power Delivery) mode that does a digital negotiation and can do much higher wattage.

All that is to say that if you plugged the black USB-C into a charging brick it'd probably just fail the negotiation and nothing bad would happen. Both sides would have to be violating the spec for it to be a real hazard.

Annoyingly, some really cheap devices skip out on even the dumb mode resistors to save a penny, and so even though they have USB-C ports, you have to charge them with USB-A to USB-C cables (because USB-A ports always provide power, no negotiation required.)

Those devices are where the cheap Y-cables come in handy, because they usually include the required resistors + give you a USB-A port.

replies(2): >>42625058 #>>42626902 #
1. MarkusWandel ◴[] No.42626902[source]
The flashlight comes with an USB A->C charging cable, as do the (low end) smartphones we have (along with USB-A power adapter for the phones). Thus probably no PD negotiation. Right?
replies(2): >>42627013 #>>42627272 #
2. nfriedly ◴[] No.42627013[source]
Aah, yes, the USB-A side always provides power, no negotiation needed for that aspect. There is still supposed to be some level of negotiation before drawing that much current (often just checking resistance, similar to the USB-C "dumb" mode), but obviously the device skipped that also.
3. ianburrell ◴[] No.42627272[source]
A lot of flashlights and cheap gadgets have USB-C port but can only charge from USB-A port. The reason is that they cheaped out on including the resistors that signal legacy USB mode. The USB-C to USB-A cable has the resistors.

The smartphones should have proper USB-C port, I haven't heard of one with charging problems, and included USB-A cable cause cheap.