How can I record all data coming out of a serial port straight to a file on disk?

I have tried cat and cp, but these appear to be buffered, and I am trying to log a small amount of data, so nothing comes through.

(stty raw; cat > received.log) < /dev/<your_serial_port>

Originally from here.

stdbuf -o0 cat /dev/ttyS0 >ttyS0.log

If MODE is '0' the corresponding stream will be unbuffered.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.