ソース表示: EnglishHere #21117

= lll's Project Wiki =
[[PageOutline]]

Well come to the library project of [http://blogs.yahoo.co.jp/classiclll_jp Classiclll]

These libraries are the external libs of [http://processing.org Processing/Proce55ing]

== Entry Pages ==
 * HowTo
 * [Wrj4P5(en) Wrj4P5] - WiiRemote access library for [http://processing.org Processing] powered by [http://www.wiili.org/index.php/WiiremoteJ WiiRemoteJ]
 * [Loc(en) Loc] - Package for 3D-Algebra and Linear operation([Wrj4P5(en) Wrj4P5] may need [Loc(en) Loc])
 * [l4P5] - static methods collection, drawing a instance of [Loc(en) Loc] for [http://processing.org Processing/Proce55ing]

== Processing Links ==
 * [http://processing.org/ processing.org]
 * [http://www.google.com/search?q=built+with+processing BuiltWithProcessing] - google sketches
 * [http://www.google.com/search?q=proce55ing World's Processing Gellery] - google Proce55ing
 * [isbn:0262182629 Processing: A Programming Handbook for Visual Designers and Artists] Casey Reas, Ben Fry
 * [isbn:159059617X Processing: Creative Coding and Computational Art (Foundation)] Ira Greenberg
 
== Proce55ing Gallery ==
 * [http://processing.org/exhibition/ Processing Gallery] 
 * [http://images.google.com/images?q=built+with+processing&um=1&sa=N&tab=wi World's Processing Gellery] - google image
 * [http://www.geocities.jp/classiclll_newweb/index.html My gallery] - Classiclll's Gallery

== [http://www.wiili.org/index.php/WiiremoteJ WiiRemoteJ] by Cha0s ==
 * [http://www.wiili.org/index.php/Main_Page wiili.org] 
 * [http://www.wiili.org/index.php/WiiremoteJ WiiRemoteJ] - by Cha0s
 * Bluetooth java library ([http://en.wikipedia.org/wiki/JSR-82 JSR82])
   * see the following Tips.(Edit: Dec.15.2007)

=== [http://www.wiili.org/forum/wiiremotej-tips-t2815.html Tips] for [http://www.wiili.org/index.php/WiiremoteJ WiiRemoteJ], by Cha0s ===
 1. Windows users should user either the [http://code.google.com/p/bluecove/ BlueCove] [http://en.wikipedia.org/wiki/JSR-82 JSR82] library (with BlueSoleil or WIDCOMM stack) or the [http://www.avetana-gmbh.de/avetana-gmbh/jsr82.xml Avetana] library (with WIDCOMM stack). Linux users should use  [http://sourceforge.net/projects/avetanabt/ Avetana] (with BlueZ stack). Mac users should use  [http://www.avetana-gmbh.de/avetana-gmbh/jsr82.xml Avetana] or [http://code.google.com/p/bluecove/ BlueCove](with the built-in stack). 
 2. Make sure to put the library in the extensions folder (as described in the readme). On Windows, you may also need to add the path of the library to the Windows system PATH variable. 
 3. To connect to the remote, use [http://www.wiili.org/index.php/WiiremoteJ WiiRemoteJ]'s findRemote methods. DO NOT connect to the remote beforehand with the stack utilities. [http://www.wiili.org/index.php/WiiremoteJ WiiRemoteJ] handles the entire connection process and will not be able to connect if the remote is already connected. 
 4. If you're still having trouble, check the [http://www.wiili.org/index.php/WiiremoteJ/FAQ FAQ]. If that fails, [http://www.wiili.org/forum/wiiremotej-f68.html post] a stack trace, your OS, Java version, bluetooth stack, and [http://en.wikipedia.org/wiki/JSR-82 JSR82] implementation. We'll see what we can do to help.

  LINUX NOTE 

  If you get errors that look like this: 
{{{ Code java
  Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError:
              de.avetana.bluetooth.stack.BlueZ.cancelInquiry()V 
     at de.avetana.bluetooth.stack.BlueZ.cancelInquiry(Native Method) 
     at javax.bluetooth.DiscoveryAgent.cancelInquiry(DiscoveryAgent.java:265) 
     at wiiremotej.WiiRemoteDiscoverer.deviceDiscovered(WiiRemoteDiscoverer.java:68) 
     at javax.bluetooth.DiscoveryAgent.deviceDiscovered(DiscoveryAgent.java:284) 
     at de.avetana.bluetooth.stack.BlueZ.hciInquiry(Native Method) 
     at javax.bluetooth.DiscoveryAgent$1.run(DiscoveryAgent.java:208) 
     at edu.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
               (PooledExecutor.java:743) 
     at java.lang.Thread.run(Thread.java:619)
}}}
  Then try this (tip provided by realjab): 
  Open Bluez.cpp. 
  Add the following code: 
{{{  Code java
  JNIEXPORT void JNICALL Java_de_avetana_bluetooth_stack_BlueZ_cancelInquiry
   (JNIEnv *env, jclass obj) { 
     /* Close the specified HCI device */ 
     //printf("Function called: %s, %i\n"__FILE__, __LINE__); 
     //hci_close_dev(dd); 
     return; 
  }
}}}
  After completing the change don't forget to ./configure and ./install avetana to get the new .jar and the new .so file.
[[BR]]

  UBUNTU (GUTSY) NOTE -- fix courtesy of Nemno 

  If you're using the Avetana stack and your programs are hanging on the following message: "FINER: Calibrating accelerometer..." 
  Do the following:
     a. Download the latest Avetana source. 
     b. Go to your avetana source directory and open de/avetana/bluetooth/stack/BlueZ.java 
     c. Somewhere around line 317, change line 
{{{
  int receiveMTU=672, transmitMTU=672; 
}}}
      to
{{{
  int receiveMTU=-1, transmitMTU=-1; 
}}}
     d. Do a "make clean" 
     e. Make sure your envvariables are correct. Then do a "./install" 
[[BR]]
  Copy the compiled files to your WiiRemotej directory. And you're set! 
  Explanation of the problem (for those who are curious; not necessary to get it to work): 
  Verbatim from Nemno. 

  The problem with the avetana was that when you open a connection the LCAP protocol does some handshake things. 
{{{
 avetana : I request a config 
 wiimote : Ok set your MTU size on 185 
 avetana : I am ignorant so i'll use MTU size of 672 
 wiimote : See Yaa 
}}}
  after fix 
{{{
 avetana : I request a config 
 wiimote : Ok set your MTU size on 185 
 avetana : Ok setting MTU size on 185 
 wiimote : nice doing business 
 avetana : blabla 
 wiimote : blala 
 etc..etc...
}}}
_________________

=== Tips for P5 sketch, by blindfish ===
A couple of useful tips for others trying this out: 

 1. When I first connect the Wiimote up to Bluetooth it remains in discovery mode. When I then try and connect to the Processing application with 1 & 2 nothing happens. I've found that first pressing the Wiimote power button to 'switch it off' and then hitting 1 & 2 to enter discovery mode gets around this problem. Subsequent attempts to connect should work fine with just 1 & 2 as long as you do the following: 
 2. Make sure you 'switch off' your Wiimote before closing your Processing application so that you see the "Remote disconnected" message in the output window. In my case if I fail to do this it buggers something up with the Bluetooth stack which seems to require a system restart to fix 

By following these two steps I'm finding this fairly reliable and can now definitely get on with some experimenting

SandField