hyperionjv / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

Wii Remote connection only works about half the time #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect to a WiiRemote (device discovery, connect via 
Conector.open(connectURL) where 
connectURL is a btl2cap address obtained from discovery). An input and output 
port are opened 
on two different PSMs (the PSM is appended to the end of the URL after a colon).
2. Perform various read-write operations. The error occurs when setting the 
input report on the 
Wii Remote.

What is the expected output? What do you see instead?
Reading/writing without problems. An error (below).

What version of the product are you using? On what operating system?
Latest version: bluecove-2.0.2-20080102.194747-73.jar on Mac OS 10.5.1.

Please provide any additional information below. Here's the log of what happens.
michael-diamonds-macbook-pro:WiiRemoteJ mdiamond$ java WRLImpl
BlueCove version 2.0.2-SNAPSHOT on mac
Jan 2, 2008 8:27:49 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: MichaelsPhone...
Jan 2, 2008 8:27:49 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE:  is NOT a WiiRemote. :(
Jan 2, 2008 8:27:51 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: Nintendo RVL-CNT-01...
Jan 2, 2008 8:27:51 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE:  is a WiiRemote!
Jan 2, 2008 8:27:51 PM wiiremotej.WiiRemote construct
INFO: btl2cap://00191DBE34F9
Jan 2, 2008 8:27:51 PM wiiremotej.WiiRemote calibrateAccelerometer
FINER: Calibrating accelerometer...
Jan 2, 2008 8:27:51 PM wiiremotej.WiiRemote$1 run
WARNING: Error, unexpected IO error.
java.io.IOException: Error sending data!
    at wiiremotej.WiiRemote.sendCommand(WiiRemote.java:502)
    at wiiremotej.WiiRemote.setInputReport(WiiRemote.java:763)
    at wiiremotej.WiiRemote.setInputReport(WiiRemote.java:769)
    at wiiremotej.WiiRemote.access$300(WiiRemote.java:60)
    at wiiremotej.WiiRemote$1.run(WiiRemote.java:317)
    at java.lang.Thread.run(Thread.java:613)
Caused by: java.io.IOException: Failed to write [0xe00002bc]
    at com.intel.bluetooth.BluetoothStackOSX.l2Send(Native Method)
    at 
com.intel.bluetooth.BluetoothL2CAPConnection.send(BluetoothL2CAPConnection.java:
113)
    at wiiremotej.WiiRemote.sendCommand(WiiRemote.java:498)
    ... 5 more
Jan 2, 2008 8:27:51 PM wiiremotej.WiiRemote construct
FINER: Initialization complete.
java.io.IOException: Error sending data!
    at wiiremotej.WiiRemote.sendCommand(WiiRemote.java:502)
    at wiiremotej.WiiRemote.setInputReport(WiiRemote.java:763)
    at wiiremotej.WiiRemote.setInputReport(WiiRemote.java:769)
    at wiiremotej.WiiRemote.setAccelerometerEnabled(WiiRemote.java:1451)
    at WRLImpl.main(WRLImpl.java:137)
Caused by: java.io.IOException: Connection is closed
    at com.intel.bluetooth.BluetoothStackOSX.l2Send(Native Method)
    at 
com.intel.bluetooth.BluetoothL2CAPConnection.send(BluetoothL2CAPConnection.java:
113)
    at wiiremotej.WiiRemote.sendCommand(WiiRemote.java:498)
    ... 4 more

 Thanks for your help so far. I hope there's a way to fix this one too!

Original issue reported on code.google.com by ctt...@gmail.com on 3 Jan 2008 at 1:35

GoogleCodeExporter commented 9 years ago
Hi Michael
0) Are you connecting to one Remote at a time or more than one?
1) What type of traffic you get from remote bps or kbps + directions?
2) Does it work fine on avetana?
3) What is "setting the input report" in L2CAP terms.

 If I would have One Wii remote in my office. What I need to do to reproduce the
problem. Need instruction for dummies + url to jar

-- 
Vlad

Original comment by skarzhev...@gmail.com on 3 Jan 2008 at 2:30

GoogleCodeExporter commented 9 years ago
I'm having the same problem. I'm not a hardcore coder, so I can't explain it in
proper terms :) Anyway:

I'm connecting one Wii Remote only, and the exception occures when the remote
Bluetooth activation buttons are pressed prior to the device discovery step. I'm
guessing this has something to do with the bug.

