-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Client ID is not detected and therefore a random ID is used #76
Comments
I found this problem a while back and have been testing a fix. It looks like the current code is mishandling the "MQTT_CLIENT_ID" coming in from the environment. I have highlighted two lines below that seem to fix the problem. You can try this and see if it fixes the problem for you. It does for me. If so I can submit a pull request. From flask_mqtt/init.py:
|
This change of simply moving the If statement to the first line works for me. A PR would be greatly appreciated as I am running this on Heroku and can't have locally modified packages. |
Fixed by #77 |
Thanks @skrapi for fixing this issue |
Hi,
I am attempting to connect to the Thingstream MQTT broker which requires that you use specific Client IDs, I have been able to do this using the paho mqtt library, but I am running into an issue with the Flask-MQTT library.
I set the id as shown below:
app.config['MQTT_CLIENT_ID'] = "device:69f2xxxxdaad"
and print it out to be sure:
print(app.config['MQTT_CLIENT_ID'])
but when looking at the logs I see this:
The device ID is not detected and a random one is used. Any help would be greatly appreciated.
Thanks,
Sylvan
The text was updated successfully, but these errors were encountered: