| PySerial | ||||||||||||||||||||||||||||
| *** | Programming_Python | |||||||||||||||||||||||||||
| Ver | PySerial | |||||||||||||||||||||||||||
| 7/16/24 | ||||||||||||||||||||||||||||
| Index | ||||||||||||||||||||||||||||
| Basic | PySerial | http://pyserial.readthedocs.io/en/latest/shortintro.html | https://pyserial.readthedocs.io/en/latest/pyserial.html | |||||||||||||||||||||||||
| dotnetperls | ||||||||||||||||||||||||||||
| other | Short introduction | python3 -m pip install pyserial | ||||||||||||||||||||||||||
| pip | ||||||||||||||||||||||||||||
| PySerial | Opening serial ports | |||||||||||||||||||||||||||
| Finding the "COM" port in Linux (serial port) | ||||||||||||||||||||||||||||
| Testing ports | ls /dev | no "serial" is listed | ||||||||||||||||||||||||||
| Listing Ports | no "ttyACM0" was listed | |||||||||||||||||||||||||||
| python3 -m serial.tools.list_ports | will print a list of available ports | plugged a USB cable into the PC | ||||||||||||||||||||||||||
| ls /dev | "serial" was listed | |||||||||||||||||||||||||||
| Accessing Ports | "ttyACM0" was listed | |||||||||||||||||||||||||||
| python3 -m serial.tools.miniterm <port_name> | (use option -h to get a listing of all options) | |||||||||||||||||||||||||||
| ls /dev/serial/by-id ----> | ( .;;;….;.;.;;.;.;. … ) ---> ../../ttyACM0 | |||||||||||||||||||||||||||
| ls /dev/serial/by-path ---> | ( .;;;….;.;.;;.;.;. … ) ---> ../../ttyACM0 | |||||||||||||||||||||||||||
| To check if PySerial is installed: | ||||||||||||||||||||||||||||
| Python3 | ||||||||||||||||||||||||||||
| >>> | help("modules") | to get the list of modules installed | ||||||||||||||||||||||||||