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

Hi

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 : http://pastebin.com/YQ5UW4Yi

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?

Thanks
icarhgm
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
gloomyandy
leJOS Team Member
 
Posts: 4243
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?

Thanks!
icarhgm
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
maxdd
New User
 
Posts: 24
Joined: Fri May 23, 2014 6:58 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff