Receiving serial data as string and comparing them with other strings

i<maxLength && Serial.available()

The first time Serial.available() fails the loop ends, that will be after the first character.

Hint, get used to printing things to see exactly what you have, the results often point you to the error, in this case print char_in after the loop.


Rob