Linux command to send binary file to serial port with HW flow control?

user2223633 picture user2223633 · Jan 11, 2014 · Viewed 9.2k times · Source

I need to send binary file to rs232 device (printer) which not always can accept data and so it has BUSY output signal, which i connect to CTS pin.

I try to use it with minicom, and hardware flow control works just fine. But i can't send raw file using minicom, it works wrong ant i think minicom not loves zeroes in file.

At other hand, i try to use cat file > /dev/ttyS5, along with stty -F /dev/ttyS5 clocal or stty -F /dev/ttyS5 crtscts. None of this work: HW control not work at all, data transfer just stops (often at middle of byte when space state on TXD stucks!) and never continues after release of BUSY. Behavior not depends on clocal or crtscts i use. And also cat file > /dev/ttyS5 never wait, even if BUSY was active before this command.

Please note, using minicom, i ensure that i have correct connections, support for RTS/CTS in kernel and in RS232 PCI-E board, etc.

So the question is, how i can do correct binary file transfer from command line using HW flow control? Thanks.

Answer

leu picture leu · Jan 11, 2014

Here is a guy who says he has a solution for transferring binary data with minicom: http://www.dannysung.com/wmain/linux/tips/sending-binary-files-via-minicom/

I don't understand why his little script is different from cat file >/dev/ttySX but maybe you can give it a try.