Robot Engage Blog Buy Now
Blog

Misty Community Forum

Misty BackPack Documentation and API?

Hi Miker :slight_smile: It is great to see you expanding Misty’s capabilities !!

Here are some mods that might get your test to work.

On The Auduino Side
Use baud rate 9600 instead of 115200
Serial.begin(9600);

On Misty Side
Jonathan has got it right…

function _StringMessage(data) {	
    misty.Debug(JSON.stringify(data.AdditionalResults[0].Message));
}
2 Likes

Is there any way for me to see what data Misty II is receiving on its USB port from the Arduino Uno? I made the suggested changes and reverted to a JSON version of the code that sends data from Arduino to Misty II USB every second. The TX light on the Arduino blinks every second but my javascript never appears to get called.

When you say “reverted to a JSON version of the code” – does this mean you’re attempting to send a JSON object to Misty instead of the test string in your first example?

You might try using the API Explorer to check if Misty is receiving messages, and to see what those messages are. Make sure you’ve selected Misty II from the drop-down at the top of the explorer, then go to the WebSockets section and use the form to subscribe to the StringSensor named object. Once subscribed, if Misty is indeed receiving messages, then I believe you should see the data from the event (including the data Misty received from the Arduino) print to the JavaScript console.

1 Like

Thank you for your input. I tried the API Explorer per your suggestion but saw nothing in the JavaScript console. At this point I am starting to believe that the USB port on the Misty II is not working.

Hypothetically, suppose for the moment that the Misty II
I have in my possession is the final product version
that will be shipped to me in April. Pretend that I attempt
to use my Arduino Uno with the Misty II USB port and am
unable to get successful data communication to function.
What will be my options at that point? Will there be a
diagnostic that I can run on the Misty II to analyze the
USB port and verify that it is indeed functioning
correctly? If so, are there any similar programs in
existence now that I could run to verify the USB port?

1 Like

Great question. I am looking into this @miker. I for sure don’t have an answer offhand, but I’ll get back to you as soon as I know something useful.

Okay, I got the scoop.

If you have a USB-ethernet dongle (with luck, you’ve got one from your Misty I), plug it into her USB port. If the lights on it are working, then the USB port is definitely working. If the lights don’t come on, it could still be working but more difficult to verify.

If you have a two-sided USB-A cable you could plug one end into Misty’s USB port and the other into a Windows Machine and see if it comes up in the system Device Manager.

Otherwise you could plug a USB storage device formatted as NTFS into Misty’s USB port and see if it shows up in the Windows Device Portal.

Please let me know how this goes. Thanks, @miker!

Great! Things I can try! Thank you a bunch.

The NTFS formatted USB storage device worked fine. I used ssh to login to Misty and verify the files on the USB storage device and even successfully created a new file. So, Misty II’s USB port is OK. Shoot! :frowning:

I think maybe calling @cp_sridhar back over here could be helpful, as he’s got quite a bit of experience with all things “backpack” for Misty…

@miker have you tried connecting everything up to the UART (serial) port, instead of the USB port? I see above that your plan was:

[Misty II USB] <—> [Arduino USB … Arduino ICSP] <—> [Pixy2]

But I’m chatting with Engineering, and they agree with what CP says above – that the USB is for the power, and the UART is what’s intended for data transfer.

Thanks for being so patient and trailblazing with all this, btw. I’ve (obviously) worked very little with Arduino and Misty, so your questions are valuable in helping me and others get clear on what info developers will need.

@miker Hang tight. We’re further discussing the details of what you’re trying to do. It’s surprisingly non-trivial. I’ll try to report back with more recommendations soon.

Donna, thank you for following this up for me. The reason I didn’t connect to the UART is because I don’t have any way to connect to the “pogo” pins. I was assuming that the UART and the USB shared data connections.

Hey Miker,

