gpt4 book ai didi

macos - GNU SCREEN - MAC OS X 10.8.2 的 USB 串行 tty 通信问题

转载 作者:行者123 更新时间:2023-12-04 05:14:22 26 4
gpt4 key购买 nike

我们成功地使用 Windows 7 上的 Putty 和 LINUx 上的 GNU 屏幕管理 USB 到串行通信,但在 MAC OS 上的终端/屏幕上有一半失败。

在 LINUX windows 机器上需要简单的基本通信设置:

57600 bps, 8 bits , no parity, no flow control



设备成功安装并按此处所述进行配置(法语抱歉):

Identifiant du produit: 0x6160

Identifiant du fournisseur: 0x03eb (Atmel Corporation)

Version: 1.10

Vitesse:Jusqu’à 12 Mb/s

Identifiant de l’emplacement: 0x06200000 / 2

Courant disponible (mA):500

Courant requis (mA):0



cu.usbmodem621 和 tty.usbmodem621 确实出现在列表中
ls/dev/tty* 或 ls/dev/cu*

我们在 terminal.app 上使用以下屏幕命令激活屏幕

screen /dev/tty.usbmodem621 57600





sudo screen /dev/tty.usbmodem 57600



最初不存在 screenrc 文件,我最终创建了一个来微调终端设置并确保没有流量控制:

defscrollback 5000

termcapinfo xterm* ti@:te@

defflow off

hardstatus alwayslastline "%{rk}%H %{gk}%c %{yk}%M%d %{wk}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{wk}%?%+Lw%?"



我试过没有特定的驱动程序,然后使用以下 2 个引用

FTDI http://www.ftdichip.com/FTDrivers.htm

多产 PL2303 http://osx-pl2303.sourceforge.net/

我还复制并粘贴了
stty -a
根据 LINUX 机器。他们是:

speed 57600 baud; 92 rows; 145 columns;

lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo -extproc

iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel iutf8 -ignbrk brkint -inpck -ignpar -parmrk

oflags: opost onlcr -oxtabs -onocr -onlret

cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow -dtrflow -mdmbuf

cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ;  eol2 = ; erase = ^?; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;



在所有情况下,设备都能正确接收并解释我们从 screen 终端窗口发送的所有命令,但 screen 无法显示来自设备的任何通信。

我尝试过 Goserial 和 Zterm,结果相同。

任何暗示发生了什么?

最佳答案

其中common pitfalls串行通信的有:

  • RX 到 TX、TX 到 RX
  • 波特率不匹配
  • 总线争用(例如 getty 进程;参见 sudo lsof /dev/tty.usbmodem)
  • 溢出(芯片缓冲区;当字符进入串行通信芯片太快时发生)
  • 通信参数错误
  • 帧错误(BAUD、PARITY、DATA BITS 和/或 STOP BITS 可能不正确)
  • 奇偶校验错误
  • ...(请参阅 cisco 的“串行线路故障排除”)

  • 使用 screen 的替代方法将使用 picocom/ setserialcu -l /dev/tty.usbmodem -s 9600 (用于故障排除目的)。

    获取虚拟串口进行故障排除 screen你可以使用类似的东西:
    socat GOPEN:/dev/ptyp0,ignoreeof TCP:10.0.1.93:10002

    确保没有使用流量控制(硬件或软件)。

    有关“在 Mac OS X 中设置串行控制台”的更多信息,请参阅 here (例如 .plistgetty 开头的文件; screen /dev/cu.usbserial 115200 8N1 )。

    关于macos - GNU SCREEN - MAC OS X 10.8.2 的 USB 串行 tty 通信问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14474893/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com