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

WJoy loses connection right after connecting. #1

Open
eestein opened this issue Dec 23, 2016 · 53 comments
Open

WJoy loses connection right after connecting. #1

eestein opened this issue Dec 23, 2016 · 53 comments

Comments

@eestein
Copy link

eestein commented Dec 23, 2016

@JustinBis thanks for enabling issues here :)

Reading the project's description I understand it was created to circumvent apple's rootless option starting with El Capitan. But I'm having an issue that according to this one here alxn1#81 is related exactly to that. My Wii U Pro controller connects and disconnects right away.

Any ideas on this one?

Extra info:

  • SIP enabled: Yes
  • Tried with SIP disabled: No
  • System
    screen shot 2016-12-26 at 14 12 01
@Qonstrukt
Copy link

I'm facing the same problem. And tried disabling SIP, but this hasn't made any difference for me.

This is with a 15" 2016 MBP.

@Hovercross
Copy link

Same issue: Late 2014 iMac 5k; MacOS 10.12.2. Controller connects, I get the blue light for first controller, then immediately disconnects. I've tried two different Wii U Pro Controllers thus far.

@The-HAX0R-31337
Copy link

I'm also having this problem. The original WJoy was able to connect controllers and keep them connected, but this version won't.
I'm running El Capitan (10.11.6) on a Late 2007 MacBook Pro and I have SIP disabled.

@luis-manzano
Copy link

luis-manzano commented Dec 29, 2016

Hi,

Same here, I am using El Capitan (10.12.2) on a MBPr 15" and same happens using a Wii U Pro.

I have also tried disabling SIP with equal result and tried original WJoy which stops as soon I start it.

Help appreciated ;-)

@doctorpangloss
Copy link

The exception I'm seeing in dmesg:

handleInformationResponse kBluetoothL2CAPInformationTypeExtendedFeatures deviceAccountPaired, check fixed channel support 
[IOBluetoothL2CAPChannel][listenAt] -- returning false because owner 0x72d000 does not match new owner 0x72d200
[IOBluetoothHIDDriver][IOBluetoothHIDDriver][handleStart] staticPrepControlChannelAction returned error e00002bc
[IOBluetoothHIDDriver][IOBluetoothHIDDriver][handleStart] calling staticWillTerminateAction().
[IOBluetoothL2CAPChannel][listenAt] -- returning false because owner 0x72d000 does not match new owner 0x72d200
[IOBluetoothHIDDriver][IOBluetoothHIDDriver][handleStart] Failed.

@ikajaste
Copy link

Tried this with an original Wii controller: it connects, but then immediatelly disconnects. OSX El Capitan 10.11.6.

dmesg first shows the following when using the "press buttons 1 and 2":

[IOBluetoothHIDDriver][getDevicePropertiesWL][00-24-44-ad-30-49] Error retrieving device properties.
[IOBluetoothHIDDriver][probe] Couldn't retrieve device properties

By trying the red sync button, same happens, but dmesg shows:

BT: returning false because owner <ptr> does not match new owner <ptr>
[IOBluetoothHIDDriver][handleStart] staticPrepControlChannelAction returned error e00002bc
[IOBluetoothHIDDriver][handleStart] calling staticWillTerminateAction().
BT: returning false because owner <ptr> does not match new owner <ptr>
[IOBluetoothHIDDriver][handleStart] Failed.

@dbrakman
Copy link

I also have this problem. My Wii U Pro Controller disconnects immediately after connecting. I have SIP enabled on my MacBook Pro (Retina, 15-inch, Mid 2015) running 10.11.6.

@doctorpangloss
Copy link

doctorpangloss commented Jan 15, 2017

I investigated getting the original WJoy working on Mac OS Sierra, since this looks to be a foohid issue.

I successfully connected a Wii U Pro controller with two tweaks to the original code. I also backported the calibration fix. The kext is loaded:

$ kextstat
...
  149    0 0xffffff7f84683000 0x7000     0x7000     com.alxn1.driver.wjoy (1) 7B095ABA-81D6-3437-8253-B251969B0C12 <34 5 4 3>

