11 ms·
USB On-The-Go
- hank808 2y ago[flagged]
- lebotte 2y ago[flagged]
- crote 2y ago> Application notes from several USB controller vendors explain that, oddly enough, the only way to perform role reversal with USB-C is to implement USB Power Delivery (PD) and use the PD negotiation protocol to change the source of power. In other words, while OTG allows reversing host and device roles independently of the bus power source, USB-C does not. The end supplying power is always the host end. This isn't true. USB PD has both "data role swap" and "power role swap" commands, and they are independent from each other. It even allows for things like a "fast role swap", where you can unplug the power source from a dock (so power now has to flow from laptop to dock, instead of dock to laptop) without any interruption of the data connection.
- stephen_g 2y agoYes, the article kind of describes the default behaviour, but after the initial source/sink selection one end or the other can then independently request power role swaps and data role swaps, which the other end can either accept or reject. For example if you ask a USB-C power brick to let you swap to providing it power, it will reject that. Then some devices (like phones, tablets etc.) will only accept power when they're switched off, but will do either when they’re on. But some will happily let you switch to device mode and be a sink when they’re off, until the battery gets below a certain level and then they’ll only accept you providing it power. It all gets quite complex! The company I work for makes devices that are always in device mode (called upstream facing port or UFP mode) but can provide power when they are plugged in themselves, so have to swap between source and sink. I’ve spent far too long debugging firmware issues with PD controllers because of this!
- nfriedly 2y agoThat reminds me of a while back, my phone battery was getting really low, like 1%. I grabbed a power bank and connected it, USB-C to USB-C, and for whatever reason, the two devices decided that the phone should be charging the power bank instead of vice-versa. Then the phone died a few seconds later. (Then the powerbank started charging the phone!)
- smallmancontrov 2y agoWith apologies to stephen_g, who I'm sure writes excellent firmware, this is the quality of decision making I would expect from median firmware.
- oez 2y agoAren't you agreeing with TFA then?
- dec0dedab0de 2y agoIt sounds like you’re talking about protocol, and the article is talking about implementations.
- danhor 2y agoEvery USB-C docking station that exposes USB ports while also supplying the attached computer with power uses this feature, letting the computer act as a host and the docking station as the power source
- majormajor 2y agoMy impression from the article is that what you're saying is in line with it: if you implement PD, you can do either. It sounded like the line you quote was expressing suprise that baseline USB power supply in USB-C - without implementing PD - can't do that. But apparently could with older USB OTG.
- Dylan16807 2y agoOh, I guess I understand now. When the article said "USB-C does not allow this", it actually meant "USB-C without PD does not allow this". And "always" in that specific paragraph also meant "without PD".
- pseudosavant 2y agoYes, my Surface USB-C dock does switch so fast that if I want to power cycle it, I have to remember to unplug it from my laptop and the wall.
- KingOfCoders 2y ago"this was referred to as a null modem cable" I remember using one to play Fire Power on the Amiga, my first network game.
- thomas-st 2y agoI have a power bank that is PD capable, but I cannot charge it from my MacBook even if the MacBook is plugged in to power. I get around it by using a USB-C/A dongle and corresponding USB-C/A cable. Presumably this "downgrades" the connection and since the MacBook doesn't support traditional USB charging it has to charge the power bank. Does USB-C not have a way to indicate that a potential power source is a battery so that the MacBook can charge it if it's plugged in to power, and reverse roles otherwise? Is this a fault how the power bank or macOS implements power negotiation, or is this scenario simply unaddressed in USB-C? Funny enough, if I plug the USB-C/A dongle on the end of the power bank and the cable into the MacBook, it also won't charge. I also have a Philips One toothbrush with a USB-C charging input. Similarly, I can't charge it with a USB-C cable directly from my MacBook but have to use A in between (I unsuccessfully tried using either a thinner "lower speed" or a thicker "higher speed" USB-C cable). I'm assuming the toothbrush doesn't support PD, so then why can't it fall back to traditional charging with a C-to-C cable?
- KeplerBoy 2y agoBy converting to USB A you cut out USB-PD completely from the equation. At that point the macbook simply provides 5V as it would to any legacy downstream device.
- Piskvorrr 2y agoIt's even simpler, I think: you're forcing it to avoid a PD negotiation, and fall back to the lowest common denominator, "500 mA on the PWR line supplied to the USB device". This goes, I believe, as far back as USB 1.1, as a slow-but-generally-safe power source for things that are barely more than "use USB PWR and GND as a dumb 5V source." A C-to-C cable, OTOH, doesn't have this requirement, and if there's no PD negotiation, the MacBook is not required to provide power IIRC.
- kevin_thibedeau 2y agoUSB 3 bumped non-negotiated current up to 900 mA. You should be getting that on any standard compliant USB-C port with SuperSpeed implemented.
- MarkusWandel 2y agoUSB-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.
- nucleardog 2y agoMy wild guess would be that, yes, that cable is just a naive splitter. The only real use case I could think of that would work would be taking a USB-C port and making it accept either USB-C or USB-A devices without having to dig around/swap adapters/etc. I say that because as far as I'm aware (though I'm having trouble digging up an authoritative source right now), there's no way for USB devices to share data lines. Even cheap "passive" hubs and things all have ICs to present themselves as a USB device and sit between the host and the downstream devices. With the older USB specs you could still get some power even without the data lines, but with USB-C you need the data lines to negotiate power delivery. I don't think there are any software-level changes would make that setup work. If you are looking for a solution though (albiet a bit bit bulkier one) it's likely any of a number of "USB C hub" or "USB C dock" products would work there. Most have a USB-C port marked "PD-IN". Plug the hub into your phone, plug your power into the PD-IN, and use the USB-A/other ports to connect your other devices. Run you like $20 from the usual suspects.
- MarkusWandel 2y agoThanks for that. The longer-term goal is to make a "dock" for my elderly mom's phone that lets her use it as a tiny (her eyes are still good) pseudo-desktop setup with keyboard and mouse. She often ends up with her phone as her only communications device when things go wrong (again) on her laptop and this would give a good email experience (she's a skilled touch-typist). Any pointers to a cheap USB-C dock on Ali that does the job? Sadly, one limitation, at least on the Android device, is that you can't use it in landscape mode with a mouse. Well, you can, but the launcher only operates in portrait mode, as do a lot of apps. I don't want to change the launcher - elderly folks get very fixated on how their device is supposed to work. Anyway as soon as the phone switches to sideways-portrait mode, the mouse also does which is very disorienting.
- CableNinja 2y agoThis article, and all comments, have reminded me yet again of my anger at the not so universal USB formats. I had been designing a device that heavily relied on USB, as its primary goal was to be basically a USB switching station, where you plug your systems and USB into the device and then can swap around which USB is connected to any of the connected systems. I started during the early USB3x days, and by the time i had a completed design, had to rip out and redo large chunks because the damn USB spec changed with all their 3.x super premium plus ultra speed bullshit. And then... fucking USB c. yes, you dont have to figure out which way the cable goes now, but hardware designers are suffering because of the shenanigans that is USB. My entire project was effectively scrapped because i didnt want to deal with the power draw bullshittery. Before PD it was easy enough for me to manage the power, but now, i need a whole load of supporting circuitry and have to touch datalines which my original goal was to avoid. In short, i hate USB and its gone the way of the SCSI cable; getting more and more weird every year
- TheAmazingRace 2y agoHonestly, SCSI was more straightforward than the quagmire that is current USB standards, especially over Type-C. I can't trust the quality of cables or what they are capable of on the surface. I really need to do my homework to ensure I get the right transfer speeds and power delivery. Once I was charging my SteamDeck using a cable I thought was quality, and the darn connector bit felt alarmingly hot to the touch. Turns out the cable wasn't certified for PD applications and was better for 5V @ 4.5W...
- Tharre 2y agoJust to avoid confusion, there is no such thing as a "PD certified" usb-c cable. All usb-c cables, by any version of the standard, have to safely support at least 3 amps at 20V. And for 5 amps they have to contain an active marker chip that's involved in the PD negotiation. Any cable not fulfilling these requirements isn't allowed to called a usb-c cable, though I'm sure certain foreign manufacturers don't care.
- 2y ago
- bloopernova 2y agoSomewhat related: For USB C cables, get a CaberQU pin/line checker: https://caberqu.com/ https://caberqu.com/ The current model displays active lines, but there's a Kickstarter for one that shows more information: https://www.kickstarter.com/projects/electr/ble-caberqu-a-digital-usb-c-to-usb-c-cable-tester https://www.kickstarter.com/projects/electr/ble-caberqu-a-di...
- causi 2y agoWow that is some massively overpriced crap right there. Forty dollars for a USB continuity tester with a basic plastic case that only does type-C cables. Meanwhile you can get one, with acrylic case, that does types A, B, C, Micro, and Micro 3.0 for $17 off Amazon or $11 off Aliexpress. https://www.amazon.com/Treedix-Tester-Checker-Acrylic-Charging/dp/B0CF95VL2Y https://www.amazon.com/Treedix-Tester-Checker-Acrylic-Chargi...
- Tharre 2y agoIt's not just a continuity tester like the one you linked from amazon though. The Kickstarter page is light on details, but it can at the very least communicate with active cables to determine amperage and data speeds. Add to that a microcontroller, screen and software and the price doesn't look unreasonable to me, especially for a small project like this.
- causi 2y agoI didn't comment on the kickstarter product. I commented on the forty dollar continuity tester.
- Gigachad 2y agoThat isn't doing a fraction of the same feature set. The one above is able to read the cables emarker tags to tell you the cables described feature set, OEM, version number/etc. And it also tests actually pushing 40Gbit data and 240w power to verify the emarkers are correct. There are also cases where there can be active electronics in the cable where pins can seem disconnected by a continuity tester but they are actually connected to a chip inside the cable. Also as an aside, it should be possible to just plug a cable in, and have your OS tell you what kind of cable it is and it's specs. The USB controller has access to this info but there is no standard way to pass it up to the OS like you have with other USB info. Apparently Chromebooks do have controllers which expose this so they can tell you when both the laptop and charger support faster charging but the cable is limited.
- aidenn0 2y agoThere were also digital cameras that supported OTG in order to print to portable printers (usually just one or two models made by the same manufacturer).
- p0w3n3d 2y agoAndroid is a Linux. This means that it can have a keyboard, mouse and other periferials. You could (and probably can) even burn a CD using an Android phone. One of the nice things in OTG was to connect an external screen which is turning the phone to a full blown computer. Or a media player... HAHAHA! NAÏVE PERSON! You couldn't watch Netflix on USB OTG. Because... because of... REASONS YOU STUPID PIRATE!!! OR FUTURE PIRATE!!! OR FUTURE WANNA BE PIRATE! YOURETOCLOOSSEETOBEEINGPIRATEYOUPIRATE! ____ disclaimer: I do not want to offend anyone. Above sentences are what I hear in my head when I see that my phone with USB OTG/USB-C is not showing the video on my tv or monitor, or even showing but only subtitles. disclaimer 2: connecting screen using USB OTG was called MHL, not all devices had (has?) it
- scarface_74 2y agoAndroid being based on Linux doesn’t mean it has all of the capabilities of a Linux distribution anymore than iOS being based on BSD or even more relevantly being a fork of MacOS means it can do everything that Macs can do. As far as connecting an external monitor, that’s a standard USB C alt mode that your phone doesn’t support. https://www.benq.com/en-us/knowledge-center/knowledge/usb-c-introduction-what-is-dp-alt-mode.html#S3 https://www.benq.com/en-us/knowledge-center/knowledge/usb-c-... My iPhone 16 can send video and power to my USB C portable monitor over one cord. It can only drive the monitor as far as power up to 50% brightness. If I plug in a separate power supply to the second USB C port on my monitor I can run my monitor at full brightness and the monitor will charge my phone while my phone is sending it video. https://imgur.com/a/wyV4ReK https://imgur.com/a/wyV4ReK Of course my laptop supports powering and video at full brightness over one USB-C port
- p0w3n3d 2y agoWhat I describe is my genuine experience. I had a phone with usb otg with MHL. And netflix app didn't send video to the screen of the TV. It sent only text of subtitles. Because of some stupid limitations.
- scarface_74 2y ago
- jsmith45 2y agoIn my experience not many OTG devices actually used (mini-/micro-)AB ports, instead using just normal (mini-/micro-)B ports. The adapters generally just used a (mini-/micro-)B plug with the id pin wired like an OTG A plug. This does mean you can technically connect these adapters to non OTG products, which the spec writers wanted to avoid, but this simply meant the adapter didn't work. I also have some peripheral devices with a captive micro-B cable (with ID pin configured like like micro-A) that were specifically intended to be used with OTG compatible phones.
- DidYaWipe 2y agoMan, I hate that name. Why not just call it "host mode," which actually conveys information?
- lxgr 2y agoBack in the day when cameras still took better photos than phones, I've always wanted to backup vacation photos without bringing a computer. I still remember getting so close with the Google Nexus 4 to being able to connect an SD card reader. It supported OTG, but did not have the required charge pump to supply 5V of VBUS. (Supposedly you could hack together something using a 9V battery, some resistors, and a kernel patch, but that was a bit more than I was willing to risk for the convenience.) Finally, the Nexus 7 and Nexus 5 supported it out of the box, and while Android didn't offer a FAT32 implementation back then, there was (is?) a USB host API which let apps supply that instead, and I think somebody actually ended up implementing FAT32 in userspace to make it all work!
- brokenmachine 2y agoI've used a microSD reader with OTG adapter on my Samsungs for this purpose for decades now. Oh, and cameras still take better photos than phones, and it's weird that you would think they don't - they're devices that cost more than phones, designed specifically to take good photos.
- netsharc 2y agoI went on a long trip with a mirrorless camera and a SanDisk 500GB portable disk. My "computer-less" backup solution was a Pi-esque machine with USB3 (a RockPi), a powerbank, a card reader, and connecting my phone over USB and tethering it. This gave the RockPi an IP I could ssh into, and I'd ssh from the phone and ran rsync to copy the images from the SD card in the reader to the SanDisk portable drive. I should make a custom Linux image for the Pi4+ (the whole process is probably too slow without USB3) and some automation (Jenkins?) to do this, I'm sure there's photographers who'd find it useful.
- brokenmachine 2y agoWhat happens when you connect the mirrorless directly to the phone with usbc? My Sony can do MSC mode when connected to the PC. I haven't tested but I assume it would do the same when connected to a phone.
- 2y ago
- nfriedly 2y ago> [1] My first smartphone was the HTC Thunderbolt. No one, not even me, will speak of that thing with nostalgia. It was pretty cool owning one of the first LTE devices on the market, though. There was no contention at all in areas with LTE service and I was getting 75+Mbps mobile tethering in 2011. Then everyone else had LTE too and the good times ended. I also had the HTC Thunderbolt and remember getting ~75Mbps initially. My wife's family lived way out in the countryside in Illinois and had something like 2Mbps DSL internet. But on one visit, I realized that if I walked down the road a short distance to the top of a hill where I had line of sight to what turned out to be a Verizon tower, I could still get ~75Mbps! I took advantage of that once or twice to get things downloaded in a more reasonable amount of time.
- qwertox 2y ago> for most of the '90s RS-232-ish serial and its awkward sibling the parallel port were the norm for external peripheral The parallel port was a nice way to have GPIOs in a computer back then. A bit like the GPIOs in today's SBCs, but more rudimentary.
- topspin 2y agoSometimes you read a post somewhere and the thoughts expressed stick with you for years. Decades even. Once case for me is a post someone wrote in the late 90's that was concerned about parallel ports going away and everything being subsumed by USB et al, cutting off hobbyists and experimenters. It made a lot of sense at the time, and I've thought about this many times since. Obviously USB has been widely embraced and is highly successful for experimenters, hackers, etc. Whatever friction it causes is so vanishingly small that few people today even suspect that there might be any reason for concern. But yeah, I get what you're saying: built-in GPIOs on every box by default used to be a thing, and it would be cool to have even now.