| Author |
Message |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2864 Location: Rotterdam, The Netherlands
|
 Re: BlueTooth?
You can switch between 4 clients, but you cannot communicate simultaneously, that's how I've always understood it to be.
- Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Sat Jun 30, 2012 6:28 am |
|
 |
|
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 510 Location: Totally not spying on Hassenplug to see what he has for the Brickworld Chicago 2013 sumo contest.
|
 Re: BlueTooth?
I would have gotten some a long time ago, if not for the fact that I'm on a 13-year olds allowance, and I'd need to spend at least $100 to get a pair of them with radios. I'd love to have fast, reliable, wireless communication. Especially since I'm now interested in building boats. I don't want the BT connection to suddenly drop, leaving my exspensive NXT stuff stranded in the middle of the lake.  |  |  |  | Spiked3 wrote: I haven't gotten deeper than an NXT to a PC, but I feel like I am starting to understand this weird Nxt bluetooth thing a little. I just looked at the online wiki for NXT, and I see this;
A device can be either a slave or a master, but not both. A single master can (optionally) make connections to multiple slaves.
And that fits with my limited understanding. 1 master, up to 3 slaves.
then from the help file I see this;
cCmdMessageWriteToBluetooth(nStream, pData, nLength, nQueueID) Writes a Bluetooth message to 'nQueueID'. The message will be written to the specified 'port' or 'nStream' which should be in the range of 0 to 3. This command is only useful when multiple ports are simultaneously open on the NXT; a configuration that is not recommended because of the much slower communications when multiple ports are in use. The message data is taken from the buffer at 'pData'. 'nLength' is the number of bytes in the message; the maximum length is 58 bytes.
again, it sounds like it fits the Nxt model, but to be honest - I never saw any traffic over the wire when I tried to use it.
I'm not sure if there is stuff in robotc and it is just broken, or if it was never planned to work. Have you looked at these? is there a statement somewhere that 1 Nxt to 1 Nxt is the only model that works? Remind me, what LeJOS API accomplishes this 'easy'? I prefered lejos (java) as a modern language, but couldn't deal with the lack of debugging, up to and including the need to manually use command line to look at linker listings to find out what and where an exception occurred, it is just too primitive for me in that respect (might as well be doing native assembler). |  |  |  |  |
Yes, your right, but the thing is they haven't implemented a connection to have a master with multiple slaves. Here's my test code: Master NXT:  |  |  |  | Code: task main() { btConnect(1, "Steve2"); while(bBTBusy); btConnect(2, "Steve3"); while(true) { for(ubyte x = 0; x <= 9; x++) { for(ubyte y = 0; y <= 9; y++) { for(ubyte z = 0; z <= 9; z++) { while(bBTBusy); cCmdMessageWriteToBluetooth(2, z, sizeof(z), mailbox1); wait1Msec(100); } while(bBTBusy); cCmdMessageWriteToBluetooth(1, y, sizeof(y), mailbox1); } nxtDisplayCenteredBigTextLine(2, "%d", x); } } } |  |  |  |  |
Slave NXT code. There are supposed to be two slaves: Now, when I run this code, the Master connects to the two Slaves, but only the last one it connected to receives commands. BT in LeJOS? It's my understanding that you simply set up a connection, and you can pretty much directly control the other NXT's sensors and motors without manually exchanging messages, as well as normal messaging. Yeah, which is why the NXTBees would be very useful to me, if only I had enough $$$ to get them  EDIT: I forgot to mention what the program does. It was just a test to see if multi-NXT BT worked, and it would count up time in tenths of a second.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
| Sat Jun 30, 2012 9:07 am |
|
 |
|
Spiked3
Expert
Joined: Tue Feb 28, 2012 3:10 pm Posts: 195
|
 Re: BlueTooth?
Well, like I said, it looks like they at least intended to have in place what the hardware supports, however badly the hardware supports it. Whether or not it works, I have not tried it (for more than 1 master (the PC), 1 slave(the NXT) as I mentioned.
I will say that the firmware implementation can be a bit confusing at best. I know I had to modify the mindsqualls library some. For example, when a master says 'read message' it gets a 'write message', as a reply. since the command echo does not equal, it (the original mindsqualls library) throws an exception.
LeJOS does have a way to send direct commands, aka LCP. But in reality it would not be much trouble to do them with raw bluetooth from robotc code as well. I think you would still have the inability to have multiple simultaneous connections. I may be wrong, but do some checking first before you commit to that (LeJOS) path for that reason. They are by no means, realtime. Don't expect to do a sensor sweep and get the same data rate you would from local code (been there, done that). Or even try to remotely control an accurate motor. I suspect you quickly will fall back to the messaging scheme, that in theory should also work in robotc.
Since 'only works with 2' seems to be common knowledge, I was just wondering if anyone had ever filed a problem report and gotten a response?
The big interest for me, is that robotc debugging, which I depend on, takes over the buetooth stream. So if I also want to do communications, I'll need the xbee or something else. I plan on going down that road eventually. But until anyone comes even close to robotc as far as debugging, ill stick with it. I notice that as a difference between software guys and hardware guys, hardware guys seem to be able to get along fine without debugging. (guys and gals of course, no discrimination intended).
Mike
_________________Mike aka Spiked3 http://www.spiked3.com
|
| Sat Jun 30, 2012 10:44 am |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2864 Location: Rotterdam, The Netherlands
|
 Re: BlueTooth?
I use debugging a LOT when writing my drivers for the hardware I am testing  - Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Sat Jun 30, 2012 10:57 am |
|
|
Who is online |
Users browsing this forum: No registered users and 5 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|