Closed rduivenvoorde closed 5 months ago
Hi @rduivenvoorde,
I'll check this! I don't have the issue on my setup, I'll check why!!
Could you please share your entire config of mqtt-exporter (without the passwords of course).
also, which MQTT server are you using? Because it is supposed to return a Client ID:
user_data = {"client_id": settings.MQTT_CLIENT_ID}
if not settings.MQTT_CLIENT_ID:
user_data["client_id"] = properties.AssignedClientIdentifier
I just blindly run the python example (after git clone) as described here: https://github.com/kpetremann/mqtt-exporter?tab=readme-ov-file#using-python
Not sure where the 'properties' is filled?
Running my own home server mqtt:
$ apt show mosquitto Package: mosquitto Version: 2.0.11-1.2+deb12u1
Thanks. I can reproduce the issue as well.
Looks like when MQTT_V5_PROTOCOL=True
, the Client ID is provided by the server and retrieved using properties.AssignedClientIdentifier
.
When it is set to False
, the property AssignedClientIdentifier
is not returned by the server.
I'll check with the documentation to see if it is defined in a different property or if it is a feature of MQTTv5 (in that case, I'll put a default value to the Client ID).
@rduivenvoorde It should be better with this branch: https://github.com/kpetremann/mqtt-exporter/tree/fix_mqtt_client_id
hello @rduivenvoorde,
The fix has been merged and released. Please confirm it solves the issue on your side.
closing the issue. Don't hesitate to re-open it if the fix is not enough.
Hi Thanks for you package!
Testing a vanilla pip install in /tmp I get:
Environment:
Ah, digging into it a little, it appears that we really need a client-id nowadays. So either set a default client id in settings.py (e.g. mqtt-exporter), or change the start instruction to: