I want to read the serial data from arduino in python in ubuntu operating system. The arduino application is running fine but when I open the same port in python in my case port is '/dev/ttyACM0' is not opening. I have tried to change the permissions of the port. But still it is not working.
2 Answers
0
votes
0
votes
If you are using a usb to serial converter, like its built in on arduino development boards, it should usually be something like /dev/ttyUSB0.
Also make sure you are in the dialout and tty group:
usermod -aG tty $USERNAME
usermod -aG dialout $USERNAME
Your program should look something like this:
import serial
ser=serial.Serial()
ser.port="/dev/ttyUSB0"
ser.baudrate=9600
ser.open()
ser.write("hello world")
Can you show us your program?