3

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.

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

Originally from here.

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

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

http://man7.org/linux/man-pages/man1/stdbuf.1.html

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.