WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem getting more than 1 remote sensing IR
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> WiiremoteJ
View previous topic :: View next topic  
Author Message
Garth



Joined: 22 Dec 2007
Posts: 6

Digg It
PostPosted: Sat Dec 22, 2007 12:07 am    Post subject: Problem getting more than 1 remote sensing IR

I can't get more than 1 remote to sense IR at the same time. My code looks something like this:

for (int i=0; i<2; i++) {
WiiRemote remote = WiiRemoteJ.findRemote();
remote.addWiiRemoteListener(this);
remote.enableContinuous();
remote.setIRSensorEnabled(true, WRIREvent.BASIC);
remote.setAccelerometerEnabled(true);
remote.setLEDIlluminated(i, true);
remote.vibrateFor(100);
}

The problem may have somethign to do with the exception that gets thrown when the 2nd remote connects:

21-Dec-2007 3:53:04 PM wiiremotej.WiiRemoteExtensionFactory registerWiiRemoteExtension
WARNING: Error registering extension.
java.lang.IllegalArgumentException: Code already registered!
at wiiremotej.WiiRemoteExtensionFactory.registerWiiRemoteExtension(WiiRemoteExtensionFactory.java:62)
at wiiremotej.WiiRemote.<init>(WiiRemote.java:223)
at wiiremotej.WiiRemoteDiscoverer.getWiiRemote(WiiRemoteDiscoverer.java:87)
at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:225)
at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:185)

Has anybody else run into this. Is there a solution?

Thanks,
Garth
Back to top
View user's profile Send private message
Classiclll



Joined: 10 Feb 2007
Posts: 94
Location: Japan

Digg It
PostPosted: Sat Dec 22, 2007 12:22 am    Post subject:

this code sample may help you
http://www.wiili.org/forum/multiple-remotes-t2867.html
_________________
Classiclll
Back to top
View user's profile Send private message Visit poster's website
Garth



Joined: 22 Dec 2007
Posts: 6

Digg It
PostPosted: Sat Dec 22, 2007 1:27 am    Post subject:

Thanks for the pointer, but that code isn't working well. I am getting the same Exception, which I suspect is causing my problems. I turned on logging and got what is copied below. One thing I see that is interesting is the statement "FINE: is already connected." when I connect the 2nd remote. Is it somehow getting confused, thinking the 2nd Wiimote is the 1st Wiimote? This is all a guess, of course, as we don't have access to the source.

