I have a Ignition Maker license running an MQTT Engine and MQTT Transmission Module.
I am using the Transmission Module to subscribe to the tags in this folder (topic):
I’m able to subscribe to messages that the transmission module is publishing, I’m not having much luck decoding the message in a meaningful way.
Here is my function which decodes the message
def on_message(client,userdata, msg):
topic=msg.topic
m_decode=str(msg.payload.decode("utf-8","ignore"))
print ('message received')
print ('topic for this message: ', msg.topic)
print ('raw payload: ',msg.payload)
print ('payload with utf8 decoding:', m_decode, '\n')
Here is what the payload looks like, raw and decoded:
message received
topic for this message: spBv1.0/default/DDATA/SWD/CATTLE CREEK INJECTION PAD 1
raw payload: b'\x08\xb0\xc8\xe8\xc6\x8a0\x12E\n1SWD/CATTLE CREEK INJECTION PAD 1/ANNULUS PRESSURE\x18\xc7\xc0\xe8\xc6\x8a0 \t8\x00J\x00e\xf8u$C\x12D\n0SWD/CATTLE CREEK INJECTION PAD 1/TUBING PRESSURE\x18\xc7\xc0\xe8\xc6\x8a0 \t8\x00J\x00ezXsD\x12D\n0SWD/CATTLE CREEK INJECTION PAD 1/CASING PRESSURE\x18\xc9\xc0\xe8\xc6\x8a0 \t8\x00J\x00e\x13S\x1eE\x18o'
payload with utf8 decoding:Ɗ0E
1SWD/CATTLE CREEK INJECTION PAD 1/ANNULUS PRESSUREƊ0 8 J eu$CD
0SWD/CATTLE CREEK INJECTION PAD 1/TUBING PRESSUREƊ0 8 J ezXsDD
0SWD/CATTLE CREEK INJECTION PAD 1/CASING PRESSUREƊ0 8 J eSEo