leJOS Bluetooth interaction with a C++ Library!

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

Moderators: 99jonathan, roger, imaqine

leJOS Bluetooth interaction with a C++ Library!

Postby mrasool » Fri Oct 05, 2007 4:11 pm

Hallo,

I want to interact with NXT Brick via Bluetooth which has LeJOS firmware. And I dont want to use iCommand on PC side to interact. Rather I am using a library @ http://www.norgesgade14.dk/bluetoothlibrary.php

But this library does not work correctly if I have leJOS firmware in the brick, but works 100% ok if have the original NXT firmware.

You can download and run the project available on this site @ http://www.norgesgade14.dk/bluetoothlibrary/project.zip

My question is that, what might be the problem in leJOS Firmware, because the code is working fine with original Firmware.

Waiting for immediate help!
Mudassir Rasool
Deutschland
mrasool
New User
 
Posts: 7
Joined: Fri Oct 05, 2007 3:04 pm
Location: Germany

Postby mrasool » Mon Oct 08, 2007 1:38 pm

Can any one helpppp????
Mudassir Rasool
Deutschland
mrasool
New User
 
Posts: 7
Joined: Fri Oct 05, 2007 3:04 pm
Location: Germany

Postby lawrie » Mon Oct 08, 2007 9:07 pm

What happens when you use the library?

Does it successfully connect?

Bluetooth connection to leJOS is not currently as robust as the Lego firmware. It works with the lejos tools and pc.comm API, with iCommand, and with Java phone applications. It doesn't work with the the Lego NXT-G software, and it doesn't work reliably with the Lego fantom API.

Do you know if the library uses the fantom API?

The problem is either the connection is failing, or the emulation of the Lego Communication Protocol (in the LCP class) is not sufficient to support the library you are using.
lawrie
leJOS Team Member
 
Posts: 841
Joined: Mon Feb 05, 2007 1:27 pm

Thanks

Postby mrasool » Mon Oct 15, 2007 4:01 pm

thanks Lawrie...

My problem is resolved. I had asked directly to the author of this API. The problem was in an API used by the Library.
Mudassir Rasool
Deutschland
mrasool
New User
 
Posts: 7
Joined: Fri Oct 05, 2007 3:04 pm
Location: Germany

Postby bbagnall » Sat Oct 20, 2007 6:01 pm

It should also be noted that our implementation of the LCP (LEGO Communication Protocol) is not complete. We just implemented some of the commands to control motors, read sensors, and other basic functions. We have not yet implemented a lot of the lesser used functions, and I'm not sure we will since there doesn't seem to be much of a reason to do it.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby CoBB » Sat Oct 20, 2007 8:54 pm

lawrie wrote:Bluetooth connection to leJOS is not currently as robust as the Lego firmware.

At least it seems to be pretty stable on the lowest level. I never experienced any problems using sockets, and the connection was always maintained even if I temporarily moved out of range.
User avatar
CoBB
Novice
 
Posts: 73
Joined: Tue Apr 24, 2007 12:24 pm

Postby mrasool » Sun Oct 21, 2007 11:27 am

@ bbagnall and CoBB

Thanks for the information.....
Mudassir Rasool
Deutschland
mrasool
New User
 
Posts: 7
Joined: Fri Oct 05, 2007 3:04 pm
Location: Germany

Postby lawrie » Sun Oct 21, 2007 11:56 am

Hi Cobb,

The problem with the Bluetooth connection is that the way that waitForConnection tests whether a connection was successfully made is to wait for 300 millseconds and test whether another command was received. If no command is received, it assumes that the BC4 chip is in data mode and completes the connection. This is necessary as connections from the PC (particularly iCommand) seem to fail the first time and then succeed on the immediate retry. The standard Lego firmware uses an Analogue/Digital channel over a PIN connected to the BC4 chip to directly test if the BC4 chip is in data mode, which I think is more reliable, but I could not get this to work. This may be the reason the standard Lego firmware and the Lego fantom API do not reliably connect to leJOS NXJ.

Lawrie
lawrie
leJOS Team Member
 
Posts: 841
Joined: Mon Feb 05, 2007 1:27 pm


Return to NXJ Software

Who is online

Users browsing this forum: Baidu [Spider], ljdedseyrooov and 2 guests

more stuff