Nintendo_Switch_Reverse_Engineering icon indicating copy to clipboard operation
Nintendo_Switch_Reverse_Engineering copied to clipboard

USB HID Motion/Gyro

Open WhileE opened this issue 5 years ago • 11 comments

So I've been reading through a ton of this repo, and it's amazing BTW, and I keep reading what seems like conflicting information.

Can anyone outright confirm/deny that joy-cons with a charging grip will communicate over USB instead of BT, and will this include gyro data if initialized properly?

I ask because I currently have an HID device (16u2) plugged in via USB that emulates a HORIPAD controller, and it works great, but I'm looking at the possibility of incorporating gyro controls, but am unsure of the support over USB. I'm in the process of acquiring a charging grip to do some digging myself, but didn't want to waste the time if someone else can deny that this will ever work.

I see some saying you have to pair via BT then switch to USB, then there's others stating that the joy-cons only communicate over BT unless physically connected to the sides of the switch.

WhileE avatar Aug 03 '18 20:08 WhileE

Joy-con can communicate via BT and USB when in grips You instruct them how. If already BT connected they respond to both. If USB first, you have to instruct them to switch to BT. Otherwise it's only USB.

That's why it seems conflicted ^

CTCaer avatar Aug 04 '18 02:08 CTCaer

So when connected to the Switch, does it automatically tell them to switch to BT, and that's why the USB COM stops after a few seconds? I'm coming from the other side, I'm not looking to talk TO the joy-con, more emulate them. So have the charging grip, but have yet to understand how/if I can force USB only to glean some extra insight on the COM.

WhileE avatar Aug 06 '18 03:08 WhileE

If USB first, you have to instruct them to switch to BT. Otherwise it's only USB.

So the usb comm does not stop. Except if you don't reply correctly.

CTCaer avatar Aug 06 '18 07:08 CTCaer

I'm not the one replying, it's the Switch itself. As I said, I'm not talking TO the device, I'm just listening on the USB comm between the cons and the Switch, and it stops after a few seconds. So I have to assume the Switch basically tells it to stop USB comm, and does everything over BT.

Digging around the settings I noticed there's an option to force the Pro controller to comm over USB only, but nothing for the joy-cons I could see.

WhileE avatar Aug 06 '18 12:08 WhileE

I was going to talk about that option. You enabled it?

EDIT: This enables the whole USB communication with every USB controller

CTCaer avatar Aug 06 '18 14:08 CTCaer

Yes, I did enable it, and power cycled. However when I connect the charging grip to the switch, nothing happens until I click some buttons, then it spits out USB comm for a few seconds, pairs, and then stops USB comm altogether.

At first I thought it was because I was using USBProxy on the BBB to snoop the comm, but then I just my HORIPAD USB controller and it works just fine over USB.

WhileE avatar Aug 06 '18 15:08 WhileE

If after it stops USB comms, you press a button and you see nothing, Switch switched (^^) them to BT mode.

CTCaer avatar Aug 06 '18 15:08 CTCaer

Yeah, that's what I assumed. Not sure at this point if the pro controller would work any differently, but given the option for "Wired communication" explicitly references the pro controller, I assume it will force USB comms to continue. Worth a test at least, will pick one up today to see.

WhileE avatar Aug 06 '18 15:08 WhileE

@WhileE I might work on this eventually, since it's on my to-do list for a project I'm working on

I looked into this a while back & someone made an attempt but didn't get very far & it looks like they gave up, I'll link it & the stuff I found on this when I have more time/get home

fossephate avatar Aug 17 '18 21:08 fossephate

You can't really stop them from negotiating Bluetooth communication, kinda like a TLS handshake. You can do pure USB JoyCon <-> Custom, and pure USB Custom <-> Switch, but you can't force pure USB JoyCon <-> Switch without editing the packets in-flight.

riking avatar Aug 26 '18 19:08 riking

Does it even switch to BT in Flight mode? because the Pro controller with a wired c-to-c connection works just fine in flight mode?

Poohl avatar Apr 16 '21 21:04 Poohl