In this scripts, we will use serial port. We need some package and drivers for it,
- pyserial
conda install pyserial
Install ftdi driver
- libusb-1.0
apt-get install libusb-1.0
- create
/etc/udev/rules.d/11-ftdi.rules
Find the manufacturer ID and product ID
lsusb
It shows something like the following
Bus 002 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
In this case, the manufacturer ID is 067b and product ID is 2303.
Create a file /etc/udev/rules.d/pl2303.rules
and add the following line
# PL2302 USB2.0-RS232 convertor
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", GROUP="usbtmc", MODE="0660"
Then, restart.
Find the COM port
dmesg | grep tty
It should be like /dev/ttyUSB0
Install ftdi driver
Find the COM port. It will look like COM3