The UART and USB connections are completely isolated from each other, so they don’t go to the same place in the head. We have an API written for the UART connection, so it currently works and you can talk to the backpack with it now. We are starting the conversation about how to get Arduino data through the USB port. The specific problem is that in order to talk to the Arduino through the USB, drivers need to be installed on Misty. Unfortunately because of the hardware/O.S. combo, its not a trivial matter. I think the plan has always been to work in that direction, you’ve just caught us a bit too early for it.

In your particular case, one of the unfortunate things is that the USB operates at 5V but the Serial UART port operates at 3.3V. The Pixy2 requires 5V to operate, meaning you will have to power it from the USB. The Arduino will also be powered and talking at 5V on the serial lines. In order to talk to the head at this point in time (before we have USB communication established), we’ll have to talk to the Serial port, and well have to put some level shifters between the pogo pins and your Arduino in order to maintain the appropriate signal levels throughout the system. While this sounds complicated, its actually pretty straight-forward and I’ll be working with you through this process to make it as painless for you as I can. Just bear with us and give me a short bit of time to work out the details. I’ll reach out to you soon to discuss moving forward.

2 Likes

I honestly thought that this was going to be plug-and-play from a hardware standpoint. Obviously I didn’t understand the full implications of what I was attempting to do. I am going to set this project aside until later when the software you describe is in place and I can acquire a proper Arduino backpack. Please do not let my questions divert you from the product activities you had already planned. I can wait. Thanks.

1 Like

This is an old thread, but I used it to get an Arduino to work with Misty!!!

I do not have an official Misty Arduino backpack yet, just a base pcb. The base pcb connects the pogo pins to a connector for jumper leads. This seems to be where @Miker had problems. I wanted to add a simple external switch. Here is the picture of the setup.


Added a 3D printed trailer hitch cover and taped the breadboard to it. Used the Arduino Pro Mini 328 - 3.3V/8MHz from here: https://www.sparkfun.com/products/11114

The Arduino is powered from Misty 3.3V. The external switch (not pictured) works to just change an input to the Arduino and report over serial the status of the switch to change Misty’s LED color. The serialReadWrite.js code in CP’s github account under Beginner Skills helped, and is slightly different from the suggestions above.

 misty.AddReturnProperty("backpackMessage", "SerialMessage");
 misty.RegisterEvent("backpackMessage", "SerialMessage", 50, true);

function _backpackMessage(data) {

	var message = data.AdditionalResults[0].Message;
	misty.Debug("Message Received: " + message);
}
1 Like

This is great, thanks for sharing @MorningR!

I have it on good authority that you won’t have to wait for the official, Misty II Arduino-Compatible Backpack…™…for much longer.

@johnathan I have heard of this mythical Misty Arduino backpack - but only seen blurry pictures. Does the backpack have a pinout that can be shared?

Obviously, I cannot wait. While I considered myself patient, the Misty Team has shown multiple times that I am not.


The video above shows the workings of a switch circuit. Misty holds a wand and when the wand is pressed, the Arduino sends a “Pressed” message over serial. Misty will back up. I told Misty to cover her eyes and only pay attention to the switch, but I suspect there is peeking going on. The code for both Misty and Arduino is here:

One finding - the Arduino backpack has to be removed from Misty to load a new Arduino program. Is this the same for the official backpack?

I don’t have a pinout that I can share here (yet) but the pinout for the Misty backpack is similar to that of the Arduino Uno. (Misty’s backpack runs at 3.3v logic, instead of 5v).

That depends. The Misty II board has a switch that you can use to toggle the RX/TX pins from 0/1 (the default hardware serial pins) to 8/9 (for software serial). This is handy when using a shield that needs to use the board’s default hardware serial pins. When you’re using hardware serial to communicate with Misty (pins 0/1), you’ll have to disconnect the board before you upload your code. If you’re using the software serial pins, you should be able to leave the board connected.

1 Like

Awesome! @johnathan that helps me out. I want to make sure that Arduino code can be easily transferred. Looking forward to cleaning up the wiring mess with the new backpack!