!!!!!!!!! If you are using a VIRTUAL machine, ensure that the serial port device is mounted to the VIRTUAL machine!!

1. Serial Port Assistant available in Linux

There are two options for using a serial terminal under Linux:

  • Command line based Minicom
  • Putty for graphical user interface (XShell does not have Linux version)

Here are two kinds of introductions

2.Linux serial port devices

The serial port on Linux, unlike Windows, appears as a device file. In the /dev/directory, there are two cases:

  • Host configuration of the serial port: device files are usually ttyS0, ttyS1, etc., useddmesg | grep ttySTo view;
  • USB to serial port: Device files are usually ttyUSB0, ttyUSB1, etc., useddmseg | grep ttyUSBTo view;

Here I use the CH340 USB-to-serial cable, so the result is as follows:

3.minicom

3.1. Install minicom

Use the online installation of Minicom

sudo apt-get install minicom
Copy the code

3.2 minicom configuration

Next, configure minicom (-s indicates the configuration interface) :

sudo minicom -s
Copy the code

Enter theSerial port setupHere’s the Minicom configuration menu:

Change by entering the letter before each selection (case insensitive)

  1. Set the file name of the serial port device

  2. Setting Serial Port Properties

    Option E is used to set the serial port properties115200 8N1, so you don’t need to change it;
  3. Set hardware/software flow control

    F in the options is hardware flow control, G is software flow control, according to the corresponding letter change, press F here, the hardware flow control will be closed;

  4. Save Settings

    Press Enter to return to the configuration main menu and selectSave setup as dflMenu item, press Enter to save Settings:

  5. Exit the minicom main menu

    The selectedExit from MinicomExit the main course menuExit from MinicomExit the main menu.

3.3. Use minicom

(Note: Minicom is using a set of serial devices and needs to operate the serial device files described earlier, so use superuser permissions. If you don’t want to use sudo, you can change the serial device files and give permissions.)

Command line inputsudo minicom -c on(-c onEnter minicom serial port terminal:

At this time, if the board is powered on, it will output and print out serial port data:

4.putty

Installed 4.1.

Using putty installation online:

sudo apt-get install putty
Copy the code

4.2. The configuration

The inputsudo puttyCan run (because to operate serial device files, you need superuser permissions) :



Then connect to USB to serial port:

4.3. Use

After the connection is successful, it can be used