Bluetooth Scatternet with NXT

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

Moderators: 99jonathan, roger, imaqine

Bluetooth Scatternet with NXT

Postby icarhgm » Tue Mar 04, 2014 5:16 pm


Im working on a nxt swarm project. One of our targets is make a bluetooth ring connection between agents.
I developed a bluetooth class called Bluering which open connections and control data transfer. I tested in a few task and it worked but sometimes nxt closes bluetooth channel and break the ring.

I posted the code here :

The last time i test the code it had problems when call inStream.available() method, but i dont know why im having these problems now. (I use this class to make robots forage before)

Anybody knows why lejos closes bt channel when you try to make a scatternet?

New User
Posts: 2
Joined: Tue Mar 04, 2014 5:05 pm

Re: Bluetooth Scatternet with NXT

Postby gloomyandy » Tue Mar 04, 2014 11:24 pm

What do you mean by "problems when call inStream.available() method"? Please provide more details?
User avatar
leJOS Team Member
Posts: 4238
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Bluetooth Scatternet with NXT

Postby icarhgm » Wed Mar 05, 2014 4:10 pm

Code throws an IOException when program calls inStream.available(). Checking Bluetooth api, when you call "inStream = pConnection.openDataInputStream();" return null if connector cant open the stream (thats why i check if inStream is null before check available data).
Now i think it would be problems with stream timming. Im checking that adding sw delay to the bluering class.

Anybody knows any other projects which use scatternet networks and lejos?

New User
Posts: 2
Joined: Tue Mar 04, 2014 5:05 pm

Re: Bluetooth Scatternet with NXT

Postby maxdd » Fri Jul 11, 2014 1:07 pm

Hello im trying to do basically the same thing, what i am missing right now is who should initiate the first connection and which schedule give them in order to communicate...... i would like to discuss more if you are interested
New User
Posts: 24
Joined: Fri May 23, 2014 6:58 am

Return to NXJ Software

Who is online

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

more stuff