Error in String.getBytes() ?

Result: String is send, no errors/missing chars/blanks etc

You've gotten lucky.

Hmmm ok, dont wanna argue, but the way I did it consistently yields the correct result (varying String size/chars), so lucky?? I dont know.

You really should not be defining the buffer this way, though. The buffer should be statically defined, with a set size. Then, you should use the toCharArray() method to get data out of the String, if you feel that you must abuse the Arduino by using the String class.

This will be rather difficult, as the message is intended to be a collection of address and measurements from various sensors, which will vary in length. I could take the trouble of formatting every number to a fixed length, but my program is rapidly approaching the memory limit of the Arduino FIO.

Besides, what precisely is the problem/danger in letting the array length depend on String length dynamically, as opposed to static length? And I take it from your reply using String is a bad idea?? Its just that it makes compiling the message easier, as it is composed of different inputs (chars/ints/floats)...

EDIT: PaulS, I tested youre recommendation (which was the last possible combination), and Im sorry to say you're wrong.

With array length+1 and geBytes length, the last character of the string is dropped. The extra byte in the array is filled with random ASCII chars....