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

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -