-
Notifications
You must be signed in to change notification settings - Fork 6
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
Use the new Wiimote controller with motion plus Inside (bluetooth problems) #1
Comments
The toshiba bluetooth stack is not really supported. I didn't have a dongle at the time and the Toshiba Bluetooth SDK was a paid SDK, so I haven't invested any time into this. That said, you say you run into problems with the motion plus connected. Are you saying things do work without the motion plus? A pull request is greatly appreciated! |
No i said i have the new Wiimote with the motion plus integrated in it ("Wiimotion plus inside": http://www.amazon.com/Wii-Remote-Controller-Motion-Inside-Nintendo/dp/B0064IAZJ8?SubscriptionId=AKIAJ32XBJUETKS4M4CQ code: RVL-CNT-01-TR). I saw that the code is very similar to your in the MsHid bluetooth provider. But i can't have your code working that's why i'm asking if it worked with your controller and if not what i need to implement in order to work. |
Ah sorry, I misinterpreted your comment. I haven't tested this with the Wiimote with integrated motion sensor. Since you say the Wiimote (with motion sensor) isn't recognized at all with MsHid, I would guess it has something to do with the detection code. Both WiimoteLib and WiiDeviceLibrary use VID/PID to detect the device. It seems Wiimotelib has one additional PID it checks. Maybe that's the motion plus: You can find similar code in WiiDeviceLibrary: If you could give this change a try and make a PR, that would be awesome! |
Ok thank you very much for your help, i finally solved the problem but it may cause other problems, i will need a little more of your help in order to make the pull request (i don't want to make any regression in your library). This is what i did:
What i still need to do
Tell me if theses modifications are convenient for you and i will do a Pull request. I also made a migration to .NET 4 for VS 2013 x86 (i switched from x64 because it didn't worked for me as it won't recognize any devices). But i will maybe not include it in the pull request what do you think? Thank for your help. I hope your library will become more popular in the futur :) |
Separate pull requests focusing single issues/problems/features would be ideal for me. If you first want .NET 4 support merged, that would be trivial for me to accept.
That sounds alright.
Looks good to me!
Ya, reordering this isn't the way to go, because MsBluetooth will be disabled entirely this way. If you want to use MsHid explicitly, you can use it explicitly (by creating it manually, instead of automatically discovering providers). That said, I have a hunch it's still possible to support the new Wiimote with MsBluetooth. Are you absolutely sure MsBluetooth can't recognize the new Wiimote at all? |
Thank you for your answer. I didn't know that the I just tryed to make it work with Thank you for your reactivity on this issue |
I haven't used C# on android yet. So I'm not sure what the implications MsHid is kind of a fallback for when the rest does not work. That's why On Wed, Mar 25, 2015, 23:54 Ludovic Feltz [email protected] wrote:
|
at ludo6577's repository I don't see an Issues area, so I post this here (and just closed the pull request I had made to pull from his repo, till this is fixed): |
btw, we managed to have your code work with the balance board on Windows 8 64-bit, by switching all projects in the solution to 32-bit (there is an option at the Properties/Build that says "Prefer 32-bit"). This is since bthprops.cpl that you use for the Microsoft stack (at NativeMethods.cs) seems to be 32-bit and exist in SysWoW64 folder on Windows 64-bit. Not sure what is the proper way to access the Microsoft Bluetooth stack in 64-bit. Maybe there's some other DLL or you can somehow mark the native method as being 32-bit and .NET can handle loading a 32-bit DLL inside an 64-bit app and call it? |
@birbilis About 64 vs 32 bit: Fixing NativeMethods would be a next step. Alternatively, it would be nice to use a library that supports a .NET library that handles Microsofts bluetooth stack. I couldn't find one at the time, but looking around now, it seems that http://32feet.codeplex.com/ fits the bill. It supports a range of Windows bluetooth stacks. A new provider could be made that uses 32feet and is used instead of MsBluetoothProvider or even Bluesoleil. |
do you have any insight on which change from the ones ludo6577 did causes the misrecognition of the balance board as "wiimote device"? Is it the "•Prioritizing MsHid above MsBluetooth seems wong. MsBluetooth will never be picked on Windows, since all machines always support MsHid" that you mention at #2 ? Sounds like that is the issue. After the wrong recognition the GUI example doesn't show the balance board UI, but other |
If the Wiimote is recognized and the Balanceboard isn't, then I would think it's an issue with the PID. (even though I first thought that is a good candidate for a merge) However, if both are not recognized, I'd think the change in priority for MsBluetooth could be the trouble-maker. |
my partners don't have a wiimote available for testing, just a balanceboard. The problem is the wrong recognition of the balanceboard as wiimote device I think this code of yours from https://github.com/FrozenCow/wiidevicelibrary/blob/master/WiiDeviceLibrary/Interface/DeviceProviderRegistry.cs is correct. However my assumption means the MsHidDeviceProviderFactory has problem with detecting the balance board. Will ask the partner who has the balance board to try putting Ludo's version of the following code 32 static DeviceProviderRegistry() btw, at Ludo's version 32 static DeviceProviderRegistry() |
They both should work with both with proper fixes. MsHid looks at VID/PID of the HID device. The HID device is only added to Windows once you have manually connected to the device through the bluetooth GUIs of the stack you use. That's why MsHid is the 'black sheep' of them all: it doesn't automatically connect. That also means it shouldn't be higher prioritized than a full-features (auto-connecting) provider. The proper providers do not use VID/PIDs to identify Wii devices, since bluetooth doesn't use VID/PID directly. You can see that MsBluetooth looks for the devices based on names: wiidevicelibrary/WiiDeviceLibrary/Bluetooth/MsBluetooth/MsBluetoothDeviceProvider.cs Lines 75 to 82 in b5884de
Same goes for Bluez: wiidevicelibrary/WiiDeviceLibrary/Bluetooth/Bluez/BluezDeviceProvider.cs Lines 258 to 265 in b5884de
And same goes for Bluesoleil: wiidevicelibrary/WiiDeviceLibrary/Bluetooth/Bluesoleil/BluesoleilDeviceProvider.cs Lines 183 to 190 in b5884de
I do not have a Wiimote with integrated motionplus, but @ludo6577 could set a breakpoint there and check the name of the device. Adding that name to the MsBluetooth provider is trivial. That would be the proper fix for the prioritization. |
that would fix the MsBluetooth stack indeed. Any idea how the MsHid stack could be fixed regarding its balance-board misdetection? Or is it expected that it can only see as "generic" wiimotes such devices? |
btw, don't devices on Windows have a SUBCLASS too? Aka VID (Vendor ID), PID (Product ID) and Subclass that the Properties dialog at Windows Device Manager shows for a detected device? Maybe all Wii-related devices from Nintendo have the same PID and separate Subclass? |
I thought Subclass is for USB. I'm not sure whether the MsHid also has a subclass. That said, MsBluetooth recognizes the Balanceboard correctly because it can distinguish them based on name: https://github.com/FrozenCow/wiidevicelibrary/blob/master/WiiDeviceLibrary/Bluetooth/MsBluetooth/MsBluetoothDeviceProvider.cs#L214-L219 You can see here that MsHid doesn't have any support for recognizing the balanceboard: https://github.com/FrozenCow/wiidevicelibrary/blob/master/WiiDeviceLibrary/Bluetooth/MsHid/MsHidDeviceProvider.cs#L153 (it just creates a Wiimote, there is no notion of balanceboards there). Like said before, MsHid kind of a black sheep. It doesn't support everything. If you can avoid using MsHid, do that. I presumed the device could be determined before actually connecting to the device. This is true for the proper bluetooth providers, but I don't think that's possible with MsHid. With MsHid you get a Wiimote with an extension. The extension is now not recognized (because the balanceboard-extension isn't implemented), but you could use this. This is also how WiimoteLib does things. There, a balanceboard is a wiimote with a balanceboard extension. We have chosen not to do this, since a wiimote can do much more than a balanceboard, you can see the distinction between: https://github.com/FrozenCow/wiidevicelibrary/blob/master/WiiDeviceLibrary/Interface/IBalanceBoard.cs and https://github.com/FrozenCow/wiidevicelibrary/blob/master/WiiDeviceLibrary/Interface/IWiimote.cs. Anyway, if you go with MsHid, I'm interested about your findings! |
Relevant quote: "For a large part of the development process, the board was an extension controller to a normal Wii remote.[7] The effects of this are seen in the released balance board, which acts as a Wii remote with the front button mapped to "A" and all load cells on an "extension controller".[8]" |
Also maybe the following library that I think I read you were based on, may have newer stuff on balance board access via MsHID (if I understand correctly they only used MsHID). See the history in that article "6/15/08 – Version 1.5.2 is now up at CodePlex. The Balance Board should really work this time…." https://channel9.msdn.com/coding4fun/articles/Managed-Library-for-Nintendos-Wiimote |
Yes, exactly. With the Bluetooth naming we are able to distinguish between the balanceboard and the wiimote, allowing to expose a nicer API than a Wiimote+BalanceBoardExtension. Yes, the link you sent is the WiimoteLib I was talking about. It relies solely on MsHid. |
So, is there a chance you were based on an older version of their library/examples? |
...seems after 1.5.2 they later released 1.9 (maybe more unreleased commits are in the source section there) |
In fact others have submitted some patches there that are still under review: http://wiimotelib.codeplex.com/SourceControl/list/patches |
No, only the MsHid connectivity is based on WiimoteLib. Everything else is different. Like said before, try to avoid MsHid. Use the normal Bluetooth providers, like MsBluetooth. |
Did you solve this problem ? I don't have my Wiimotes now (normal Wiimote and Wiimote with motion plus inside) so i can't give you the name of the devices for the moment. I think the only modification that can cause this issue is the inversion of the two providers in As said by @FrozenCow the |
I don't have the balance board available myself, a partner has it. However indeed the problem is the order of the providers I believe. If you add the proper device name to the code (would be needed for all 3 bluetooth-stack based providers) from what I understand the other providers should work, so the Hid one could go to the bottom again. |
Hello,
I have some pain to make your library working with the Wiimotion plus inside controller. I saw that you use different provider for the bluetooth and that the last one (MsHid) contains some commentary very close to some in WiiMote lib (but this library is not cross plateform). I use the toshiba bluetoot stack as i know that the default windows bluetooth stack don't support the new wiimote controller.
My question is, what do i have to implement to make your library to work with MsHid ? It seems that it detect well the wimote but then he don't try to connect to and don't even list is in the testing form.
I hope i'm clear enough, and you will help me to understand what is missing. I will make a pull request as soon as i will solve this problem.
Thx.
The text was updated successfully, but these errors were encountered: