Sponsors of Wiimoteproject.com
IR Pens for Wiimote Whiteboard
Wiimote ProjectHardware SupportBluetooth & Connectivity Help CenterI cant get my *insert Johnnys app name here* to connect Help!
Pages: [1] 2 3
Print
Author Topic: I cant get my *insert Johnnys app name here* to connect Help!  (Read 51506 times)
0 Members and 1 Guest are viewing this topic.
Guru
*
Karma: +16/-0
Posts: 177
Offline Offline
atomriot@hotmail.com colbzilla View Profile
« on: January 13, 2008, 08:09:32 PM »

I initially had issues with the apps i would get from his blog so i started digging around and found that Blue Soliel or whatever its called, has to install its own bluetooth driver on top of yours to get this to work. seeing as how it eventually costs money to use, i wanted to find a way around it.

luckily the fix is pretty easy. I ran the wiilib test app and it worked by itself....hmm but whiteboard doesnt.... What i did was compared the Connect method in the wiimote.cs file from the lib and the whitebaord app (and all of Johnny's other apps) and noticed there was a very small difference.

this is the code from Johnny's apps

Code:
if(attrib.VendorID == VID && attrib.ProductID == PID)
{
    if (!IsRemoteConnected((int)index))
    {
        Debug.WriteLine("Found it!");
        found = true;
        remoteID = (int)index;
        connectedRemoteIDs.Add(remoteID);

        // create a nice .NET FileStream wrapping the handle above
        mStream = new FileStream(mHandle, FileAccess.ReadWrite, REPORT_LENGTH, true);

        // start an async read operation on it
        BeginAsyncRead();

        // read the calibration info from the controller
        ReadCalibration();
        break;
    }
}

What i noticed is the including of the options
Code:
if (!IsRemoteConnected((int)index))
and
Code:
        remoteID = (int)index;
        connectedRemoteIDs.Add(remoteID);

then they have in the wiilib a try catch around teh calibrate method. here is the wiilib snippet

Code:
if (attrib.VendorID == VID && attrib.ProductID == PID)
{
    Debug.WriteLine("Found it!");
    found = true;

    // create a nice .NET FileStream wrapping the handle above
    mStream = new FileStream(mHandle, FileAccess.ReadWrite, REPORT_LENGTH, true);

    // start an async read operation on it
    BeginAsyncRead();

    // read the calibration info from the controller
    try
    {
        ReadCalibration();
    }
    catch
    {
        // if we fail above, try the alternate HID writes
        mAltWriteMethod = true;
        ReadCalibration();
    }

    break;
}

so if you take out the code and make it like the wiilib code, then it should work. i have not, however tried this with multiple wiimotes as i only have one.

hope this helps, and happy wii'ing
Logged

Details, details. Things to do. Things to get done. Don't bother me with details, just tell me when they're done.
--
James Lionel Price

Administrator
Site Admin
*
Karma: +18/-0
Posts: 441
Offline Offline
View Profile WWW Email
« Reply #1 on: January 14, 2008, 07:52:55 AM »

Sticked it!
Logged

*
Karma: +1/-0
Posts: 7
Offline Offline
View Profile
« Reply #2 on: January 17, 2008, 10:35:07 AM »

after editing these lines of code... what is done next? if this source needs to be compiled at all... i wouldn't know what to compile it into, and if it doesn't need to be compiled... this technique hasn't worked out for me. my wiimote is also found by the wiilib test app and not by any of johnny's apps. i just am a little clueless about what to compile the file as, and if it doesn't need to be compiled it's odd that the program doesn't crash because of the lack of the whole file... unless that is exactly what the output would be if there was no file; false.
lets just say that i don't know what to do after that information as been altered and saved because johnny's app is responding the same exact way.
Logged
Guru
*
Karma: +11/-1
Posts: 137
Offline Offline
View Profile
« Reply #3 on: January 17, 2008, 10:44:42 AM »

You need to open the project with visual studio C# (2005 i think, 2008 works for me as well). Then edit the lines, and let it run (press f5) that should already work. So what you need to compile, is the project.
If you edit one of the .cs files, nothing gets changed when running the program from the .exe, because the .cs is just a source file, you can even delete the whole file without any changes to the .exe. So you'll need to download Visual Studio C# i guess. If you don't want to do that, i'll create a .exe with the changes for you (i might just do that right away... Grin)

greetings,
Bart
Logged
*
Karma: +1/-0
Posts: 7
Offline Offline
View Profile
« Reply #4 on: January 17, 2008, 10:49:38 AM »

You need to open the project with visual studio C# (2005 i think, 2008 works for me as well). Then edit the lines, and let it run (press f5) that should already work. So what you need to compile, is the project.
If you edit one of the .cs files, nothing gets changed when running the program from the .exe, because the .cs is just a source file, you can even delete the whole file without any changes to the .exe. So you'll need to download Visual Studio C# i guess. If you don't want to do that, i'll create a .exe with the changes for you (i might just do that right away... Grin)

greetings,
Bart

In doing so you may have just officially made the macbook running Windows Vista with boot camp 2.0  compatible with all of johnny's apps WITHOUT installing any other stack but the original. Smiley
because bluesoleil is extremely not compatible with this setup.
« Last Edit: January 17, 2008, 10:52:56 AM by DiMo » Logged
Guru
*
Karma: +11/-1
Posts: 137
Offline Offline
View Profile
« Reply #5 on: January 17, 2008, 10:57:59 AM »

this is the application i made, i couldn't test it myself because my wiimote isn't at home.
http://rapidshare.com/files/84443940/WiiDesktopVR.exe.html
didn't find any other place to host it. Please test this, and report any bugs to me;)
Logged
*
Karma: +1/-0
Posts: 7
Offline Offline
View Profile
« Reply #6 on: January 17, 2008, 11:06:29 AM »

i replaced the original WiiDesktopVR.exe with this one and the same message still pops up "Cannot find a wii remote: Error reading data from Wiimote...is it connected?"
« Last Edit: January 17, 2008, 11:08:22 AM by DiMo » Logged
Guru
*
Karma: +11/-1
Posts: 137
Offline Offline
View Profile
« Reply #7 on: January 17, 2008, 11:16:19 AM »

Ok, then this solution isn't working for you i guess (unfortunately). I replaced the code like atomriot described and i recompiled the .exe, but it's not working. Ok that's annoying for you Sad . But maybe someone else will come up with some solution. At least my .exe downloadable for anyone that wants to try this method, but doesnt want to install VC#
Logged
*
Karma: +1/-0
Posts: 7
Offline Offline
View Profile
« Reply #8 on: January 17, 2008, 11:17:39 AM »

does this method work for you if you do not use bluesoleil?
Logged
Guru
*
Karma: +11/-1
Posts: 137
Offline Offline
View Profile
« Reply #9 on: January 17, 2008, 11:26:47 AM »

Unfortunately i don't have my wiimote at home (left it at a friends place), but I hope I can try it tonight. Going to school right now as well. Anyway, hope you find a solution soon, since i know how annoying it is when stuff doesnt work like it's supposed to do. On top of that, bluetooth should be a standard by now, and everything should just be able to connect. Apperently it's hard to keep things work with the protocol for some weird reason.
Logged
*
Karma: +1/-0
Posts: 4
Offline Offline
View Profile
« Reply #10 on: January 19, 2008, 08:53:06 PM »

You need to open the project with visual studio C# (2005 i think, 2008 works for me as well). Then edit the lines, and let it run (press f5) that should already work. So what you need to compile, is the project.
If you edit one of the .cs files, nothing gets changed when running the program from the .exe, because the .cs is just a source file, you can even delete the whole file without any changes to the .exe. So you'll need to download Visual Studio C# i guess.

Hi Bart, your fix got the Grid app working on my setup by:
1. Changing the code in WiimoteLib>Wiimote.cs file
2. Running the app by opening WiiMultipointGrid.csproj in Visual C# 2008 and pressing F5

I've scared my wife as I was controlling the grid by moving lighters in mid-air, great fun  Grin.

However, I can't seem to achieve this for the Whiteboard app (which is the one I'm really interested in).
1. I changed the code in WiimoteWhiteboard\source\WiimoteLib\Wiimote.cs
2. Which file should I open in Visual C# 2008 and press F5 to get the app to work? The various ones I tried always crashed at the end of calibration.

