-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anonymous MQTT not working #355
Comments
Hey @J4nsen, correct me if I m wrong, but the
So the username and the password should be empty. What could be done, adding a check for empty mqtt.user/mqtt.password in the
Could you try that ? Cheers |
And, what build are you using ? Are you on the most recent git state ? |
Hi @dbambus, thanks for the fast reply.
Wireshark is showing hex values,
I dont completely understand the code (yet). What I see is that when opening the web-ui there are whitespaces in the username and password field. Even after removing them and saving the settings they reappear after reloading the ui.
I've applied the following patch. Wordclock is now able to connect to the broker :)
However, the connection seems a bit unstable. I see error messages like these in my broker log:
I'm on the latest git commit. I could write a PR which checks for an whitespace-only username/password and then uses the connect function without credentails. However, I think there is another problem, e.g., why am I unable to clear the whitespaces in the webui? |
Hey, I will elaborate the whitespaces once I finished work for today and also I ll try Wireshark and take a look at the mosquitto logs for it. Never had that issue before. Maybe try another QoS Level ? See PubSubClient.cpp for more Doc. Just a question, do you have your mosquitto running in a Docker ? Maybe take could also be an indicator: https://stackoverflow.com/questions/75534407/mqtt-malformed-packet |
Hi @dbambus, no hurry :)
mosquitto is running directly on the host. The reason why some clients cannot connect is that im running the This problem isn't new to me. For example, for Tasmota clients I have to disable/clear the username/password with "MqttUser 0" and "MqttPassword 0" or else it will use the firmware default. |
Hey @dbambus, awesome! :) I had a quick look at the code and saw that the reInit-function could potentially be called with user and password and thus break the reconnection attempt for anonymous access? |
Hey, I ve rewritten the part in the latest unmerged pull request. But it is not yet tested ;-) maybe you can do that ? Cheers |
Fixed with #397 |
Hi, my mqtt-server (mosquitto) only allows anonymous connections or ones for existing users.
However, ESPWortuhr always seems to set the user and password to 29 empty spaces, when the fields in the web ui are blank.
![image](https://private-user-images.githubusercontent.com/3029093/294497231-1a47a835-d8cd-45bc-ba79-52342db6d7b1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1MjAxMTMsIm5iZiI6MTcyMTUxOTgxMywicGF0aCI6Ii8zMDI5MDkzLzI5NDQ5NzIzMS0xYTQ3YTgzNS1kOGNkLTQ1YmMtYmE3OS01MjM0MmRiNmQ3YjEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjBUMjM1NjUzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmUyZTZlMzg2YzIxMjQyODUwOTRiYThhNTU1ZTM0YzA1Nzc2MTBmNGEwZmM3OWQyY2Q1ZTY5MjRmMzMzM2M5NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.UF6W_sUjsd7qZ6eYE-CRL1V5DYPdm0e2P-rwOo6sT88)
It would be nice, if a connection without username and password would be made, when the fields are empty, i.e., setting username and password to
NULL
on the connect-function.Thanks for the nice project! :)
The text was updated successfully, but these errors were encountered: