Linux serial debugging

Source: Internet
Author: User
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

    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.