-sharp coding=utf-8
import serial
cmd = [0xa5, 0x00, 0x09, 0x0a, 0xcc, 0x33, 0xc3, 0x3c, 0xa6]
with serial.Serial("/dev/ttyAMA0", 115200, timeout=1) as ser:
for i in cmd:
k = chr(i)
ser.write(k)
s = ser.read(10)
print(s)
since the bytes of Python3 is passed into str by Python2, why do I report an error after converting the last data to be sent into bytes in Python3?