Coder Social home page Coder Social logo

Comments (16)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
I just saw defect 23, and think they're related.
I'm using the release 2.0.2 of bluecove, should I try one of the newer builds?

Original comment by [email protected] on 16 Jan 2008 at 10:04

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Can you please add system property -Dbluecove.debug=true and attach the result 
output
log file.


The defect 23 was fixed in release 2.0.2.


Also the problem is that apparently WiiRemote device is closing the L2CAP 
connection
on its end. The exception "IOException: Connection closed" indicates this.

If you run again "3. Close and re-run the application"  multiple times whats 
happening?

Original comment by [email protected] on 16 Jan 2008 at 3:42

  • Added labels: OpSys-OSX

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi!

When I start the program several times in a row it eventually works.
Sometimes I need to restart ten times to get it working, other times it works 
two or
three times in a row.
I also found that the best way to close the program in terms of maximizing the 
chance
of it working again seems to be to disconnect the wiimote by pressing its 
connect button.
If I terminate the program manually it tends to not work more often, but it also
fails very often using the other method.

I'm currently at work so I cannot post a debug log right now, I'll try to 
upload one
this evening.

Thanks for your quick reply!

Original comment by [email protected] on 17 Jan 2008 at 9:38

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
As far as I can understand the problem is in WiiRemote application.
Since application is Closed Source I can't advise what is wrong with it.
As far as I can tell bluecove does not close open connection when application is
terminated. This may be a bug....
The best option is to try evaluation version of avetanaBluetooth and see if you 
have
the same problems.

Original comment by [email protected] on 17 Jan 2008 at 4:40

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
[deleted comment]

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi!

Sorry for not answering for such a long time, but I became the father of two 
cute
little girls several days ago and therefore don't have too much free time on my 
hands
right now... ;)

I'll try it out with the avetana eval and let you know of the results...

OT: I received Mail that there was another reply to this thread, why can't I 
see it
here?!?

Original comment by [email protected] on 1 Feb 2008 at 11:09

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Another problem was moved to this page:
http://code.google.com/p/bluecove/issues/detail?id=27
BTW it was resolved.

Congratulations on your family additions.


Original comment by [email protected] on 1 Feb 2008 at 3:22

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
I was having similar problems with WiiRemoteJ and bluecove. I think the problem 
is 
that the Wiimote only listens for a connection for a short time (maybe 15 
seconds), 
and then gives up. Sometimes it gives up right when WiiRemoteJ is trying to 
open a 
connection. Unfortunately the version of WiiRemoteJ I was using didn't fail 
gracefully when this happens, and instead assumes that the connection is open, 
when 
it isn't. This results in failures in sending data.

As a solution I went and wrote my own Wiimote library, which is very simple, 
but 
fails gracefully when a connection opening fails, and retries the connection 
opening 
until it works.

What would help this problem, either at the bluecove or possible driver level 
would 
be to look at why opening L2CAP connections can take so long. I know on my 
actual 
Nintendo Wii connections to the Wiimote are formed almost instantly, while 
connections to a Wiimote via bluecove can sometimes take 5 or 10 seconds, 
during 
which failure can occur.

Garth

Original comment by [email protected] on 9 Feb 2008 at 1:18

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
By the way the above problems occured on both OS X and Windows platforms.

Original comment by [email protected] on 9 Feb 2008 at 1:20

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Actual Nintendo Wii does connect to Wiimote instantly because it remembers the
address of the Wiimote device. The WiiRemoteJ (Example app that I have seen) 
does
discovery all the time. Bluetooth discovery takes 5-10 seconds. WiiRemote is
discoverable and connectable only for 20 seconds since you pressed the 
buttons.....

So I think the WiiRemoteJ should be changed to work differently.

Original comment by [email protected] on 9 Feb 2008 at 3:14

  • Changed state: WontFix

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Thank you for looking into this, I'll forward your replies to the WiiRemoteJ 
Developer.
Maybe he can fix this.

Cheers!

