Problems understanding Bluetooth

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
nxt1engineer
Posts: 34
Joined: 18 Aug 2011, 19:23
Location: Raalte Netherlands

Problems understanding Bluetooth

Post by nxt1engineer »

Hello
For the winter project I have to connect 4 brick and communicate sever messages
I have some problems connecting the bricks and receiving messages.

Example
Brick 2 is master and connected to slave brick 1 connection line 2
Brick 1 is sending a message but brick 2 is not receiving the message.

Now I do it reverse
Brick 1 is master and connected to slave brick2 connection line 2
Brick 1 is sending a message now brick 2 is receiving the message OK

Question
Can the slave brick send a message or can only the master sends messages ?
Please some help to connect the 4 bricks, see picture, and sending messages
Brick_connect.pdf
Her the picture connection
(176.54 KiB) Downloaded 226 times
Thanks Jan
Alway problems to attacg a picture PFFFFFF
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Problems understanding Bluetooth

Post by afanofosc »

The NXT is not really designed for the sort of network you have drawn. One NXT is intended to be the master with up to 3 NXTs attached. The master NXT does all the bluetooth communication. The other NXT's simply respond to communication initiated by the master NXT. That is, at least, how the NXT firmware is designed to work. An NXT that is a slave cannot send any messages directly to any of the other slave NXTs.

Now, having said that, it is possible to do things somewhat differently than the NXT firmware designers intended for us to do things but it is not easy. I don't think you will ever succeed, though, in getting a slave NXT to connect to and send messages directly to another slave NXT.

It might also help us to know what sort of programming language you are using and what your existing code looks like.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
nxt1engineer
Posts: 34
Joined: 18 Aug 2011, 19:23
Location: Raalte Netherlands

Re: Problems understanding Bluetooth

Post by nxt1engineer »

Hello John
Thank for the replay

I have work out 2 other ideas
Can you have a look of it can work?
We programmed with standard nxt 2.0

Idea 2
Brick 1 (master) connect to brick 2 (slave)
Sending a message, and shutdown the connection after sending
Brick 2 doing his job
After the job Brick 2 (new master) connect to brick 3 (slave)
Sending a message, and shutdown the connection after sending
And so on, and so on.

Idea 3
We making brick 2 master and connecting 1-3-4 as slave.
The master is polling al the slaves and the response of the slaves can activate a job.
The question by this idea
Can the master get a message from the slave that the message is received?
nxt-bleutooth.pdf
new ideas
(23.32 KiB) Downloaded 241 times
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Problems understanding Bluetooth

Post by HaWe »

CMIIW, but you may only have 1 dedicated master ever in your program.
Once master - always master.
Once a slave - ever a slave.

But a slave can put a message into his outbox and the master can pick up the message by reading his related inbox.
So your idea 3 should work.
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: Problems understanding Bluetooth

Post by hassenplug »

It should be possible to make idea #2 work. However, it can take 3 or 4 seconds to connect, so it could take 10 seconds to send a message from 1 to 4.

Idea #3 would be the best of those.

Another option would be to connect them all directly together using the RS485 in port 4. Or even connect a couple via 485, and the others via bluetooth.

Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests