Unless I'm missing something, there appears to be no simple way in *NIX to read from a serial port directly into a file

I had imagined something as simple as cat /dev/ttyX > file but apparently not

Does anyone know a trick that I'm missing?

link|improve this question

71% accept rate
feedback

1 Answer

up vote 0 down vote accepted

If you're just trying to capture data from a serial port, Minicom might work. I believe it supports logging to a file.

I thought doing a cat /dev/ttySx would work as well...are you sure it's mapped to the proper serial port? Is something else not allowing the device file to be opened? What happens if you just cat the file instead of redirecting it?

link|improve this answer
Maybe it is something to do with line-buffering? – RedGrittyBrick Dec 21 '10 at 13:10
Strangly, This got sorted by playing with minicom... After HUP and quitting minicom, cat > file works :S Sorry for the time wasted. – Andrew Bolster Dec 21 '10 at 13:47
It could be that the port needed settings reset to defaults or was set in a funny mode. – Bart Silverstrim Dec 21 '10 at 13:53
feedback

Your Answer

 
or
required, but never shown

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