Bluetooth And LeJos

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

Moderators: 99jonathan, roger, imaqine

Bluetooth And LeJos

Postby nikita190 » Tue Apr 03, 2012 10:18 pm

Hello, I'm trying to connect to pc using bluetooth with nxt

Code: Select all
    NXTConnector  nxtConnector = new NXTConnector();
         
    nxtConnector.connectTo("NIKITA", "00:16:53:0b:9b:99", NXTCommFactory.BLUETOOTH);



But it throws an error

Code: Select all
js.tinyvm.TinyVMException: Class java.net.URL (file java/net/URL.class) not found in CLASSPATH C:\\Program Files (x86)\\leJOS NXJ\\lib\\nxt\\classes.jar;C:\\Users\\Nicol\\leJOSNXJProjects\\test2\\bin;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\charting.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\jtools.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\pccomm.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\pctools.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\3rdparty\\bcel.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\3rdparty\\bcel-src.zip;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\3rdparty\\bluecove.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\3rdparty\\bluecove-gpl.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\3rdparty\\commons-cli.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\3rdparty\\jcommon.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\3rdparty\\jfreechart.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\pc\\3rdparty\\stax-api-1.0.1.jar;C:\\Program Files (x86)\\leJOS NXJ\\lib\\nxt\\classes.jar
   at js.tinyvm.ClassRecord.getClassRecord(ClassRecord.java:855)
   at js.tinyvm.ClassRecord.storeReferredClasses(ClassRecord.java:412)
   at js.tinyvm.Binary.processClasses(Binary.java:381)
   at js.tinyvm.Binary.createFromClosureOf(Binary.java:309)
   at js.tinyvm.TinyVMTool.link(TinyVMTool.java:97)
   at js.tinyvm.TinyVMTool.link(TinyVMTool.java:48)
   at lejos.pc.tools.NXJLink.start(NXJLink.java:134)
   at lejos.pc.tools.NXJLink.run(NXJLink.java:101)
   at lejos.pc.tools.NXJLink.start(NXJLink.java:33)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
   at lejos.pc.tools.NXJLink.main(NXJLink.java:28)
Linking the file failed with exit status 1



I wanted to know if they knew the reason it was given.
And if you had to configure the Bluetooth device or something.

From already thank you very much.



I'm using:
- Jdk-6u25-windows-i586
- Lejos_nxj_0.9.0
- Eclipse
- Win 7--64
nikita190
New User
 
Posts: 18
Joined: Mon Mar 26, 2012 10:48 pm

Re: Bluetooth And LeJos

Postby skoehler » Tue Apr 03, 2012 11:00 pm

You added the PC-side libraries to an NXT project or something like it.
Please create a leJOS NXT project and don't add pccomm.jar etc. to the project's build settings. Those libraries are only for leJOS PC projects.
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: Bluetooth And LeJos

Postby matthias » Wed Apr 04, 2012 5:58 am

For me it looks the other way arround:
trying to start an pc-programm as an nxt-programm...
well: we are sure, that there is some mixup in the classpath used.
matthias
New User
 
Posts: 20
Joined: Thu Mar 22, 2012 11:44 am

Re: Bluetooth And LeJos

Postby nikita190 » Wed Apr 04, 2012 2:21 pm

skoehler wrote:You added the PC-side libraries to an NXT project or something like it.
Please create a leJOS NXT project and don't add pccomm.jar etc. to the project's build settings. Those libraries are only for leJOS PC projects.


    I am using the nxt-project, and I removed all. Jar, leaving only the clasess, but using NXTConnector, I need the pccomm.
    and the program continues throwing the same error.

matthias wrote:For me it looks the other way arround:
trying to start an pc-programm as an nxt-programm...
well: we are sure, that there is some mixup in the classpath used.


    I tried both types of projects. And with the type pc-poyect I have not result, I think it may be, as this type of project works directly with the brick via USB.
nikita190
New User
 
Posts: 18
Joined: Mon Mar 26, 2012 10:48 pm

Re: Bluetooth And LeJos

Postby skoehler » Wed Apr 04, 2012 2:29 pm

nikita190 wrote:
skoehler wrote:You added the PC-side libraries to an NXT project or something like it.
Please create a leJOS NXT project and don't add pccomm.jar etc. to the project's build settings. Those libraries are only for leJOS PC projects.


    I am using the nxt-project, and I removed all. Jar, leaving only the clasess, but using NXTConnector, I need the pccomm.
    and the program continues throwing the same error.


Only classes.jar and no pccomm.jar - that's the right setup. The pccomm.jar is for connecting to the NXT from the PC via USB or Bluetooth. It's a library that runs on the PC only. Hence the name PCcomm.jar.
NXTConnector does not exist in classes.jar. It is currently not part of our NXT-side API. However, classes.jar contains everything you need to work with the USB and Bluetooth devices of the NXT brick.

BTW: connecting from the NXT to the PC is not possible. It has to be the other way round. (There are several threads in this forum, where Andy explains why that is the case).

Please take a look at the pcsample BTSend and the sample BTReceive.

nikita190 wrote:
matthias wrote:For me it looks the other way arround:
trying to start an pc-programm as an nxt-programm...
well: we are sure, that there is some mixup in the classpath used.


    I tried both types of projects. And with the type pc-poyect I have not result, I think it may be, as this type of project works directly with the brick via USB.

USB and Bluetooth.
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: Bluetooth And LeJos

Postby nikita190 » Wed Apr 04, 2012 3:14 pm

skoehler wrote:
nikita190 wrote:
matthias wrote:For me it looks the other way arround:
trying to start an pc-programm as an nxt-programm...
well: we are sure, that there is some mixup in the classpath used.


    I tried both types of projects. And with the type pc-poyect I have not result, I think it may be, as this type of project works directly with the brick via USB.

USB and Bluetooth.


in pc-project, as you can make the connection via bluetooth.?
nikita190
New User
 
Posts: 18
Joined: Mon Mar 26, 2012 10:48 pm

Re: Bluetooth And LeJos

Postby skoehler » Wed Apr 04, 2012 4:25 pm

Using a PC-Project, you can write a software that runs on the PC and connects to the NXT via Bluetooth or USB.
skoehler
leJOS Team Member
 
Posts: 1430
Joined: Thu Oct 30, 2008 4:54 pm

Re: Bluetooth And LeJos

Postby nikita190 » Thu Apr 05, 2012 2:55 am

skoehler wrote:Using a PC-Project, you can write a software that runs on the PC and connects to the NXT via Bluetooth or USB.


I tried the code and work without any problem :D , thanks, I will continue working on the basis of these
and thanks so much for always answering :D :mrgreen:
nikita190
New User
 
Posts: 18
Joined: Mon Mar 26, 2012 10:48 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

cron
more stuff