I have a python script that is subscribing to the MQTT topic that the picow-air is publishing to, and occasionally (a couple of times an hour), it fails to decode the payload. I am using the paho mqtt library.
Here is the code I am using:
def onMessage(client, userdata, msg):
try:
s = str(msg.payload.decode())
// [omitted - do stuff with s]
except Exception as e:
print(f"Exception decoding payload: {msg.payload}")
print(e)
I have a python script that is subscribing to the MQTT topic that the picow-air is publishing to, and occasionally (a couple of times an hour), it fails to decode the payload. I am using the paho mqtt library.
Here is the code I am using:
Here is the error:
The invalid start byte is different each time.