Bluetooth Connection Address

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

Bluetooth Connection Address

Postby Jochi » Wed Jan 23, 2008 1:06 pm

Hello Again,

I am using iCommand 0.6 with the original Lego NXT firmware. After finally managing to pair my devices I am still unable to get any code working remotely.

I have set the classpaths correctly (icommand.jar & bluecove.jar) as my code always compiles fine. However whenever I run the code I get the same error: -

C:\ProgramFiles\iCommand\icommand-0.6\samples>java nxjtest
Exception in thread "main" java.lang.NoClassDefFoundError: nxjtest
NXJTest)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Sour
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Metho
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Sourc
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I believe my problem is with the icommand.properties file (shown below). As far as I can tell I have set the comm port correctly (COMM10) and have changed the NXT's bluetooth address correctly.

# iCommand Properties File. iCommand will attempt to detect your NXT BT address
# automatically with Bluecove. Feel free to override the auto-settings on your own.

# Communication implementation type: bluecove
nxtcomm.type=bluecove
# The bluetooth address of ->your<- NXT, e.g. 00:16:53:01:EC:04

# nxt.btaddress=00:0A:3A:7D:FC:6D

# Communication implementation type: bluez
# nxtcomm.type=bluez
# The bluetooth address of ->your<- NXT, e.g. 00:16:53:01:EC:04

nxt.btaddress=00:16:53:00:0d:59
# or use:
# bluez.address=00:0A:3A:7D:FC:6D

# Communication implementation type: rxtx or sun (if using Javacomm)
# nxtcomm.type=rxtx
# The name of ->your<- serial port for bluetooth
# e.g. COM4 (on Windows), dev/tty.NXT_1 (on Mac OSX),
# /dev/rfcomm0 (on Linux)
nxtcomm=COM10
# or use:
# rxtx.port=COM10


Have I set this file correctly? If so can anyone shed any light on where I'm going wrong?

Thanks,
Jochi
User avatar
Jochi
Novice
 
Posts: 26
Joined: Tue Nov 06, 2007 8:17 pm
Location: Guildford, UK

Postby Jochi » Wed Jan 23, 2008 1:49 pm

Just to add on to the above. I have rxtx installed but not configured as I did not realise at the time that it was not needed for icommand 0.6 (due to some documentation not being updated).

Cheers,
Jochi
User avatar
Jochi
Novice
 
Posts: 26
Joined: Tue Nov 06, 2007 8:17 pm
Location: Guildford, UK

Postby jvance » Thu Jan 24, 2008 2:21 am

Hi,
Maybe you should try java NXJTest. I assume you are testing out the demo NXJTest.class file, and you don't have your own nxjtest.
Maybe this will help.
V
jvance
New User
 
Posts: 22
Joined: Sun Aug 12, 2007 2:22 am

Postby Jochi » Thu Jan 24, 2008 10:01 am

Maybe you should try java NXJTest. I assume you are testing out the demo NXJTest.class file, and you don't have your own nxjtest.


Hi JVance,

Thanks for your reply.

I have tried pretty much all the sample files (including java NXJTest) that come with icommand. They all compile fine, but when I try to run them (either the pre-compiled versions or the ones that I compile) I get the error shown. I'm guessing I'm missing something obvious somewhere, but can't for the life of me figure out what it is. Over a week I've had this problem now :oops: :oops:

Thanks,
Jochi
User avatar
Jochi
Novice
 
Posts: 26
Joined: Tue Nov 06, 2007 8:17 pm
Location: Guildford, UK

Postby jvance » Fri Jan 25, 2008 12:54 am

Hi,
Maybe your CLASSAPTH variable doesn't include a .;
The .; tells java search the directories in the CLASSAPTH including the current directory. If Java is searching the current directory, it isn't going to find that class file no matter what you do.
If this doesn't work, show me your CLASSPATH
Jvance
jvance
New User
 
Posts: 22
Joined: Sun Aug 12, 2007 2:22 am

Postby Jochi » Fri Jan 25, 2008 11:41 am

Hi Jvance

My CLASSPATH is as follows and contains the .; as you suggested. The last file location is for QuickTime. Do you think having that there is causing a clash somewhere?

.;C:\ProgramFiles\icommand-0.6\dist\icommand.jar;C:\ProgramFiles\icommand-0.6\dist\bluecove.jar;C:\Program Files\Java\jre1.6.0_03\lib\ext\QTJava.zip;

I was under the (could quite easily be the wrong) impression that the CLASSPATH was only used when compiling. Therefore if the code compiles, which it does, the CLASSPATH must be correct?

I have also tried using icommand 0.7, but with no success. I get the same problems.

Thanks,
Jochi
User avatar
Jochi
Novice
 
Posts: 26
Joined: Tue Nov 06, 2007 8:17 pm
Location: Guildford, UK

Postby kirkpthompson » Fri Jan 25, 2008 1:43 pm

what version of java is being used [in your path]? Type
Code: Select all
java -version

at a cmd prompt
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby kirkpthompson » Fri Jan 25, 2008 1:48 pm

What is your path? at cmd prompt:
Code: Select all
path

or
Code: Select all
set path
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby Jochi » Fri Jan 25, 2008 5:58 pm

Hi Kirkpthompson

My path at cmd is:
Code: Select all
C:\>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\VXIPNP\WinNT\Bin;C:\Program Files\Java\jdk1.6.0_03\bin;C:\Program Files\Common Files\Adobe\AGL;

My java version is:
Code: Select all
C:\>java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)


Thanks,
Jochi
User avatar
Jochi
Novice
 
Posts: 26
Joined: Tue Nov 06, 2007 8:17 pm
Location: Guildford, UK

Postby Jochi » Fri Jan 25, 2008 6:01 pm

