How to use USB to switch serial device under Ubuntu

Source: Internet
Author: User

USB Serial Port Use summary:

First look at the General tutorial:

Installation:
sudo apt-get install minicom

Configuration:
1. Enter the minicom in the terminal to start the minicom;
2. Press CTRL + A first, release, then press O, the Configuration menu appears.
3. Select Serialport Setup, at which point the icon in the "Changewhich setting", type "a", at this point the cursor moved to the corresponding section A: serial COM1 corresponding ttys0,com2 corresponding ttyS1. (Note selection)

The specific configuration information is as follows:
Serialport Setup[enter]
+-------------------------------------------------------------+
| A-serial Device:/dev/ttyusb0 |
| B-lockfile Location:/var/lock |
| C-callin Program: |
| D-callout Program-: |
| e-bps/par/bits:115200 8N1 |
| F-hardware Flow Control:no |
| G-software Flow Control:no |
| |
|                                   Change whichsetting? |
+-------------------------------------------------------------+

Note: If you do not use USB to the serial port, but the direct use of the serial port, then serialdevice to configure for/DEV/TTYS0 (if the use of USB to the serial port, you need to see if the dev under the existence of ttyUSB0, if not, then create a: mknod/ Dev/ttyusb0 C 188 0)
For baud rate, data bit and stop bit configuration, type "E", baud rate selected as 1152008N1 (parity No, stop bit 1),
Hardware/Software flow control type "F" and "G" respectively and select No.
After confirming that the configuration is correct, type carriage return to the superior configuration interface and save it as the default configuration. (That is, savesetup as DFL), after the restart minicom is just configured to take effect, in the connection to the Development Board of the serial line, you can print the correct serial information in the minicom.

At this time can print the information of the serial port, but in the serial port with the XMODEM protocol burned to write the kernel will prompt no Xmodem protocol.
So you must also install the package: Lrzsz
Sudoapt-get Install Lrzsz
At this time can be normally used minicom through the serial port to burn the core to write.

The next time you enter Minicon, you can enter directly.
Command minicom is to enter the serial Port Super Terminal screen, and minicom-s for configuration minicom.
Description/DEV/TTYS0 corresponds to port 0 for you to connect the Development Board.

Note: non-normal shutdown minicom, will create a few files under/var/lock lck*, these files prevent the minicom run, delete them can be restored

The key combination is to press the CTRL + a key combination, then release the two keys, and then press the Z key. There are also some commonly used key combinations.
(1) S key: Send the file to the target system;
(2) W key: Automatic volume screen. Automatically wraps the following text when the displayed content exceeds a row. This feature is useful when viewing the kernel's startup information.
(3) C key: Clear the screen display content;
(4) B key: Browse the history of the minicom display;
(5) X key: Exit Minicom, will prompt to confirm exit.

3. Directory of configuration files
CTRL + A--> O
+-----[Configuration]------+
| Filenames Andpaths |
| File Transfer protocols-|
| Serial Port Setup |
| Modem and Dialing |
| Screen and keyboard |
| Savesetup as DFL |
|          Savesetup as.. |
| Exit |
+--------------------------+

Select "Filenamesandpaths"
+-----------------------------------------------------------------------+
| A-download Directory:/home/crliu |
| B-upload directory:/tmp |
| C-script Directory: |
| D-script Program:runscript |
| E-kermit Program: |
| f-loggingoptions |
| |
|                                             Change whichsetting? |
+-----------------------------------------------------------------------+

(1) A-download download file location (Development Board--->PC)
The files on the Development Board will be transferred to the/home/crliu directory on the PC.
(2) B-upload read uploaded files from here (PC---> Development Board)
The PC sends files to the Development Board and needs to send the files in the/tmp directory (the directory on the PC). Once this configuration is done, each time you send a file to the Development Board, you can simply enter a file name without having to enter the absolute path of the directory where the file is located.

Following the generic tutorial, I created the ttyUSB0, but the problem is my Ubuntu does not start the pl2303 module, the solution

step1,cd/lib/modules/2.6.32-42-generic/kernel/drivers/usb/

Step2, sudo modprobe pl2303

Step3, Sudo/etc/init.d/nfs-kernel-server restart

STEP4, reseat USB switch serial device

Step5,sudo minicom

Ok.







Below is

For the notebook holder without serial port, do hardware development is often not a serial port and worry, but now has a USB switch serial device. But the new problem again, for example, for minicom PC and Target machine communication or there are some configuration problems, the following is the Linux USB to the serial port of the specific configuration and problems:

Note: By default, Ubuntu has a USB port driver (pl2303) installed.

1, # Lsmod | grep usbserial
If there is usbserial, the system supports USB to the serial port.

2, plug in the USB to the serial port, in the terminal input command #dmesg | grep ttyUSB0, if a connection success message occurs, the Ubuntu system has identified the device.

Note: Ubuntu in the virtual machine environment is not automatically recognized by default, you need to click "Prolific Usb-serial Controller" in the lower-right corner of the virtual machine window, and then choose Connect (Disconnect from Host). This will be recognized by the Ubuntu system.

3, in the above minicom configuration set serial Device:/dev/ttyusb0, restart the Development Board, so basically can normally use minicom to print serial information.

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.