and the device successfully connected in WJoy.

The original project's kext needs a header changed and a constant reintroduced. Otherwise, it needs to be signed by a kernel extension signing certificate, which I do not have but I'm in the process of obtaining. It works correctly with SIP disabled (csrutil disable in the Recovery OS terminal) on the latest Sierra. The most important change was:

--- a/WirtualJoy/wirtual_joy_device.cpp
+++ b/WirtualJoy/wirtual_joy_device.cpp
@@ -10,9 +10,10 @@
 #include "wirtual_joy_device.h"
 #include "wirtual_joy_debug.h"
 
-#include <IOKit/usb/IOUSBHIDDriver.h>
+#include <IOKit/usb/IOUSBHostHIDDevice.h>
 
 #define super IOHIDDevice
+#define kMaxHIDReportSize 256
 
 OSDefineMetaClassAndStructors(WirtualJoyDevice, super)

I also removed Growl (it's obsolete).

Currently, the original WJoy tries to load a kext with improper permissions — the kext must be copied by root into the right place (i.e., sudo cp -r /Applications/WJoy.app/Contents/Frameworks/WirtualJoy.framework/Versions/A/Resources/wjoy.kext /Library/Extensions/wjoy.kext). This is why the original WJoy starts and closes immediately after typing in your password at the moment. Otherwise, I believe the kext just needed the diff tweak above.

I need to spend a little more time packaging this fix, but I'll be sure to do it. I'll wait until my contact at Apple responds about the kernel extension signing certificate.

You can view the fixed fork here: https://github.com/hiddenswitch/wjoy-foohid/tree/fixed-original

@eestein
Copy link
Author

eestein commented Jan 16, 2017

@doctorpangloss hey, nice find. This fix still needs SIP disabled, right?

@doctorpangloss
Copy link

@eestein until I get the kext signing certificate, yes.

@eestein
Copy link
Author

eestein commented Jan 16, 2017

@doctorpangloss cool :) please post here once you have that, I'm pretty sure everyone here would love to use this fix :) thanks!

@JustinBis
Copy link
Owner

@doctorpangloss If you manage to get a kext cert, please leave a comment here and upload the signed version to your repo so I can make a note that this project has been superseded by yours. A signed kext is a far better solution than relying on foohid.

@aarcro
Copy link

aarcro commented Mar 17, 2017

@doctorpangloss I built your branch in Xcode, but I still get "[IOBluetoothL2CAPChannel][listenAt] -- returning false because owner does not match new owner "

And the wiimote disconnects right after vibrating. LEDs just go dark.

@aarcro
Copy link

aarcro commented Mar 17, 2017

Ok, I built the DMG, tried copying the kext, but it isn't signed. I don't know how to:

"To compile, make sure to enable Automatic Signing for every project. Let XCode configure things for you."

There were warnings in the left column that I thought were about signing things, and I choose all the "let xcode fix it" options. Can't find the "Automatically manage signing" settings in any of the projects.

@dmoyadev
Copy link

Hi! I have prove with SIP disabled and SIP enabled but the wiimote keep disconecting... is there any update about that issue or something?

@doctorpangloss
Copy link

@aarcro @Lynx901 Don't worry about building anymore, just follow the instructions in my repository here:

https://github.com/hiddenswitch/wjoy-foohid

@doctorpangloss
Copy link

@JustinBis I didn't get the kext cert unfortunately so it's up to you whether or not to forward to my repo for issues. I appreciate your interest. I tested on a variety of macOS Sierra devices and could confirm everything is working otherwise.

@eestein
Copy link
Author

eestein commented May 18, 2017

@doctorpangloss the problem is disabling SIP... it's nice that it's working, but forcing people to disable SIP is pain (the process) and dangerous.

What is involved in getting the kext cert?

@dmoyadev
Copy link

@doctorpangloss I followed the instructions in the repo you gave me but I got this when I moved wjoy.kext to /Library/Extensions
image
It says that it cannot be installed so it cannot be used... Furthermore, WJoy doesn't start, it asks me for the admin key but it dissapears from the OS bar. This is my computer (with SIP disabled)

image

@doctorpangloss
Copy link

doctorpangloss commented May 18, 2017

@Lynx901 can you try the following terminal command?

sudo chmod -R +x /Library/Extensions/wjoy.kext
sudo kextload wjoy.kext

and let me know what message you receive?

@doctorpangloss
Copy link

doctorpangloss commented May 18, 2017

@Lynx901 Okay I can confirm you definitely need to issue kextload command, I could reproduce your issue with my WJoy build. I have added that to the instructions. I think I just had the kext loaded on my other machines at some point.

@dmoyadev
Copy link

dmoyadev commented May 19, 2017

@doctorpangloss After changing the permissions of wjoy.kext this is what I got
image

@doctorpangloss
Copy link

@Lynx901 okay I'm contacting an Apple employee again for a kext signing key :)

@eestein
Copy link
Author

eestein commented Jun 16, 2017

@doctorpangloss same here... I got the same message as @Lynx901

Man, this thing has become a huge pain...

@doctorpangloss do you know if registered apple developers can generate a valid kext key? I am one, if that would help I could generate it. Or is it some specific process?

@valimero
Copy link

Same problem.

MacBook Pro (Retina, 15 pouces, mi-2015)
2,2 GHz Intel Core i7
macOS 10.12.5

@IlyaPlatonov
Copy link

IlyaPlatonov commented Jul 15, 2017

You just need to make owner:root and group:wheel for wjoy.kext. Use BatChmod. Then it will work.
Sadly, with WJoy I can use wiimote in mac games as joystick, but Dolphin doesn't see it as wiimote.

@jdactal
Copy link

jdactal commented Aug 6, 2017

Where is the wjoy.kext file located? I tried the file /MacOS/WJoy in the contents of the app, but it didn't work.

@michelle1901
Copy link

michelle1901 commented Aug 13, 2017

This solution worked for me:

I followed the steps provided by @doctorpangloss and disabled SIP, but I still could not get wjoy working. My mouse would keep spinning the rainbow as I hovered over the Wjoy icon in the menu bar and when I typed my password, Wjoy stopped working again.

After following the steps I did the following:

Copy the wjoy file from /Applications/WJoy.app/Contents/Frameworks/WirtualJoy.framework/Versions/A/Resources/

to
/Library/Extensions

using the command:
sudo cp -r /Applications/WJoy.app/Contents/Frameworks/WirtualJoy.framework/Versions/A/Resources/wjoy.kext /Library/Extensions/wjoy.kext

After that, delete the wjoy.kext from the /Applications/WJoy.app/Contents/Frameworks/WirtualJoy.framework/Versions/A/Resources/ folder

The wjoy.kext stays in the /Library/Extensions folder

Now start Wjoy again and it should work.

@CymanChili
Copy link

I tried several methods mentioned on GitHub to make WJoy work with macOS 10.12 Sierra - however, none was successful.
It seems like WJoy only doesn't quit upon launching after installing foohid. However, after rebooting the computer, it appears that foodhid needs to be reinstalled or else, WJoy keeps asking for the user password and quits.
Besides, even though I managed to get WJoy to run, the Wii U Pro Controller gets discovered and connected with WJoy, but disconnects right away.
Is there anyone who can confirm that they successfully got WJoy working with macOS Sierra (10.12) and keep the Wii U Pro Controller connected?

@jdactal
Copy link

jdactal commented Aug 23, 2017

This fork that was referenced earlier works! https://github.com/hiddenswitch/wjoy-foohid/tree/fixed-original

@CymanChili
Copy link

In fact, I downloaded this fork and installed it, but it didn't work for me. Could you share what you did in order to get it to work in macOS 10.12 (Sierra), please?

@jdactal
Copy link

jdactal commented Aug 24, 2017

Follow the readme AND make sure you delete all previous wjoy files in your system. This includes wjoy.kext in /Library/Extensions and other system files (Use an app like AppCleaner to do this). Then follow just follow the readme. Except, on step 2, use the command "sudo cp -r /Applications/WJoy.app/Contents/Frameworks/WirtualJoy.framework/Versions/A/Resources/wjoy.kext /Library/Extensions/wjoy.kext" and ignore the wjoy.kext in the folder. (Don't delete the wjoy.kext in the app contents.) This should work.

@CymanChili
Copy link

I did like you said and it seems to work! Thanks a lot! I will report back if I encounter any issues!

@jdactal
Copy link

jdactal commented Aug 24, 2017

You're Welcome!

@jdactal
Copy link

jdactal commented Aug 26, 2017 via email

@CymanChili
Copy link

Sorry I deleted my comment, because I got to resolve it right after encountering the issue.
Here is what seems to have solved it:
I had WJoy on Autostart, activated One-Button-Click-Connection, thinking that this would make things easier.
Anyway, instead of deleting and reinstalling WJoy once more after I encountered the issue, I just quit and restarted the app.
Then I could connect the controller without any issue.
Not sure why this happens, but I will see next time I restart the computer if the issue can be reproduced.
Maybe there is an issue with WJoy on autostart.

@CymanChili
Copy link

After having some kernel panics today (though unrelated to WJoy), I keep encountering the same issue again. WJoy starts and prompts for the user password and quits upon entering it.
Uninstalling and reinstalling with the steps above, doesn't seem to resolve the issue - even after several restarts. This is very odd - I just can't see a pattern.

@Natrium729
Copy link

So someone made a pull request fixing the immediate disconnect, which was merged. Then someone else forked wjoy-foohid and made a new release with this fix and some others.

I tested it with a Wii U Pro Controller on El Capitan with SIP enabled, and it worked! Could some of you try it to confirm?

@sampumon
Copy link

sampumon commented Oct 13, 2017

@Natrium729 thanks, this works on High Sierra too! Now finally WJoy is working with SIP enabled. 🎉

Edit: it's not working with multiple wiimotes : (

  • I paired four wiimotes succesfully (WJoy crashed once in the process)
  • Joystic Show shows four wiimotes with different addresses
  • Pressing any of the wiimotes shows presses on the same wiimote in joystick show
  • Flat Heroes does not recognize wiimote presses

@eddietheox95
Copy link

BUMP!!

Hey guys, didn't want to necro an old thread or anything of the like; However, I've done everything required in order to actually get WJOY to start working. I did, in fact, find out that my controller won't even sync on MacOS High Sierra 10.13.2? I have bluetooth enabled, SIP disabled, and Autostart on WJOY enabled. I've already gotten past the password issue due to the amazing tutorial above (thanks!) but I'm still pretty new to having a mac and would love to get this Pro GamePad up and running ASAP. Any fixes in terms of it not connecting? WJOY gave me a toast message saying discovery complete but it seems like my controller hasn't even synced up for a second. Please help me out!

@doctorpangloss
Copy link

@eddietheox95 @sampumon @Natrium729 I've restored the original WJoy to make it work with High Sierra, and tested on a brand new Mac. SIP must be disabled until I can sign. Note that foohid is no longer getting signed, so this is the only alternative.

You can view it here: https://github.com/hiddenswitch/wjoy-foohid

Download: http://go.hiddenswitch.com/wjoy

https://github.com/hiddenswitch/wjoy-foohid

JustinBis pushed a commit that referenced this issue Mar 9, 2018
@kevalp187
Copy link

This works well for Wiimotes on High Sierra but I can't get this working with an Afterglow Wii U Pro Controller. Do I need to do something different?

@doctorpangloss
Copy link

@kevalp187 no, you're doing everything correctly. The driver doesn't have a profile for that device, and I'm not yet sure what to ask you for in order to add that additional profile information. Stay tuned.

@doctorpangloss
Copy link

I’ll investigate the issues, sorry about that.

@IDPLAYER
Copy link

IDPLAYER commented Apr 5, 2018

i am having the problem where it quits when i enter the password, i have got wjoy to work on a mac already (mac mini, version 10.12.6, sip enabled) but i cant seem to get it to work atm. i have no idea what i did you make it work but it still works and i connected 2 wiiu pro controllers already and a wiimote i think. i am confused and dont know what to do to fix it. please help. thanks

@talossa
Copy link

talossa commented Apr 13, 2018

late 2011 macbook pro with 10.13.2 here (yes, i know, this shit's old)
can't get any version of wjoy working.
not confident enough to disable sip.
can someone please help? xd

@doctorpangloss
Copy link

I had to take down the download because, as @filfat reported, there's an issue on 10.13.4 that causes recoverable but deeply troubling restarts.

Apple's drones aren't going to give me a kext signing key, because they read things like people in reddit read them.

Benjamin Berman
Team ID: K4T4R33YU4
Company / Organization: Benjamin Berman
Company / Product URL: hiddenswitch.com
Intended Distribution: Consumer or Enterprise Distribution

What product requirements are being addressed by this kext?
This kext connects custom video game controller hardware to the user's Mac. Our hardware is adapted from commercial Nintendo devices using the Bluetooth standard. This kext mitigates the unusual lack of support for this device (Windows supports it natively).

The driver is published openly here: https://github.com/hiddenswitch/wjoy-foohid . It is a fix of an open-source project.

Which kernel interfaces are required for your kext?
This kext is strictly an implementation of IOHIDDevice, IOUserClient and IOService.

Which user mode APIs were investigated and why were they not sufficient?
We investigated other ways to create an HID device, like the foohid community package, but it is no longer maintained.

Reply:

The use you've described for your software does not meet the criteria for kext signing.

Kext signing is intended for signing commercially shipping kexts or projects broadly distributed in a large organization. Early development, testing, and prototyping of software does not warrant the issuance of a kext signing cert.

Additionally, kext signing is not intended for products that bypass MacOS security features such as System Integrity Protection, or for products designed to copy protected media.

@IDPLAYER
Copy link

will this still work if i enable SIP? if yes please let me know

@IDPLAYER
Copy link

IDPLAYER commented Jun 16, 2018

ok i got past the password thing... finally, but now it just disconnects.
and i still have SIP enabled. im on 10.12.6
go to Applications/Wjoy.app/Contents/MacOS
open terminal
type "sudo " (without marks)
drag Wjoy in terminal window
hit enter
type password
hit enter again
now wjoy should atleast stay open, if not repeat the steps and it should work.

just not that the controller connects though.....
eh im 1 step further so im happy, hope i helped you

@balabambuz
Copy link

have high Sierra 10.13.6 any solutions?

@groelk
Copy link

groelk commented Oct 14, 2018

BUMP! On High Sierra 10.13.6, I have tried all of the above solutions.
I could get the app to open and remain in the tray, but it won't sync with a Wii Remote nor with a Wii U Controller Pro. Enabling or disabling SIP doesn't make a difference.

@HomeStarRunnerTron
Copy link

HomeStarRunnerTron commented Jun 18, 2020

@Natrium729 thanks, this works on High Sierra too! Now finally WJoy is working with SIP enabled. 🎉

Edit: it's not working with multiple wiimotes : (

  • I paired four wiimotes succesfully (WJoy crashed once in the process)
  • Joystic Show shows four wiimotes with different addresses
  • Pressing any of the wiimotes shows presses on the same wiimote in joystick show
  • Flat Heroes does not recognize wiimote presses

Did you ever end up finding a way to get multiple Wiimotes to show up as their own dealio? For anyone else experiencing the ability to not even get it to sync once, follow IDPLAYER's post here.

EDIT: Currently, THIS fork (which is active and everything) linked here works perfectly for 10.14.6: https://github.com/WiiController/WiiController/releases/tag/v0.11.0

Another functional alternative is this older fork of wjoy:
https://github.com/hiddenswitch/wjoy/tree/fixed-original

For this one, put it into the Applications folder, then go into Terminal, and type in...

sudo /Applications/WJoy.app/Contents/MacOS/WJoy

... gives it permissions to start off. (And also maybe delete the wjoy.kext you might have from a previous version in your Library extensions, then put in the one in the zip.)

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