I know very little about programming but assumed that if I can get the grid to work there's not reason why the whiteboard should resist me Smiley.

Thanks for your help, and thanks to Johnny for a fantastic idea!
Logged
Guru
*
Karma: +16/-0
Posts: 177
Offline Offline
atomriot@hotmail.com colbzilla View Profile
« Reply #11 on: January 19, 2008, 08:56:54 PM »

the crash at the end of calibration is a cross thread call. in the wiimote.cs add this to your main form constructor

Code:
CheckForIllegalCrossThreadCalls = false;
Logged

Details, details. Things to do. Things to get done. Don't bother me with details, just tell me when they're done.
--
James Lionel Price

*
Karma: +1/-0
Posts: 4
Offline Offline
View Profile
« Reply #12 on: January 19, 2008, 09:00:04 PM »

the crash at the end of calibration is a cross thread call.

Indeed, that's what it said.


in the wiimote.cs add this to your main form constructor

Code:
CheckForIllegalCrossThreadCalls = false;

*newbie blushes* I don't know what my main form constructor is and where it is, but I'm willing to learn!
Logged
Guru
*
Karma: +16/-0
Posts: 177
Offline Offline
atomriot@hotmail.com colbzilla View Profile
« Reply #13 on: January 19, 2008, 09:05:03 PM »

nah man, dont be affraid to ask, thats how you learn.

I have changed the name on mine but it will be after the initialization of the mutex so start at the top and hit control-f for search then type Mutex and hit enter.

the next few lines should contain it.

for example mine looks like this

Code:
public frmMain()

its going to have the same name as your class (hence it being a constructor) so you alternatively can go to the top and where it says

Code:
public partial class frmMain : Form

you can see the name of it and find it below.

good luck!
Logged

Details, details. Things to do. Things to get done. Don't bother me with details, just tell me when they're done.
--
James Lionel Price

*
Karma: +1/-0
Posts: 4
Offline Offline
View Profile
« Reply #14 on: January 19, 2008, 09:38:24 PM »

Awesome, you just made my day! It works, well, I'll play a bit with hardware now (I did the calibration with a LazerTag IR toy gun).
Logged
Pages: [1] 2 3
Print
Jump to:  

Clicky Web Analytics