Currently using minicom as the serial port software. But the use of the process, there is a little feeling inconvenient place, is that I need to use multiple serial port, when the use of not the serial 0 o'clock, it is necessary to manually modify the configuration of the minicom.
So consider implementing scripts, automatically list the current serial port, choose to call minicom open the designated serial port, eliminate the trouble of manual modification.
First, in the Minicom configuration directory, create the configuration file
/etc/minicom/minirc.ttyusbx
The content is as follows, is actually to save/dev/ttyusb0 's configuration as a file
file " minicom-s " To change parameters.pu Port /dev/ttyusb0pu rtscts No
Then write the script myminicom.sh
#!/bin/Bash#set-Xports=`ls/dev/ttyusb*`SelectPortinch$ports; Do if[$port]; Then Echo "You Select the choice ' $port '"Port=${port##*/} sed-I."s/\ (PU Port *\/dev\/\). */\1$port/"/etc/minicom/MINIRC.TTYUSBX exec minicom ttyusbx [email protected] breakElse Echo "Invaild Selection" fi Done
Add executable permissions to give the script an easy-to-enter alias
LN -S/path/to/myminicom. SH /usr/bin/com
Need to open the serial port, enter COM, you can list the current serial port, select the corresponding serial port can be opened.
Added, I have configured the/dev/ttyusb* permissions to be accessible to this account, if not configured, you need to add sudo to the above script
This article link: http://www.cnblogs.com/zqb-all/p/7073612.html
Detect available serial ports under Linux and open with minicom