Could it be anything to do with the fact that I have Java installed in the directory
Code: Select all
C:\Program Files\Java

but have icommand installed in the directory
Code: Select all
C:\ProgramFiles\icommand

i.e. the space in 'Program Files' is causing issues. But then again if it's compiling that shouldn't be causing a problem?
:? :? :?

Jochi
User avatar
Jochi
Novice
 
Posts: 26
Joined: Tue Nov 06, 2007 8:17 pm
Location: Guildford, UK

Postby kirkpthompson » Fri Jan 25, 2008 8:05 pm

Hmmmm....

So, you are in a cmd window, cwd is C:\ProgramFiles\iCommand\icommand-0.6\samples, and type
Code: Select all
java nxjtest

you get the error output in your first post...

I have compared your path and classpath (comparatively) to mine and it works. Hmmmmm.....

It really should work. Let me think some more....

ps. the space in the path for the JRE shouldn't be an issue.
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Postby lawrie » Fri Jan 25, 2008 11:28 pm

Hi Jochi,

What error do you get when you type:

java NXJTest

You have not told us. In your original post the error was due to typing "nxjtest" not "NXJTest". This wasn't very clear as the stack trace you posted had the last bit of lots of the lines cut off and was not showing the bit that said (wrong name: NXJTest). When you run a class that has the correct name, iCommand should output a message giving the name of the property file you are using. Your property file is a bit inconsistent. Since you have nxtcomm.type=bluecove (not rxtx), you do not need nxtcomm=COM10.
lawrie
leJOS Team Member
 
Posts: 840
Joined: Mon Feb 05, 2007 1:27 pm

Postby Jochi » Sun Jan 27, 2008 1:12 pm

Hi Lawrie,

Sorry, yes I have cut off parts of the output in my post by mistake.

I have changed my properties file to just specify: -

Code: Select all
nxtcomm.type=bluecove
nxt.btaddress=00:16:53:00:0d:59


Then I get the following in cmd: -

Code: Select all
C:\ProgramFiles\icommand-0.7\samples>javac NXJTest.java

C:\ProgramFiles\icommand-0.7\samples>java NXJTest
Properties location: C:\ProgramFiles\icommand-0.7\samples\icommand.properties
Exception in thread "main" java.lang.NoClassDefFoundError: javax/bluetooth/DiscoveryListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at icommand.nxt.comm.NXTCommFactory.createInstance(Unknown Source)
        at icommand.nxt.comm.NXTCommand.open(Unknown Source)
        at NXJTest.main(NXJTest.java:6)


It is looking in the correct place for the properties file, although I put it in my home and working directory also.

The BT address specified within the properties file is also correct. If I comment it out I just get the error: -

Code: Select all
C:\ProgramFiles\icommand-0.7\samples>javac NXJTest.java

C:\ProgramFiles\icommand-0.7\samples>java NXJTest
Properties location: C:\ProgramFiles\icommand-0.7\samples\icommand.properties
No NXT address found in icommand.properties. Searching... (this may take up to a minute)
Exception in thread "main" java.lang.NoClassDefFoundError: javax/bluetooth/DiscoveryListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at icommand.nxt.comm.NXTCommFactory.createInstance(Unknown Source)
        at icommand.nxt.comm.NXTCommand.open(Unknown Source)
        at NXJTest.main(NXJTest.java:6)


So I am still stumped....any ideas?

Should I be specifying anything else in my properties file?

Thanks,
Jochi
User avatar
Jochi
Novice
 
Posts: 26
Joined: Tue Nov 06, 2007 8:17 pm
Location: Guildford, UK

Postby lawrie » Mon Jan 28, 2008 12:48 am

The error you are getting means that you do not have bluecove.jar on the CLASSPATH. I think there was a problem with version 0.7 of iCommand that bluecove.jar was omitted from the distribution. You may need to copy it from iCommand 0.6 (or from leJOS).
lawrie
leJOS Team Member
 
Posts: 840
Joined: Mon Feb 05, 2007 1:27 pm

Postby PatrickLismore » Mon Jan 28, 2008 5:14 am

I am having some troubles as well,

the latest version of icommand did not have bluecove.jar i had to mannually copy it to thte icommand\dist folder.

I set the classpath for icommand.jar and bluecove.jar

when i try to run the example RadioControl.java

I renamed the class remote.java

when i compile and run i get this ;

Code: Select all
Properties location: C:\programming\bt\icommand.properties
No NXT address found in icommand.properties. Searching... (this may take up to a minute)
javax.bluetooth.BluetoothStateException: BluetoothStack not detected
   at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:334)
   at com.intel.bluetooth.BlueCoveImpl.access$100(BlueCoveImpl.java:64)
   at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:502)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:500)
   at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:489)
   at javax.bluetooth.LocalDevice.<init>(LocalDevice.java:64)
   at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:71)
   at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:86)
   at icommand.nxt.comm.NXTCommBlueCove.search(Unknown Source)
   at icommand.nxt.comm.NXTCommFactory.createInstance(Unknown Source)
   at icommand.nxt.comm.NXTCommand.open(Unknown Source)
   at mypackage.remote.main(remote.java:162)
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
   at icommand.nxt.comm.NXTCommFactory.createInstance(Unknown Source)
   at icommand.nxt.comm.NXTCommand.open(Unknown Source)
   at mypackage.remote.main(remote.java:162)


Now i have been readind about COM4 ,

however my NXT automaticly connected on COM40 the lowest COM port is 21.

So i set my COM port in the icommand.properites file to nxtcomm=COM40
i tried it with 4 and 21 as well no difference.

Can anyone tell me whats going wrong here please.
User avatar
PatrickLismore
Active User
 
Posts: 81
Joined: Tue Oct 16, 2007 7:28 pm
Location: Prague

Next

Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 2 guests

more stuff