Again in all cases like this it would help if you actually show your complete programs and maybe pictures of hook up... As such that maybe someone can replicate your program...
On my RPI3, I ran the following: $ python3 ./led_on.py
Where led_on.py is:
Code:
#!/usr/bin/env python
import serial
port = '/dev/ttyUSB0'
baud = 38400
ser = serial.Serial(port, baud)
ser.flushInput()
ser.flushOutput()
ser.write(b'0xff')
ser.write(b'0xff')
ser.write(b'0xfe')
ser.write(b'0x04')
ser.write(b'0x03')
ser.write(b'0x19')
ser.write(b'0x01')
ser.write(b'0xe0')
ser.flush()
ser.close()
I then looked at what was output, by simply hooking up my logic analyzer to the FTDI cable.

What you will see is the lines like: ser.write(b'0xff')
Actually output the ASCII characters: 0xff
Not the single byte value 0xff
Hopefully @jwatte knows more here as I see you are on this thread
Bookmarks