Python Forum

Full Version: Using USB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I have a USB to serial converter on /dev/ttyUSB0 and try writing to it but nothing happens:

#!/usr/bin/python


import serial
import sys

# Set Port
ser = serial.Serial('/dev/ttyUSB0', 57600, 8, 'N', 1, timeout=1)

ser.open()   # Reopen the port.

reset = "Hello World"
ser.write(reset)

time.sleep(.5)

print 'serial closed'
ser.close()
What am I doing wrong?