I would like to use cat /dev/ttyUSB0 or something similar to monitor serial communication happening through my USB-serial adapter.
I am successfully able to send serial commands from linux to a serial device through the TX wire using echo "blahblah" | sudo tee /dev/ttyUSB0, however I wanted to see the output returned by the serial device. The expected reply is typically an echoed back message, but sometimes it a longer message.
When I open cat /dev/ttyUSB0 in a separate terminal window, all is quiet until I execute echo "blahblah" | sudo tee /dev/ttyUSB0, at which point I get "blahblah" (terminated with '\r\n' bits) repeated forever in the terminal window running cat. Unplugging the RX wire halts it, and plugging it back in does not restart it.
I am sure that this repetition is an artifact, as I have used a serial logic analyzer connected to the RX output coming from the serial device, and only see the single echoed command, not an infinite sequence of echoes.
FYI, I get the same behavior using echo "blahblah" > /dev/ttyUSB0 to send the initial serial data.