Unexpected UART Behavior

I have two Electric Imps. My naming is nonsensical for this test case but is proper for the end use case of my design. I have an Imp (“master”) connected to an arduino via UART and that arduino is connected to a SPI OLED display. I have another Imp (“slave”) which is connected to an arduino which has a serial interface on my PC.

Both imps were running identical code, but during my debugging I split them into two plans. The imp just takes any UART it receives from the arduino and then sends it to the server… it also takes any input from the server and sends it to the arduino.

The system works fine when I HTTP post to the master imp. I see UART activity which then displays on the OLED screen. I use “,” as a special end of transmission message for the arduino. If i HTTP Post “hello,” i correctly see hello on the screen. If i then post “goodbye,” i correctly see the message change to “goodbye”. If i finally post “cloudbased,” i again see the message change to “cloudbased”

However, when I try to use my console to type input into the slave arduino… the master responds oddly. I type “hello,” and i correctly see my screen display “hello”. I then type “goodbye,” and then i see the screen switch to “hello” and then “goodbye”. I then type “cloudbased,” and then I see the screen switch to “hello” then “goodbye” then “cloudbased”. If i send more than a couple messages the master imp seems to freak out- i have an LED output from the imp so it lights up when it sends data from the imp to the arduino (after receiving from the server), and a couple of messages in and it just turns solid until i cycle power. The imp has also changed to a solid green light during this operation (not firmware updating… this has to be stuck- i saw the firmware update when i first powered it up a week or so ago)

It seems like the transfer is screwy from the one Imp to the other. Post > imp is fine, but imp > imp is off.

Sorry this message is so long. Any ideas as to what my problem might be?

Just sounds like a bug, but without the code (likely both imp and ardunio) it’s hard to debug. It’s very possible the same behavior is happening in both cases it’s just when you type the delays are such that you can actually see it happening.

Oy you’re right. I was being quite silly with my string building on the computer. (I wasn’t resetting it after each command)

As for the Imp freezing up, I was also using the sparkfun UART example (https://www.sparkfun.com/tutorials/397) and switching to a callback method instead of polling (via http://forums.electricimp.com/discussion/940/sending-80-bytes-through-uart-limitations) seems to work more reliably.