Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble detecting paired joycons with joytk #3

Open
hoverbird opened this issue Mar 13, 2021 · 7 comments
Open

Trouble detecting paired joycons with joytk #3

hoverbird opened this issue Mar 13, 2021 · 7 comments

Comments

@hoverbird
Copy link

Hey @Yamakaky!

First of all, thank you for making this software, I am really excited to start using this to get flex data off of the ringcon, something I've been hoping to do for over a year. It seems from discussions on the dekuNukem forums like you've really solved it.

That said I am not able to use the software yet, I suspect I'm doing something wrong— for context I am totally new to Rust. I'm on macOS 10.15.6 and have successfully paired R+L joycons over bluetooth, and am able to see their live inputs from another simple controller utility. But when I try to use any of the joytk commands, I always get the same error:

⟩ target/debug/joytk ringcon monitor ~/D/F/c/joy 1
Error: Failed opening hid device

Is there a setup step I missed to make the paired controllers visible to the HID library? Any guidance you can provide is much appreciated. Thanks!

@hoverbird
Copy link
Author

Oh, I forgot to mention- this was after commenting out some linux-specific code that was preventing compilation, but which is maybe also supposed to target macOS as well as linux? here is the error I get with a clean checkout of master:

   Compiling joytk v0.1.0 (/Fitness Gaming/code/joy/joytk)
error[E0433]: failed to resolve: use of undeclared crate or module `relay`
  --> joytk/src/main.rs:64:21
   |
64 |                     relay::relay(device, r)?;
   |                     ^^^^^ use of undeclared crate or module `relay`

error: aborting due to previous error

@Yamakaky
Copy link
Owner

Yamakaky commented Mar 13, 2021

I pushed to fix the compilation issue.

Unfortunately, the error messages for hidapi are pretty limited. I also don't have a mac for testing. Some things to try:

What other utility do you use?

As for the relaying, it should work on mac but not sure. The pairing is not implemented, so you have to do the pairing using https://github.com/Yamakaky/joycontrol/blob/capture-text-file/scripts/relay_joycon.py then run my relay.

@hoverbird
Copy link
Author

Aha, you guessed it right on the first try! I had paired a Left and a Right Joycon at the same time. Pairing with only a Right controller and the code works fine. Thanks for your help @Yamakaky !

@hoverbird hoverbird reopened this Mar 16, 2021
@hoverbird
Copy link
Author

Hi again! I'm definitely making progress now, but hit another snag. The joycon is found, and I am getting what looks like good accelerometer, gyro etc. information from joytk monitor... unfortunately, joytk ringcon monitor just streams "Flex value:0" and joytk ringcon stored-flex returns "Ringcon initialisation... Error: no accessory connected"

This is with the joycon connected to a Ringcon when I paired it to the mac... is there a step I need to do to tell the joycon explicitly to behave as if it's connected to a ringcon? Thanks again for all your help, I can't wait to use this software, it's going to be so cool!

@Yamakaky
Copy link
Owner

Interesting, I don't think I ever tested with two joycons. I don't see why it wouldn't work. Are you sure the tool doesn't create a fake device or something? I have to add a command to list the devices, maybe it will help.

As for the ringcon, could you use the relay command to record a trace? You first need to use the python script to pair the switch, which only supports Linux so some adaptation will be needed. Ping upstream if you need help. After that, my relay should work fine.

@hoverbird
Copy link
Author

I'm now just testing with a single joycon, and no other tools. I will try to get relay working and report back!

@Yamakaky
Copy link
Owner

Yamakaky commented Mar 20, 2021

The main adaptation point is https://github.com/Yamakaky/joycontrol/blob/capture-text-file/scripts/relay_joycon.py#L97-L102. I think the rest should be ok, it may even work on windows.

You could try to comment these lines and see if the fix is not needed on Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants