Searching and parsing data from serial.read

J-M-L:
it would be interesting to know if the OP sends \r and \n or not from the console for a start.. that's probably just his pb to start with...

As far as I understand it, OP does not send anything. Just receives from a device.