Thermal Camera Coding

In the payloads.py file under the AvrThermalReadingPayload class there is example code on how to decode data sent from the thermal module. This example code does not work and errors. The first error happened in the line: data = json.loads(payload)[‘data’]. I believe it happened as the [‘data’] was outside the () and passed a dict as the parameter instead of a str. I fixed that but the resulting error is something I cannot figure out: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0).

Please advise on how to fix this!
Thank you,
HPBT-1

So, this is the example of parsing the data from the GUI:

In this context, payload is a raw string of JSON data. It sounds like for you payload is actually a AvrThermalReadingPayload class, so that has already been parsed from JSON. Instead, you would do:

data = payload["data"]
1 Like