FIRST Tech Challenge Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Remote Debug using USB, Bluetooth, Samantha

Today I use the display to print to the NXT screen for debugging on the NXT brick. I thought it would be real handy to add a message block to my NXT code that sends debug information back to my laptop. Here is what I have done so far:

1) I used the "find NXT", "Create NXTObject", "Get battery level", and "destroy NXTObject" blocks on a computer host (not NXT). I ran this from the laptop and I was able to read from the NXT. So far so good

lv1.png

2) I then tried to create a program on the laptop and a seperate program on the NXT that talked using the mail boxes. This also worked. The first image below is the code on the laptop. The second image is the code on the NXT brick.

lv2.pnglv3.png

I see the string "Mail = Test" on the display on the NXT brick.

3) I then try to send a message back from the NXT to the laptop. This does not seem to work.

lv4.pnglv5.png

My message indicator on the laptop has a -1. The message 2 indicator has 22.

Any ideas?

0 Kudos
Message 1 of 4
(7,425 Views)

Has anybody played with the labview communication VIs? I can not seem to make the VI that sends information from the NXT brick to the computer. I was able to send information from a computer to the NXT brick. Any ideas? I am stuck and would love to use this with my FTC team to help with debugging.

Thanks in advance for your help.

0 Kudos
Message 2 of 4
(3,402 Views)

Here is a simple example of one way to accomplish this. This example uses PC->NXT communication over Bluetooth (which can be easily changed to USB or WiFi) to allow the user to change motor speed from the PC and uses NXT->PC communication to update the PC User Interface with how many seconds have passed on the brick.

Start by running the VI on the NXT, then run the VI on the PC.

As a side note, a simpler way to do this would be to use only 1 VI running on the PC, targetted for the PC, taking advantage of the LabVIEW's Direct Mode capabilities. That would prevent you from needed to establish and manage the BT connection on both the brick and the PC. However, for FTC, the attached example is appropriate since the game does not allow a live connection to LabVIEW during competition and thus you need a Remote Mode VI running on the brick.

Download All
0 Kudos
Message 3 of 4
(3,402 Views)

imaqmonkey, thanks for the response.

The two vi's that you attached come from the forum thread https://decibel.ni.com/content/docs/DOC-11109. I was unable to get these VI's to work on my computer/nxt. These are some of the orignial VI's that I tried. I am able to send data from the host computer to the client NXT. I am unable to get data to go the other way. This is the issue.

I noticed that the Client_NXT is targeted to run on the PC. In an ideal world, I would like this code targeted to the NXT. The idea is to send debug information back from the NXT to the PC to help when creating autonomous code for the FTC competition.

I noticed that you are running a newer version of Labview. Do you think this what id causing the problem on my computer? When I tried to install the newer version of Labview, I was unable to use the FTC license to test if this is the issue.

Any other ideas?

0 Kudos
Message 4 of 4
(3,402 Views)