Shell mode
1. Use Minicon-s to configure the serial port and save;
2. Use setserial/dev/ttyusb0-a, etc. to view the serial configuration;
3. Receiving side cat/dev/ttyusb0 waiting for serial output;
4. Send echo "at+rst\r\n" >/dev/ttyusb0 send data.
Python mode
1. Download the pyserial package and the Importlib package required by the package;
2. Install both packages using the sudo python setup.py installation;
Enter Python in 3.shell to open Python shell;
4. Import Pyserial:import serial
5. Create serial ser = serial. Serial ('/dev/ttyusb0 ', 9600,timeout=1)
6. Open the serial port Ser.open ();
7. Write Data ser.write ("Hello");
8. Close the serial port Ser.close ()
Note : If the serial port mode is not a normal 8 N 1 mode, you need to configure the serial port using the first two steps in shell mode.
Reference
C language Mode
Reference 1
Reference 2
Reference 3
List of attachments
Linux serial debugging