When reading Thingy52 gas telemetry (co2 and tvoc), the script is guaranteed to throw a ValueError eventually because the code does not take into account that these readings may contain hex values. This leads to ValueErrors like the following:
eco2 = int(teptep[:2]) + (int(teptep[2:4]) << 8) ValueError: invalid literal for int() with base 10: '9b'
Solution
Make sure that the code takes into account that the input values are expressed as hex values.
Problem
When reading Thingy52 gas telemetry (co2 and tvoc), the script is guaranteed to throw a ValueError eventually because the code does not take into account that these readings may contain hex values. This leads to ValueErrors like the following:
eco2 = int(teptep[:2]) + (int(teptep[2:4]) << 8) ValueError: invalid literal for int() with base 10: '9b'
Solution
Make sure that the code takes into account that the input values are expressed as hex values.