paho MQTT on_message returning a funny message - python
<p>some help please :)
I just started to play with MQTT in python.
When I run the following program:</p>

<pre><code>import paho.mqtt.client as mqtt 

def on_connect(client, userdata, flags, rc):
    print("Connected with result code "+str(rc))
    client.subscribe("watchdog/#")

def on_message(client, userdata, msg):
    message = str(msg.payload)
    print(msg.topic+" "+message)

client = mqtt.Client()
client.username_pw_set('XXXX', password='XXXXXXX')
client.on_connect = on_connect
client.on_message = on_message

client.connect("XXXX", XXXXX, 60)

client.loop_forever()
</code></pre>

<p>the payload always have the following text:</p>

<p>b'XXX'</p>

<p>XXX is the message, but the b' ' part ALWAYS appear.
once i open the same message on off the shelf client, the message is fine... so i assume the problem is in the code, but i cannot find where.</p>

<p>any help or directions?</p>

<p>thanks!</p>