I\'m new to Python and am working on a sensor.
I\'m building my code line by line and I have trouble with the encoding/decoding part for bytes to string. Same code, sometime it
This may have have happened because your string had a non ascii character. When you ran your code again there was no non ascii character in the string and hence it ran successfully.
You can encode the non ascii characters by using encode() function