串口连接
tty与cu的区别
这个想法是补充软件在传入和传出呼叫之间共享线路;callin设备(通常为/dev/tty*)用于传入流量,只要DCD没有被硬件断言(即只要调制解调器没有载波),试图打开它的任何进程都会在open()调用中阻塞,在此期间,可以自由使用标注设备(通常为/dev/cu* - cu代表“呼叫单元”)。
打开/dev/cu不需要断言DCD并立即成功, 一旦成功,callin设备上的阻塞open()将被暂停,并且在DCD被引发时甚至无法完成,直到cu设备再次关闭;这样,你可以让一个getty监听/dev/tty,并且仍然可以不受限制地使用/dev/cu*。
连接
查看服务器串口,计算机-右键管理-计算机管理-系统工具-设备管理器-串口。
在特定情况下需要用网口转usb连接时,可以使用命令连接或者使用连接工具连接,注意需要使用serial协议,并且指定的波特率进行连接;连接工具可以使用secrueCRT;
连接命令:
screen /dev/cu.usbserixxx 9600
9600 为波特率
Screen
It’s not actually necessary to download an install extra software, as you can use the Mac OS X built in Terminal and screen
. Screen lacks some features, but it does include VT100/ANSI terminal emulation, and can be extremely useful.
- Open an OS X terminal session (window)
- Find the right TTY device. Type:
ls /dev/cu.*
With the USB-Serial adapter plugged in, you’ll get a list, including something like this:
$ ls /dev/cu.*
/dev/cu.Bluetooth-Modem /dev/cu.iPhone-WirelessiAP
/dev/cu.Bluetooth-PDA-Sync /dev/cu.usbserial
-
Then type: screen /dev/cu.usbserial 9600 (in this example).
The 9600 at the end is the baud rate. You can use any standard rate, eg, 9600, or 19200 for a Sig Server! -
To quit the screen app, type
CTRL-A
, thenCTRL-\
.
Type man screen
in Terminal for further information on screen
. (use ‘enter’ or ‘space’ to scroll, and ‘q’ to quit).