Original comment by [email protected] on 12 Feb 2008 at 7:44

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
I ran some tests (using bluecove-2.0.3-20080210.060324-26). I had absolutely 
zero problems when I waited 
5 seconds or so after calling the findRemote() method before making the Wii 
Remote discoverable (I think 
what is more relevant actually, is that it's about 1 or 2 seconds after devices 
start to be discovered, e.g. my 
phone). In these cases, the remote was detected almost immediately and 
proceeded to connect without 
problems. If I try before this time, it's a toss-up: sometimes it works; other 
times... not. I get two different 
types of errors, show below.

Error 1:

BlueCove version 2.0.3-SNAPSHOT on mac
Feb 12, 2008 6:29:49 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: Found Nintendo RVL-CNT-01 (0017AB29BB7B)
Feb 12, 2008 6:29:49 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: Nintendo RVL-CNT-01 is a WiiRemote.
Feb 12, 2008 6:29:50 PM wiiremotej.WiiRemote construct
INFO: btl2cap://0017AB29BB7B
Feb 12, 2008 6:29:51 PM wiiremotej.WiiRemoteDiscoverer getWiiRemote
SEVERE: Error getting device!
java.io.IOException: WiiRemote failed to connect!
    at wiiremotej.WiiRemote.construct(WiiRemote.java:290)
    at wiiremotej.WiiRemote.<init>(WiiRemote.java:214)
    at wiiremotej.WiiRemoteDiscoverer.getWiiRemote(WiiRemoteDiscoverer.java:94)
    at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:208)
    at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:186)
    at WRLImpl.main(WRLImpl.java:135)
Caused by: javax.bluetooth.BluetoothConnectionException: Failed to open 
connection(3)
    at com.intel.bluetooth.BluetoothStackOSX.l2OpenClientConnectionImpl(Native Method)
    at com.intel.bluetooth.BluetoothStackOSX.l2OpenClientConnection(BluetoothStackOSX.java:604)
    at com.intel.bluetooth.BluetoothL2CAPClientConnection.<init>(BluetoothL2CAPClientConnection.java:33)
    at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:397)
    at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:506)
    at javax.microedition.io.Connector.open(Connector.java:95)
    at wiiremotej.WiiRemote.construct(WiiRemote.java:284)
    ... 5 more

Error 2:

BlueCove version 2.0.3-SNAPSHOT on mac
Feb 12, 2008 6:31:14 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: Found Nintendo RVL-CNT-01 (0017AB29BB7B)
Feb 12, 2008 6:31:14 PM wiiremotej.WiiRemoteDiscoverer deviceDiscovered
FINE: Nintendo RVL-CNT-01 is a WiiRemote.
Feb 12, 2008 6:31:15 PM wiiremotej.WiiRemote construct
INFO: btl2cap://0017AB29BB7B
Feb 12, 2008 6:31:15 PM wiiremotej.WiiRemote calibrateAccelerometer
FINER: Calibrating accelerometer...
Feb 12, 2008 6:31:15 PM wiiremotej.WiiRemote calibrateAccelerometer
WARNING: Unable to calibrate accelerometer!
Feb 12, 2008 6:31:15 PM wiiremotej.WiiRemote construct
WARNING: Error calibrating accelerometer.
java.io.IOException: Error sending data!
    at wiiremotej.WiiRemote.sendCommand(WiiRemote.java:502)
    at wiiremotej.WiiRemote.readData(WiiRemote.java:1260)
    at wiiremotej.WiiRemote.readData(WiiRemote.java:1212)
    at wiiremotej.WiiRemote.calibrateAccelerometer(WiiRemote.java:1286)
    at wiiremotej.WiiRemote.construct(WiiRemote.java:479)
    at wiiremotej.WiiRemote.<init>(WiiRemote.java:214)
    at wiiremotej.WiiRemoteDiscoverer.getWiiRemote(WiiRemoteDiscoverer.java:94)
    at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:208)
    at wiiremotej.WiiRemoteJ.findRemote(WiiRemoteJ.java:186)
    at WRLImpl.main(WRLImpl.java:135)
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)
    ... 9 more