Ctta0s, could this help in building a workaround of some sort?

Original comment by pekka.pu...@gmail.com on 3 Jan 2008 at 4:40

GoogleCodeExporter commented 9 years ago
I see the problem on OSX. Also tested on WIDCOMM and it works fine.

Are application opening two or more L2CAP connections to the same device?

Original comment by skarzhev...@gmail.com on 3 Jan 2008 at 5:10

GoogleCodeExporter commented 9 years ago
I managed to run two L2CAP connections from OSX to different service on another
computer XP+WIDCOMM stack. I can close any of them and open connections again. 
All
works fine.
I used my test application. 

Since WiiRemote is not open source application I can't debug it. Please provide 
more
details how I can reproduce the problem, e.g. general communications diagram 
for your
applications. What happens when.

Original comment by skarzhev...@gmail.com on 3 Jan 2008 at 5:37

GoogleCodeExporter commented 9 years ago
Alright, I'll do a quick outline:
1. Device discovery happens and gets the bluetooth address of the device.
2. A connection is opened on PSM 0x11 for output and on PSM 0x13 for input.
3. A listener thread is started that constantly reads from PSM 0x13.
4. Two outputs are sent:
(hex) 52 12 00 30
(hex) 52 11 00
5. Data is read from the WiiRemote (this involves sending another command).

I think I see the problem. The remote also sends controller status messages, 
and I think this is the problem. 
The exception occurs when this happens (the computer has to send back a 
confirmation similar to the first 
message I wrote). Perhaps the timing of this causes the error.

Original comment by ctt...@gmail.com on 3 Jan 2008 at 6:52

GoogleCodeExporter commented 9 years ago
I think I fixed the problem. One remote was working fine for me and I pressed 
all the
buttons:)

Try the latest build #75
http://www.pyx4me.com/maven2-snapshot/net/sf/bluecove/bluecove/2.0.2-SNAPSHOT/bl
uecove-2.0.2-20080104.002558-75.jar

Original comment by skarzhev...@gmail.com on 4 Jan 2008 at 12:28

GoogleCodeExporter commented 9 years ago
No reply from customer, Now tests seems to work in my environment.

Original comment by skarzhev...@gmail.com on 7 Jan 2008 at 3:36

GoogleCodeExporter commented 9 years ago
Sorry, I've been a bit busy these past few days and didn't have access to a Wii 
Remote until now. Confirmed that 
the problem is fixed. Thanks! :)

Original comment by ctt...@gmail.com on 7 Jan 2008 at 8:18

GoogleCodeExporter commented 9 years ago
Anyone else having problems with the latest builds on this issue? I tried some 
of the nightly builds including the 
one mentioned above but all show the same behaviour. Usually it works the 
second time I launch the WiiRemoteJ 
application (shortly after the first attempt). Does anybody can help?

Original comment by carlo.jo...@gmail.com on 11 Jan 2008 at 4:56

GoogleCodeExporter commented 9 years ago
This is the WiiRemoteJ problem. The code should retry connections properly.
Also it would be nice if WiiRemoteJ would store the device address to be later 
reused
by application.
--
As of now this is not BlueCove bug.

Original comment by skarzhev...@gmail.com on 11 Jan 2008 at 4:59

GoogleCodeExporter commented 9 years ago
Hi,

 The new build does not work with Widcomm 1.6 (using the bluecove.dll for widcomm 1.6
under widnows vista)

 The bluecove-2.0.2 had the same connection problem, but now I have a
"java.lang.IllegalStateException: Bluetooth failed to initialize. There is 
probably a
problem with your local Bluetooth stack or API."

  Do you know where the problem is ?

 Ludovic

Original comment by ludovic....@gmail.com on 11 Jan 2008 at 5:14

GoogleCodeExporter commented 9 years ago
Visa and Widcomm 6 are not supported in main distribution for now
http://code.google.com/p/bluecove/wiki/stacks

You can try and use the dll specially created for Widcomm version 6 
http://bluecove.googlecode.com/svn/build/win-dlls/BTW%20DK%206.1/
I had no time to test it on Vista and change the BlueCove to use this dll on 
Vista.

!!! Tell me how it goes !!!

BUT please use different bug since this one is closed and was for OS X!

Original comment by skarzhev...@gmail.com on 11 Jan 2008 at 5:19