Detect available serial ports under Linux and open with minicom

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.