BlueCove version 2.0.1 on widcomm
21-Dec-2007 5:19:49 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: Nintendo RVL-CNT-01...
21-Dec-2007 5:19:49 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: is a WiiRemote!
21-Dec-2007 5:19:50 PM wiiremotej.WiiRemote <init>
INFO: btl2cap://00191D7E00EA
21-Dec-2007 5:19:50 PM wiiremotej.WiiRemote calibrateAccelerometer
FINER: Calibrating accelerometer...
21-Dec-2007 5:19:50 PM wiiremotej.WiiRemote <init>
FINER: Initialization complete.
21-Dec-2007 5:19:50 PM wiiremotej.WiiRemoteJ findRemote
FINEST: Nintendo RVL-CNT-01
21-Dec-2007 5:19:50 PM wiiremotej.WiiRemote$1 run
FINEST: Data write finished.
21-Dec-2007 5:19:50 PM wiiremotej.WiiRemote$1 run
FINEST: Data write finished.
21-Dec-2007 5:19:54 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: Nintendo RVL-CNT-01...
21-Dec-2007 5:19:54 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: is already connected.
21-Dec-2007 5:19:54 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: Nintendo RVL-CNT-01...
21-Dec-2007 5:19:54 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: is a WiiRemote!
21-Dec-2007 5:19:55 PM wiiremotej.WiiRemoteExtensionFactory registerWiiRemoteExtension
WARNING: Error registering extension.
java.lang.IllegalArgumentException: Code already registered!
at wiiremotej.WiiRemoteExtensionFactory.registerWiiRemoteExtension(WiiRemoteExtensionFactory.java:62)
at wiiremotej.WiiRemote.<init>(WiiRemote.java:223)
at wiiremotej.WiiRemoteDiscoverer.getWiiRemote(WiiRemoteDiscoverer.java:87)
at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:225)
at wiiremotej.WiiRemoteJ.access$100(WiiRemoteJ.java:22)
at wiiremotej.WiiRemoteJ$2.run(WiiRemoteJ.java:301)
at java.lang.Thread.run(Unknown Source)
21-Dec-2007 5:19:55 PM wiiremotej.WiiRemoteExtensionFactory registerWiiRemoteExtension
WARNING: Error registering extension.
java.lang.IllegalArgumentException: Code already registered!
at wiiremotej.WiiRemoteExtensionFactory.registerWiiRemoteExtension(WiiRemoteExtensionFactory.java:62)
at wiiremotej.WiiRemote.<init>(WiiRemote.java:224)
at wiiremotej.WiiRemoteDiscoverer.getWiiRemote(WiiRemoteDiscoverer.java:87)
at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:225)
at wiiremotej.WiiRemoteJ.access$100(WiiRemoteJ.java:22)
at wiiremotej.WiiRemoteJ$2.run(WiiRemoteJ.java:301)
at java.lang.Thread.run(Unknown Source)
21-Dec-2007 5:19:55 PM wiiremotej.WiiRemote <init>
INFO: btl2cap://001AE9FC7D01
21-Dec-2007 5:19:58 PM wiiremotej.WiiRemote calibrateAccelerometer
FINER: Calibrating accelerometer...
21-Dec-2007 5:19:58 PM wiiremotej.WiiRemote <init>
FINER: Initialization complete.
21-Dec-2007 5:19:58 PM wiiremotej.WiiRemote$1 run
FINEST: Data write finished.
21-Dec-2007 5:19:58 PM wiiremotej.WiiRemote$1 run
FINEST: Data write finished.
21-Dec-2007 5:19:58 PM wiiremotej.WiiRemote$1 run
FINEST: Data write finished.
21-Dec-2007 5:19:58 PM wiiremotej.WiiRemote$1 run
FINEST: Data write finished.
21-Dec-2007 5:20:07 PM wiiremotej.WiiRemote disconnect
FINE: Someone ordered a disconnect?
BlueCove stack shutdown completed
Back to top
View user's profile Send private message
Garth



Joined: 22 Dec 2007
Posts: 6

Digg It
PostPosted: Sat Dec 22, 2007 1:33 am    Post subject:

I realize now that the "is already connected" output is probably occuring when it notices the same 1st Wiimote a 2nd time. After that it does in fact find a new 2nd Wiimote.

The fact remains that the IR input is not working for multiple Wiimotes, and that one exception that keeps popping up is suspicious.

Thanks,
Garth
Back to top
View user's profile Send private message
Classiclll



Joined: 10 Feb 2007
Posts: 94
Location: Japan

Digg It
PostPosted: Sat Dec 22, 2007 2:02 am    Post subject:

sorry for wrong point.
i have met the same exception
http://www.wiili.org/forum/2-or-more-wiiremotes-connection-t2483.html

with ignoring this warning message, two acceleration from each remote were well distinguished, but no try for IRSensor.

i think the IRdata can be distinguished too.
_________________
Classiclll
Back to top
View user's profile Send private message Visit poster's website
Garth



Joined: 22 Dec 2007
Posts: 6

Digg It
PostPosted: Wed Dec 26, 2007 10:19 pm    Post subject:

Thanks for the tips. I do get an instance of the Wiimote object by ignoring the exception. Unfortunately after doing so it seems enabling IR sensing has no effect. it seems either there is something strange with my setup, or IR sensing from multiple Wiimotes doesn't work with this library.

It _sure_ would be nice if we had the code available to us. It seems like development may have stopped, so I may have to move to some other project if we can't get the code.

Thanks,
Garth
Back to top
View user's profile Send private message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 493

Digg It
PostPosted: Thu Dec 27, 2007 2:27 am    Post subject:

Ack! I thought I had already put out an update correcting that. Blech. Sorry for my forgetfulness. The fix for that has been sitting on my computer for ages. Embarassed

Anyway, I'll put out an update later tonight. Sorry for the inconvenience!

EDIT: Uploaded! You can obtain WiiRemoteJ v1.1 here. Standalone docs (which are included with the release) are here.
Note that I haven't had time to test, so please report any problems by starting a new thread (or posting to an existing one if it's an old bug). Thanks!
_________________
Cha0s
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> WiiremoteJ All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group