MQTT library conflict with pybytes
-
Re: Pybytes: MQTT ERROR! function got multiple values for argument 'user'
Any updates on the MQTT error?
Seems to be a conflict between the use of pybytes and the MQTT library.
-
I will also give this a try thanks for sharing!
I am new to python and micopython, if stuck in such a problem for days...
I changed firmwares over and over. Even got me an Windows PC (Mac User..)Again - thanks for sharing :)
-
@Gijs
Hi Gijs,
Sure, that's okay with me.
-
Hi,
I really like your solution,
If it is okay with you, I'll post it to the docs!Gijs
-
If anyone else has the same problem, here is a solution.
Problem:
Pybytes does not start when the mqtt.py library is installed on the device.
The device throws the following error during boot:WiFi connection established MQTT Protocol MQTT ERROR! function got multiple values for argument 'user' ERROR! Could not connect to Pybytes! Pybytes configuration read from /flash/pybytes_config.json
This occurs during boot, so even if main.py and boot.py on the device are empty files. Probably pybytes is using the MQTTClient class in the mqtt library in the lib folder when it shouldn't.
Rename the class in mqtt.py:
class MQTTClient_lib:
Rewrite your code for the name change or use an alias where the library is included to keep the source unmodified:
from mqtt import MQTTClient_lib as MQTTClient
This solved the issue for me.