I need help for python script that set baud rate in raw. Because on my raspberry after use sudo stty -F /dev/ttyUSB0 2400 raw and then reboot I lose baud rate and should execuse manually that command.

1 Answer 1


It would be helpful if you posted your existing Python code.

You could use the following:

import serial

port = '/dev/ttyUSB0'
baud = 2400

serialPort = serial.Serial(port, baudrate = baud, timeout = 0.5)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.