Feb 12, 2008 6:31:15 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:138)
Caused by: java.io.IOException: Connection 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
Feb 12, 2008 6:31:24 PM wiiremotej.WiiRemote$1 run
FINE: Wii Remote disconnected.
Remote disconnected... Please Wii again.
BlueCove stack shutdown completed

In error 1 it simply fails to open a connection. It's interesting to note that 
with error 2, the read stream is still 
open, since it closes when the remote's disconnect button is held down. The 
write stream is closed, however, 
as indicated by the error. I'm not sure why this pause is necessary. I can tell 
you what WiiRemoteJ is doing and 
maybe you can tell me if there's anything wrong in there. I don't think 
anything I'm doing is outside of the 
API, though.

1. Someone calls findRemote()
2. findRemote makes sure no other find methods are running.
3. findRemote starts device inquiry via startInquiry(DiscoveryAgent.GIAC, 
discoverer) (using a discovery agent 
initialized in a static constructor for WiiRemoteJ)
4. findRemote waits until the inquiry ends (using wait() and a synchronized 
method).
5. In deviceDiscovered: deviceDiscovered checks that the remote isn't one of 
the remotes that was already 
found and connected.
6. deviceDiscovered saves the address of the remote.
6. deviceDiscovered cancels the inquiry.
7. As a result of the inquiry completing (being canceled), the thread running 
findRemote is notified and grabs 
the address of the remote from the discoverer and passes to the WiiRemote 
constructor.
8. The constructor opens two connections in this order:
sendCon = (L2CAPConnection)Connector.open(connectURL+":"+O_CHANNEL, 
Connector.WRITE);
receiveCon = (L2CAPConnection)Connector.open(connectURL+":"+I_CHANNEL, 
Connector.READ);
(O_CHANNEL = 11, I_CHANNEL = 13)
9. A listener is started that reads from the input stream.
10. A bunch of output is sent down the output stream. I can tell you the 
precise data if that will help.

If that's not helpful, I can send you some of the code.

P.S. garthubc, the problem is not with the remote not being connected fast 
enough. It's usually only 
discoverable for no more than 5 or 10 seconds before something happens. In 
addition, the connection 
definitely is open at some point because the remote successfully requests and 
receives calibration data for the 
accelerometer. After this, for an unknown reason, the output connection is 
closed (see error 2). In error 1, the 
connections are not opened and the program gracefully throws an exception.

Original comment by [email protected] on 13 Feb 2008 at 12:22

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi,

I was seeing:

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:138)
Caused by: java.io.IOException: Connection 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


but noticed two things:

1) the connection works (but not the output connection) so I can receive input 
from
the wiimote.

2) it seemed to work (even the output connection) when I held A and B 
simutaneaously.

The exact order was 1&2 on the remote, held A and B , started my java program to
discover the remote.

Shawn

Original comment by [email protected] on 8 Nov 2008 at 3:58

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hi, is anybody using the wiiremotej to interface with the wii balance board? i 
have tried and modified the sample code attached in this library but i always 
got error message. Here is the error:

28-Jun-2011 14:20:38 wiiremotej.WiiDeviceDiscoverer deviceDiscovered
FINE: Found <No Name> (0017AC006F84)
28-Jun-2011 14:20:39 wiiremotej.WiiDeviceDiscoverer deviceDiscovered
FINE: <No Name> is NOT a known device.

why and my program can only run once, i mean after the first time it is run, i 
will get no response when i try to run it second time. Thanks!

below is the code:


package summer.wiiboard;

/**
 *
 * @author Mat
 */


import java.awt.*;
import javax.swing.*;
import wiiremotej.*;
import wiiremotej.event.*;
import java.io.*;


public class BBImpl extends BalanceBoardAdapter
{
    private BalanceBoard board;
    private static JFrame graphFrame;
    private static JPanel graph;
    private static double massX;
    private static double massY;



