Linux命令使用HW流控制将二进制文件发送到串行端口? [英] Linux command to send binary file to serial port with HW flow control?

查看:124
本文介绍了Linux命令使用HW流控制将二进制文件发送到串行端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将二进制文件发送到rs232设备(打印机),该文件并非总是可以接受数据,因此它具有BUSY输出信号,我将其连接到CTS引脚。

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.

我尝试将其与 minicom 一起使用,并且硬件流控制工作正常。但是我无法使用minicom发送原始文件,但是我认为minicom不喜欢文件中的零,所以它的工作原理不正确。

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.

另一方面,我尝试使用 cat文件> / dev / ttyS5 ,以及 stty -F / dev / ttyS5 clocal stty -F / dev / ttyS5 crtscts 。这些工作都不起作用:硬件控制根本不起作用,数据传输只是停止(当TXD上的 space 状态卡住时通常在字节的中间!),在释放BUSY之后再也不会继续。行为不取决于我使用的 clocal crtscts
还有 cat文件> / dev / ttyS5 永远不会等待,即使在此命令之前处于活动状态。

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.

请注意,使用minicom ,我确保自己连接正确,并且在内核和RS232 PCI-E板上支持RTS / CTS等。

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

所以问题是,我该怎么办使用HW流控制从命令行正确传输二进制文件?谢谢。

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

推荐答案

有人说他有一个可以通过minicom传输二进制数据的解决方案:
http://www.dannysung.com/wmain/linux/小贴士/发送二进制文件通过minicom /

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/

我不明白为什么他的小脚本与 cat不同文件> / dev / ttySX ,但也许您可以尝试一下。

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

这篇关于Linux命令使用HW流控制将二进制文件发送到串行端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