Similar to this thread I started mucking about with umqtt.simple with my broker allowing anonymous clients, but decided to slightly increase the security by requiring usernames. This is fine on a python script I have on my computer that is subscribed to the broker, but on my ESP it will not play nice.
Obviously if I don't include the user paramter in the MQTTClient thing, it fails to connect with an "MQTTException 5" which I believe is the broker denying access, which is fine. If I include the user I always get
Code: Select all
Traceback (most recent call last):
File "<stdin>", line 32, in <module>
File "simple.py", line 79, in connect
TypeError: object of type 'NoneType' has no len()
I've tried sending it as a byte ( b"namehere", also bytes("namehere", 2, "big"), and a few other bad attempts, but other than an integer they all return the same error. I even checked by having print(len(user)) right below the user="username" entry, but despite the script printing lengths, simple.py always seems to interpret the data as "NoneType".
I'm still pretty new at coding in general, I've only ever dabbled. So it's got me beat.