python - Using pyserial to send binary data -


i know there has been lot of discussion on still have question. trying send hex values through pyserial device using pyserial

command="\x89\x45\x56" ser.write(command) 

however keep getting error saying string argument without encoding. know how solve this?

if python 3, it's treating string unicode, , doesn't know how transform it. think mean use bytes here:

command=b"\x89\x45\x56" 

Comments