For the last few days we had a lot of activity with serial comm problems. While (mostly Kevin) was able to improve the situation by allowing more than 1 byte per main loop to be read, reduce the number of sensor cycles or adding delays in MRL send commands, unfortunately I have still been able to raise the errors for first byte in new message is not the magic number.
Taking a step back and swallowing "rock solid communication" I am tempted to ask for a change the protocoll and add a message sequence into it. Messages from MRL would get a sequence number and the Arduino has to commit the "last good message received". On this message MRL can remove the top message in the send queue and send the next one.
This would make sure the Arduino gets all the message in normal mode.
The sequence number could be an additional byte (which will increase all message length's with 1 byte) or it could use the high 3 bits of the message length byte.
I see 2 additional things that have to go with it
1) send messages need a creation time stamp and outdated messages (like older than 2 seconds?) need to get removed.
2) send buffer could get filled up and I suggest a flag to
a) block the program flow until we get room for new messages
b) throw away messages the do not fit into the send queue
Any other ideas welcome