Tools and Methods - Serial Port Tool Minicom under Linux

It is necessary to open two serial ports to debug the device, maybe because of the influence of the Ubuntu virtual machine, or other problems, often one or two serial devices are not working properly, and the computer needs to be restarted, which is very troublesome.

The reason is probably the device driver problem. For example, if you use the tool MobaXterm to open the serial port, it will show that the device cannot be found:

 

I didn't find a suitable solution, so I thought about using the serial port tool in Linux, would it solve the problem under Windows.

The following introduces a tool minicom, which is a serial port tool with a text-based interface for serial communication, such as RS-232 equipment, terminal serial ports for debugging, etc. It is open source and free for Unix-like systems, including Linux.

Minicom is similar to HyperTerminal under Windows, and also similar to TELIX in DOS.

The first step is to connect the serial device to the Ubuntu of the virtual machine.

Right-click on the upper right corner of the virtual machine and choose to connect to this serial port device. I use VMware Workstation Player. If it is VMware Workstation Pro, it may be slightly different.

 

The second step is to open the terminal, ctrl + alt + T.

Run the command:

sudo apt install minicom

The third step is to find the device name of your serial port.

dmesg | grep tty

According to the output log, you can see the name of the serial device added, for example: /dev/ttyUSB0

Step 3: Run minicom on the terminal.

sudo minicom -s

The interface is displayed as follows:

 

Use the keyboard, the up and down keys to browse, select Serial port setup, and then press the A key to enter the device name:

A -    Serial Device      : /dev/ttyUSB0

 

After the input is successful, press Enter to save and return to the previous menu, and then press Enter or ESC to exit the Serial port setup.

There are many options that can be set, including software and hardware flow control, as well as baud rate, data bits, parity, and stop bits. Generally, the baud rate of 115200, the transmission unit of 8bit data, the parity bit and 1 stop bit are not used.

After the setup is complete, you can choose Save setup as dfl to save the device in /etc/minicom/minirc.dfl as the default default configurations for future use.

At this time, select Exit, and you will enter the serial port operation prompt interface.

Then press ESC to enter the serial port working mode, display the serial port printing information, and input commands.

In the setting item, you can also save the log to a file, select Filenames and paths -> F - Logging options. The default file name is minicom.log, you need to add an actual path to save the log to a file under the specified path.

In the serial port working mode, to set the minicom tool, there are some commands. For specific instructions, you can press Ctrl-A, and then press Z to view.

For example, to exit the minicom application, first press Ctrl-A, then press X, and the exit option will be displayed.

In the working interface, to call out the setting menu, you need to press Ctrl-A first, and then press O.

reference:

1, Minicom - Community Help Wiki

2,NetModem Support: using Minicom with NetModem Server

Guess you like

Origin blog.csdn.net/guoqx/article/details/130074277