iot-lab / iot-lab-mqtt

Provide access to IoT-LAB experiments as MQTT agents
Other
2 stars 8 forks source link

conflicts with paho-mqtt 1.3 #9

Open rfuentess opened 6 years ago

rfuentess commented 6 years ago

I just identified a problem with iotlab-mqtt-node. The option for poweron, poweroff, reset and update crashes in the server side with the following error:

callback(self, self._userdata, message)
File "/senslab/users/fuentess/.local/lib/python3.6/site-packages/iotlabmqtt/mqttcommon.py", line 327, in _wrapper
msg.reply_publisher = mqttc.publisher(reply_topic)
AttributeError: 'MQTTMessage' object has no attribute 'reply_publisher'

This means that the culprit is the upgraded made to paho-mqtt. I'm able to avoid the problem by forcing the use of paho-mqtt 1.2 yet, I suppose that we need to fix the root of the problem for the latest version.

cladmi commented 6 years ago

The __slots__ variable in MQTTMessage object is set since paho-mqtt == 1.3. So it prevents setting other attributes.

https://github.com/eclipse/paho.mqtt.python/blob/v1.3.0/src/paho/mqtt/client.py#L331