View unanswered posts | View active topics It is currently Fri Oct 30, 2020 1:04 am

Reply to topic  [ 4 posts ] 
Author Message

Joined: Sat May 10, 2008 3:41 pm
Posts: 5
Post Bluetooth

I've read several previous messages about bluetooth. Some of them were answered and some of them weren't. Unfortunatelly I didn't find answers to my questions(maybe it's my fault). I would like to control the robot from a PC, but not with low level commands like "set motorA speed to 10". I want to write some higher level commands for the actual implementation of the robot. For example "go forward 20 cm", "turn 90 degree", "look around", etc.
I would like to run these commands from a C# application(using bluetooth communication). I also want to send back the measured results for some command, for example polar coordinates from the lookAround command. If I understood well the robot can send a message to the PC only as a reply to an incoming command. Is this correct?
Does robotC uses a complete new set of commands for bluetooth communication instead of the original bluetooth commands?
Can anybody tell me how to implement this kind of communication? Or point me to the appropriate documentation? Or just say tips which may can help me.
As I seen from previous posts several Robot C users wanted to control his/her robot from PC. Do anybody managed to do this?
Dick wrote this in one of the previous topics:

"For this, the PC will have to behave (i.e. message) exactly like a NXT. This will require a relatively high level of technical expertise and programming experience."

I have some years of programming experience, so I would like to try to go in this direction(if there is no other solution). So Dick can you give me some hints on this subject?
Thanks in advance,

Mon May 12, 2008 12:38 pm

Joined: Fri Apr 25, 2008 2:32 pm
Posts: 5
I have interest in the same area. A lot of questions here go unanswered. I think the folks are busy preparing the next release of RobotC. I would rather have documentation than new features.

Have you seen It has much of what you are looking for. Unfortunately it is not compatible with RobotC firmware; you have to use the NXT-G firmware. Mindqualls works just fine then. :-( I looked through the recent release notes and there was mention of making the RobotC firmware compatible with the NXT-G firmware. I hope that is the case in the next RobotC release. I think this release is due out in June.

I hope the new release has complete documentation and Mindsqualls (NXT-G) compatible firmware.

Have fun,


Wed May 14, 2008 6:22 am

Joined: Sat May 10, 2008 3:41 pm
Posts: 5
Post Partially solved
I played a little with bluetooth communication, and I was able to send message to NXT and "receive message from NXT". I used quote marks because the message receiving is actually a reading from a remote mailbox(according to the documentation LEGO Mindstorms NXT Direct Commands).
I share my experiences, maybe somebody will find it useful. I can send commands to NXT with the MESSAGEWRITE direct command( page 9). It seems correct to me. In a PC - NXT connection the PC is the master and the NXT is the slave. So NXT can't send any data to the PC directly, but it can send it to it's outgoing message queue and the master can read it from there. You can do this with MESSAGEREAD command. And according to my experience RobotC differs at this point from the documented protocol. In MESSAGEREAD you can specify the remote message queue, but I found that it doesn't matter which message queue you specify(if there is a message in one of the queues MESSAGEREAD returns it). The documentation specifies a return package, but instead of that the MESSAGEREAD returns a MESSAGEWRITE command(which I think corresponds to the cCmdMessageWriteToBluetooth RobotC command called by NXT) .
This MESSAGEWRITE command contains the remote port number and the data sent by the NXT.
Can anybody confirm or confute these experiences? What's the reason of the difference? Are there any other differences in the communication protocol? Am I on the right way, or do I absolutely misunderstood something?


Wed May 14, 2008 6:45 pm

Joined: Mon Jun 09, 2008 5:00 am
Posts: 4
I am working with NXT and I think that the message returned is a MESSAGEWRITE from NXT.
Now I have a big problem. I connect my PC(master) with the NXT (slave) and I run a program which send data to PC. The first time I run the program works fine, but when I try to run another program o another time the same program the NXT crashes. I don't understand anything, the bluetooth connection deads. However, if I disconnect and after connect and run again the same program it works fine...

Is it a limitation of the NXT?

Please I need help!!

PD: Sorry I'm spanish and my english is bad.
Thanks!! ;-)

Mon Jul 14, 2008 11:48 am
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.