    public static void main(String args[])
    {
        java.lang.System.setProperty("bluecove.jsr82.psm_minimum_off", "true");
        java.lang.System.setProperty("bluecove.stack.first", "widcomm");
        //basic console logging options...
        WiiRemoteJ.setConsoleLoggingAll();
        //WiiRemoteJ.setConsoleLoggingOff();
        try
        {
            graphFrame = new JFrame();
    //        graphFrame.setTitle("Mass Graph");
            graphFrame.setTitle("Center of gravity graph: Balance Board");
            graphFrame.setSize(800, 600);
            graphFrame.setResizable(false);

            graph = new JPanel()
            {
                public void paintComponent(Graphics graphics)
                {
                    graphics.clearRect(0, 0, 800, 600);
                    graphics.fillRect(0, 0, 800, 600);
                    graphics.setColor(Color.WHITE);
                    graphics.drawLine(0, 300, 800, 300);
                    graphics.drawLine(400, 0, 400, 600);

                    graphics.setColor(Color.RED);
                    graphics.fillOval((int)(massX * 800+400-15), (int)(massY * 600+300-15), 30, 30);
                }
            };

            graph.setDoubleBuffered(true);
            graphFrame.add(graph);
            graphFrame.setVisible(false);
            //Find and connect to a Balance Board
            BalanceBoard board = null;
            System.out.println("Please press the red syn button.");

            while (board == null) {
               try {
                    System.out.println("Trying to connect.");
                    board = WiiRemoteJ.findBalanceBoard();

               }
                    catch(Exception e) {
                    board = null;
                    e.printStackTrace();
                    System.out.println("Failed to connect board. Trying again.");
                }

           }


            System.out.println("Wii Balance Board is connected.");

            board.addBalanceBoardListener(new BBImpl(board));
            board.setLEDIlluminated(true);

            final BalanceBoard boardF = board;
            Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){public void run(){boardF.disconnect();}}));
        }
        catch(Exception e){e.printStackTrace();}
    }

    public BBImpl(BalanceBoard board)
    {
        this.board = board;
    }

    public void disconnected()
    {
        System.out.println("Board disconnected... Please Wii again.");
        System.exit(0);
    }


    public void massInputReceived(BBMassEvent evt)
    {
        double massTL = evt.getMass(MassConstants.TOP, MassConstants.LEFT);
        double massTR = evt.getMass(MassConstants.TOP, MassConstants.RIGHT);
        double massBL = evt.getMass(MassConstants.BOTTOM, MassConstants.LEFT);
        double massBR = evt.getMass(MassConstants.BOTTOM, MassConstants.RIGHT);

        if (evt.getTotalMass() > 3) { // if mass is too small, don't bother
            double topMass = massTL + massTR;
            double bottomMass = massBL + massBR;
            double leftMass = massTL + massBL;
            double rightMass = massTR + massBR;

            double vertRange = topMass + bottomMass;
            double horizRange = rightMass + leftMass;

            massX = (rightMass-leftMass)/horizRange;
            massY = -(topMass-bottomMass)/vertRange;
        }
        else {
            massX = 0;
            massY = 0;
        }

        graph.repaint();
    }

    public void buttonInputReceived(BBButtonEvent evt) {
        if (evt.wasPressed()) {
            System.out.println("Disconnecting! Please Wii again.");
            System.exit(0);
        }
    }


}

Original comment by [email protected] on 28 Jun 2011 at 1:39

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
[deleted comment]

from bluecove.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 16, 2024
Hello. 
I had the same problem and I solved uninstalling the bluetooth stack from my OS 
and installing widcomm bluetooh stack.

You can follow this link to help:
http://forum.notebookreview.com/sony/114793-how-install-widcomm-bluetooth-stack-
v5-1-0-1100-xp-vista-sz.html

and download the widcomm stack from here:
http://search.4shared.com/postDownload/IkKlX58B/Widcomm_501801_bluetooth_drive.h
tml

good luck for all.

Original comment by [email protected] on 3 Dec 2011 at 10:27

from bluecove.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.