Serial Communication Arduino Electric IMP - missing bits

I am missing the last few characters when sending a string from an IMP to and arduino. I an running 19200 baud, pin 8.9 over software serial. This is my code. individual characters are all read,however the last few (varying) are not added to the inData string for some reason???

// read the serial empty String inData = "";

while (impSerial.available() > 0) { char character = impSerial.read(); inData += character; Serial.println(character); delay(10); } Serial.println(inData);

// print out on screen messagePrint(inData);

Traces like this:

Serial Killer help ed the homeless for poun Serial Killer help ed the homeless for pound Serial Killer help ed the homeless for pounds Serial Killer help ed the homeless for pounds Serial Killer help ed the homeless for pounds o Serial Killer help ed the homeless for pounds of Serial Killer help ed the homeless for pounds of Serial Killer help ed the homeless for pounds of $ Serial Killer help ed the homeless for pounds of $ Serial Killer help ed the homeless for pounds of $ Serial Killer help ed the homeless for pounds of $ Serial Killer help ed the homeless for pounds of $

This is my code. individual characters are all read,however the last few (varying) are not added to the inData string for some reason???

Probably memory fragmentation. Ditch the String class. Learn to use a char array.

Well I started using char arrays, but it added gobbly gook in my string characters for some bizarre reason. the string seemed to be cleaner. I will try the chars again, see if a different approach can help.

BTW is it possible to create an open sized char array?

Well I started using char arrays, but it added gobbly gook in my string characters for some bizarre reason.

No. The reason may not be clear to you, but it is not bizarre. Of course, it isn't clear to me, either, because you've got your monitor turned the wrong way.

BTW is it possible to create an open sized char array?

No. There should be reasonable limits on the data that you expect in an array, so using a fixed size array is normally appropriate. There are techniques for dynamically sizing the array. But, they are what cause problems with the String class.

This might not help you solve yr issue but it can increase your knowledge on Arduino Serial comms..

http://jhaskellsblog.blogspot.com/2011/05/serial-comm-fundamentals-on-arduino.html

...could you also use pastebin.com (or others) to paste BOTH yr Imp and Arduino codes plus serial monitor output here...