python serial write hexadecimal string -
i have string in python:
string = "\x02\x30\x31\x48\x41\x4e\x4f\x56\x45\x52\x03\x38\x39"
if do:
serial.write(message)
everyting works expected. here problem:
i have function generates above string. if debug using print, exact same string shows up. however, when try send via serial, not send hex. sends longer text (52 instead of 13 bytes), not recognised receiving device.
how can convince python send string containing same hex?
Comments
Post a Comment