I am stuck while programming for comunication to lego NXT

View: New views
2 Messages — Rating Filter:   Alert me  

I am stuck while programming for comunication to lego NXT

by NXTelectroneer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am a hobbyist programmer and trying to make NXT remote control program for PC.

anyway, I am succeed open bluetooth SPP, send a command, and got response from the NXT.

But the problem is.... sending tons of repeatly command and one response.

NXT never respond sending one or two command, but after sending 20~40, sometimes about 60 command

(all the same), I can get only one NXT's reply packet.

The reply packet itself is correct and suited the command.

To solve this, I read carefully the "LEGO mindstorms NXT communication protocol" document but

I can't find the solution.

It seems that buffering is occured somewhere on data route.(I think the NXT got buffering)

I an tired to find the solution in several days....

What is wrong? What is my mistake? please let me know...

Re: Finally, I found the answer!!

by NXTelectroneer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


NXTelectroneer wrote:
I am a hobbyist programmer and trying to make NXT remote control program for PC.

anyway, I am succeed open bluetooth SPP, send a command, and got response from the NXT.

But the problem is.... sending tons of repeatly command and one response.

NXT never respond sending one or two command, but after sending 20~40, sometimes about 60 command

(all the same), I can get only one NXT's reply packet.

The reply packet itself is correct and suited the command.

To solve this, I read carefully the "LEGO mindstorms NXT communication protocol" document but

I can't find the solution.

It seems that buffering is occured somewhere on data route.(I think the NXT got buffering)

I an tired to find the solution in several days....

What is wrong? What is my mistake? please let me know...
I am missing the packet length in the command packet.

before send a command packet, the length of the packet must be sent first.

Size of the packet length is word(2 byte), but value of the packet length is not included itself.